Print and Preview diffrent after Batch
I try to make a Batch report with fastreport version 5.5.11. Using Delphi Berlin.
That???s basically my code:
With the Showmodal I get what I want in the Preview but with the ShowReport it is just printing the second part of the file. Also the result has the name just of the second file. And if I use the Create PDF Option as a Printer, it makes a PDF just of the second page.
That???s basically my code:
var
  Filename : string;
  pdf : String;
  frm : TfrmReportPreview;
begin
  Filename :=  'Name des Reports;
  pdf      := '.pdf';
  frm := TfrmReportPreview.Create(self);
    try
      AddDatasetsListe(frm);
      frm.BeginPrepareBatchReport;
      frm.LoadFromFile(TwiPathUtils.ReportPath + ???Report1.fr3');
      frm.PrepareBatchReport();
      Refresh_cdsMahnungen();
      AReportfrx.AddDataSet(DBDSPrintMahnungen);
      AReportfrx.LoadFromFile(TwiPathUtils.ReportPath + ???Report2.fr3');
      AReportfrx.PrepareBatchReport();
      AReportfrx.EndPrepareBatchReport();
      AReportfrx.GetSaveFilename(Filename,pdf, pdf)
      AReportfrx.ShowModal;
      AReportfrx.ShowReport(rmPrint);
 Â
    finally
      frm.Free;
    end;
With the Showmodal I get what I want in the Preview but with the ShowReport it is just printing the second part of the file. Also the result has the name just of the second file. And if I use the Create PDF Option as a Printer, it makes a PDF just of the second page.
Comments
You've omitted the parameter in both calls to PrepareBatchReport. I don't have FastReport or the manual available at the moment, but I think you need to specify "False" in the second (and subsequent) calls...
Cheers, Paul
https://www.delphipraxis.net/181470-fast-re...ch-reports.html
But in Verison 5 there is no prepareReport and the prepareBatchReport don't have a parameter.