Composite report

We currently work with composite reports using something like:   

MainReport := TrelReciboCartao.Create(Application);
TrelReciboCartao(MainReport).CodCartaoEntrega := aCodCartaoEntrega;

if Reports.Count > 0 then
  begin
  MainReport.PreparaRelatorio;
  for i := 1 to Reports.Count - 1 do
    begin
    Reports[i].PreparaRelatorio;
    MainReport.Relatorio.PreviewPages.AddFrom(Reports[i].Relatorio);
    end;
  MainReport.Relatorio.ShowPreparedReport;
  end;

Where all the reports are defined in Forms, with a TfrxReport in it called Relatorio. So, Reports is a list of these forms that will be aggregated to the main report. This works fine, but breaks the page before adding the next report. This makes no difference for digital documents, but it can represent a waste of paper for the printed ones. So we want to generate these composite reports using all available page space, that is, start printing the next report at the point where the predecessor ended. We have already marked the EndlessWidth property of the frxReportPage for all the reports involved, and the PrintOnPreviousPage property of the frxReportPage for all the secondary reports but it didn't work as expected.

Does anyone know how to do that?

Comments

  • Use one instance of TfrxReport and use TfrxReport.PrepareReport(False). PrintOnPreviousPage will works in this case

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.