Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Impresión
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo Hace 1 Día
delphi50jmb delphi50jmb is offline
Miembro
 
Registrado: jul 2007
Posts: 27
Poder: 0
delphi50jmb Va por buen camino
Smile Reporte subtotalizado con datos SQLFirebird no funciona

Hola Estimados.
Esta pregunta la hice hace un a±o atras y no logre resolver el problema. Por eso vuelvo a platear la inquietud.

Estoy migrando mis aplicaciones desde Paradox a SQL. Tengo un reporte muy sencillo, con cuatro bandas de detalle. Una banda para los titulos, una banda para agrupar por una expresion, una banda para el detalle de productos, y una banda para los totales. Este reporte muestra los detalles de venta de un cliente, y subTotaliza por mes.

Este reporte funciona perfecto con delphi y paradox. Pero ahora al trabajar con SQL-Firebird, al poner un valor en la "propiedad Expresion" (Expresion = Mes) de la segunda banda (Banda tipo: TQRGroup), me aparece un mensaje que dice: "Operation not allowed on a unidirectional dataset". Si quito el valor en la propiedad "expresion", este funciona correctamente, pero obiamente no subtotaliza.

Con tablas paradox, el reporte funciona perfectamente. Pero la realizar el mismo con SQL-Firebird no funciona.

El archivo que estoy tratando de imprimir esta ordenado por el campo: Mes.

Esta es la consulta SQL. Funciona perfectamente. Lo que no funciona es el reporte subTotalizado.

Código SQL [-]
 SQL_String.Close;

   SQL_Text := 'SELECT DetFact.TipoDoc, DetFact.Rut, DetFact.CodAux, DetFact.Numero, ' +
                     'DetFact.FechaEmi, DetFact.Mes, DetFact.Codigo, DetFact.Descrip, DetFact.Cantidad, ' +
                     'DetFact.TotalLinDe, DetFact.Vendedor, Vendedores.Nombre ' +
                     'FROM DetFact '                                 +
                     'LEFT JOIN Vendedores '                            +
                     'ON Vendedores.Codigo=DetFact.Vendedor ' +
                                       'WHERE DetFact.FechaEmi>=' + QuotedStr( sFechaSel ) +  ' ' +
                     'ORDER BY Mes ASC ' + ';';

   SQL_String.CommandText := SQL_Text;
   SQL_String.Open;

Estoy usando componentes DbExpres.

Alguna idea de que pasa? , y como solucionar esto?

Gracias de antemano.

Saludos.
Jose Miguel B.
Responder Con Cita
  #2  
Antiguo Hace 1 Día
delphi50jmb delphi50jmb is offline
Miembro
 
Registrado: jul 2007
Posts: 27
Poder: 0
delphi50jmb Va por buen camino
Red face

Este es la estructura del reporte.

Código Delphi [-]
unit UQrDetDocVta;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Qrctrls, Db, QuickRpt, ExtCtrls;

type
  TFQrDetDocVta = class(TForm)
    QrDetDocVta: TQuickRep;
    QRBand2: TQRBand;
    QrBandDet: TQRBand;
    QRlNombEmpresa: TQRLabel;
    QRTitulo: TQRLabel;
    QRShape2: TQRShape;
    QRShape1: TQRShape;
    QrTipDoc: TQRLabel;
    QRPagina: TQRLabel;
    QRFecha: TQRLabel;
    QRBand1: TQRBand;
    QRShape3: TQRShape;
    QRHora: TQRLabel;
    QRSysHora: TQRSysData;
    QRLabel4: TQRLabel;
    QRMaxMinimo: TQRLabel;
    QrTotDoc: TQRLabel;
    QrNombre: TQRLabel;
    QRSysData1: TQRSysData;
    QRSysData2: TQRSysData;
    QrLabel1: TQRLabel;
    QrFecDoc: TQRLabel;
    QRLabel3: TQRLabel;
    QRGDetMes: TQRGroup;
    QRSubTotalMes: TQRBand;
    QrProveed: TQRLabel;
    qrNeto: TQRLabel;
    QRShape6: TQRShape;
    QRLabel2: TQRLabel;
    QrNumDoc: TQRLabel;
    QRLabel8: TQRLabel;
    QrCantDoc: TQRLabel;
    QrSubTitulo: TQRLabel;
    QrCodigo: TQRLabel;
    QRLabel7: TQRLabel;
    QRLabel5: TQRLabel;
    QrCostoDoc: TQRLabel;
    QRLabel9: TQRLabel;
    QrIva: TQRLabel;
    QrLabel20: TQRLabel;
    QrTotal: TQRLabel;
    QRLabel13: TQRLabel;
    procedure QrDetDocVtaBeforePrint(Sender: TCustomQuickRep;
      var PrintReport: Boolean);
    procedure QrBandDetBeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
    procedure QrDetDocVtaStartPage(Sender: TCustomQuickRep);
    procedure FormActivate(Sender: TObject);

    procedure QRSubTotalMesBeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);

  private
    { Private declarations }

  public
    { Public declarations }
  end;

