Ver Mensaje Individual
  #5  
Antiguo 07-09-2006
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Reputación: 27
Caral Va por buen camino
Hola denuevo
Este es un simple codigo que llama a un reporte de compras por medio de un query.

If Reporte = 'ComprasXFecha' then
begin
ShortDateFormat := '#yyyy/mm/dd#';
try
QRComprasXCliente:=TQRComprasXCliente.Create(self);
QRComprasXCliente.ADOQuery1.SQL.Add(' WHERE CxPagar.TipoTransac="FA" ');
QRComprasXCliente.ADOQuery1.SQL.Add(' AND FechaTransac >= '+DateToStr(DTP1.Date)+' AND FechaTransac <= '+DateToStr(DTP2.Date));
QRComprasXCliente.ADOQuery1.SQL.Add(' ORDER BY CodProveedor, FechaTransac;');
QRComprasXCliente.ADOQuery1.Open;
ShortDateFormat := 'dd/mm/yyyy';
QRComprasXCliente.Titulo.text := 'Compras Realizadas por Fecha';
QRComprasXCliente.QRLblDesde.Caption := DateToStr(DTP1.Date);
QRComprasXCliente.QRLblHasta.Caption := DateToStr(DTP2.Date);
If RadioGroup1.ItemIndex = 0 then QRComprasXCliente.Print
else QRComprasXCliente.Preview;
finally
QRComprasXCliente.Free;
end;

Tal vez te sirva para completar tu enlace al qreport y no te de errores
Por lo menos a mi me sirve.
Saludos
Responder Con Cita