He probado de dos maneras: Incluyendo el objeto TQuickReport en el formulario desde donde ordeno el listado, o en otro TForm, que cargo dinámicamente. En ambos casos falla!!!.
Esto es lo que hago.
Código:
For Contador:=Low(Agencias) To High(Agencias) Do
Begin
Ficha:=TfrmQRFactProvE.Create(Self);
With Ficha.Query Do
Begin
Close;
SQL.Clear;
Consulta:='Select * from Linvales Where ˇAgc_lval='+IntToStr(Agencias[Contador])+
' And extract(month from Fec_lval)='+IntToStr(cboMes.ItemIndex+1)+
' And extract(year from Fec_lval)='+IntToStr(cboYear.ItemIndex+1990)+
' And fac_lval=0 Order by Num_lval';
SQL.Add(Consulta);
Open;
End;
If Not cbxPantalla.Checked Then
Ficha.QuickReport.Print
else
Ficha.QuickReport.Preview;
Ficha.QuickReport.Dataset:=Nil;
Ficha.Free;
Application.ProcessMessages;
End;