var
  FQrDetDocVta: TFQrDetDocVta;
  nPagina : Integer;
  iTTotal   : Extended;

implementation
uses UVarGlobales, ULibrerias, UDt1;

{$R *.DFM}



procedure TFQrDetDocVta.FormActivate(Sender: TObject);
begin
   nPagina :=0;
end;


procedure TFQrDetDocVta.QrDetDocVtaStartPage(Sender: TCustomQuickRep);
begin
   nPagina := nPagina + 1;
end;


procedure TFQrDetDocVta.QrDetDocVtaBeforePrint(Sender: TCustomQuickRep;
  var PrintReport: Boolean);

begin
   sMenuOpc := 'Informe Detallado de Ventas';

   QRlNombEmpresa.Caption := sEmpresa;
   QrTitulo.Caption := sMenuOpc;
   QrSubTitulo.Caption := '(' + 'Desde: ' + sParam1 + ' Hasta: ' + sParam2 + ')';

   QrDetDocVta.DataSet := SQL_String;
   QRSysHora.Data      := qrsTime;
end;


procedure TFQrDetDocVta.QrBandDetBeforePrint(Sender: TQRCustomBand;
  var PrintBand: Boolean);
begin
   QrFecDoc.Caption   := SQL_String.FieldByName( 'FechaEmi'  ).AsString;
   QrTipDoc.Caption   := SQL_String.FieldByName( 'TipoDoc'  ).AsString;
   QrNumDoc.Caption   := SQL_String.FieldByName( 'Numero'  ).AsString;
   QrCodigo.Caption   := SQL_String.FieldByName( 'Codigo'  ).AsString;
   QrNombre.Caption   := SQL_String.FieldByName( 'Descrip'  ).AsString;
   QrCantDoc.Caption  := SQL_String.FieldByName( 'Cantidad' ).AsString;

   QrTotDoc.Caption   := Picture(SQL_String.FieldByName( 'TotalLinDe' ).AsString);

   itTotal := itTotal + StrToFloat(SQL_String.FieldByName( 'TotalLinDe' ).AsString);
end;



procedure TFQrDetDocVta.QRSubTotalMesBeforePrint(
  Sender: TQRCustomBand; var PrintBand: Boolean);          <------- Cuando entra aqui para subtotalizar por mes, se cae, y presenta el mensaje: "Operation not allowed on a unidirectional dataset".
begin
   QrTotal.Caption := FloatToStr(itTotal);
   itTotal := 0;
end;
end.

Gracias de antemano.
Saludos.
Jose Miguel B.
Responder Con Cita
  #3  
Antiguo Hace 23 Horas
Avatar de Casimiro Notevi
Casimiro Notevi Casimiro Notevi is offline
Moderador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.180
Poder: 10
Casimiro Notevi Tiene un aura espectacularCasimiro Notevi Tiene un aura espectacular
Responder Con Cita
  #4  
Antiguo Hace 14 Horas
delphi50jmb delphi50jmb is offline
Miembro
 
Registrado: jul 2007
Posts: 27
Poder: 0
delphi50jmb Va por buen camino
Hola Casimiro.
Agradesco tu respuesta. Pero estoy usando Componentes DbExpres, y el DataSet no tiene esa propiedad que me indicas.

Saludos.
Jose Miguel.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Reporte sin datos Nomad Impresión 3 25-09-2013 04:33:07
Reporte agrupando datos ingabraham Impresión 9 13-07-2011 15:20:35
reporte con varios datos ingabraham Impresión 0 14-10-2010 19:48:47
Mostrar datos en reporte natalinuyo Varios 3 22-03-2007 21:08:53
Actualizar datos de una base de datos en un reporte Marymania Impresión 4 27-11-2006 19:47:32


La franja horaria es GMT +2. Ahora son las 10:20:40.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi