TQRCompositeReport

The Composite report component allows many reports to be combined into a single document.

This is done by using the components 'AddReports' event, during which the 'Reports.Add' method is called to add report to the list to be combined.

The code snippet below illustrates how this is done. A composite report component called 'comprep' is referred to, as are quickrep components on two forms, repfrm1 and repfrm2.

procedure MakeComp;
begin
    comprep := TQRCompositeReport.Create( mainfrm);
    comprep.OnAddReports := mainfrm.CompRepAddReports;
    comprep.Preview;
    comprep.free;
end;

procedure Tmainfrm.SpeedButton1Click(Sender: TObject);
begin
    MakeComp;
end;

procedure Tmainfrm.CompRepAddReports(Sender: TObject);
begin
   comprep.Reports.Add( repfrm1.quickrep1 );
   comprep.Reports.Add( repfrm2.quickrep1 );
end;