Advanced Report Design

Composite reports

Composite reports means concatenation of full processed reports, the union is serial but the free space for the last page of the previous report can be used by the next report.

To compose reports you must set two pass report option in all the reports implied.

Using composite reports with VCL/CLX components

You must have two TRpReport objects available, you can place two TVCLReport components in a form for example, the TVCLReport.Report property contains the TRpReport object if you assigned a filename, or used LoadFromStream method of TVCLReport.

Lets name ReportOne and ReportTwo as the two TVCLReport components, the code to preview or print the composite report is:

//

uses rpreport,rpgdidriver...

rpgdidriver.CalcReportWithProgress(ReportOne.Report);

ReportTwo.Report.Compose(ReportOne.Report,false,nil);

ReportTwo.Execute;

//

Using composite reports with ActiveX components

You must have at least two ActiveX component, set the filename and calculate the report before composite. For example, for three reports:

reportman1.filename = "c:\repsamples\sampl2.rep"
reportman1.CalcReport(True)
reportman2.filename = "c:\repsamples\sampl3.rep"
reportman2.Compose(reportman1.Report, False)
reportman2.CalcReport(True)
reportman3.filename = "c:\repsamples\sampl4.rep"
reportman3.Compose(reportman2.Report, False)
reportman3.Preview = True
reportman3.Execute()