Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Exporting multiple reports to PDF as one file?

edited June 2002 in General
Hi,

The following code is to print out multiple reports as one print job from a
table. I need to do something similar, only I need to export to PDF as one
file with multiple reports loaded from the database. How do I do this?
What Device would I use to accomplish this? Any help would be appreciated.

////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/////////////////////////


procedure TformProposalUI.PrintMedicalProductGrid;
// printing the report templates as one print job
var
lPrinterDevice : TppPrinterDevice;
integerX : integer;
integerCount : integer;

begin
integerCount :=
formdatamoduleQuoteOutput.tableReportMedicalTemplates.RecordCount;
integerReportNo := 1;
lPrinterDevice := TppPrinterDevice.Create(self);
lPrinterDevice.PageSetting := psAll;
FreportTemp.SavePrinterSetup := True;
lPrinterDevice.StartPrintJob := True;
lPrinterDevice.EndPrintJob := False;

if integerCount = 1 then
begin
FreportTemp.Template.DatabaseSettings.Name := 'MedicalReportPage' +
inttostr(integerReportNo) + 'Template';
FreportTemp.Template.LoadFromDatabase;
lPrinterDevice.Publisher := FreportTemp.Publisher;
PrintDialog1.Execute;
FreportTemp.PrintToDevices;
lPrinterDevice.Free;
exit;
end;

if integerCount > 1 then
begin
for integerX := 0 to integerCount - 1 do
begin
FreportTemp.Template.DatabaseSettings.Name := 'MedicalReportPage'
+ inttostr(integerReportNo) + 'Template';
FreportTemp.Template.LoadFromDatabase;
lPrinterDevice.Publisher :=
FreportTemp.Publisher;
FreportTemp.PrintToDevices;
inc(integerReportNo);
lPrinterDevice.StartPrintJob := False;
end;{for integerX := 0 to integerCount}
PrintDialog1.Execute;
lPrinterDevice.EndPrintJob := True;
end;{if integerCount > 1}

lPrinterDevice.Free;
end;{PrintMedicalProductGrid}


--
Jada C. Case
Programmer
jada@signaldata.com

Comments

  • edited June 2002
    Check into the Pragnaan (www.pragnaan.com) and the Waler (www.waler.com)
    device for PDF output. There are two options for printing multiple report
    into one PDF. The first is to create a single report and insert the multiple
    report into it as subreports. The second is to print all the reports to an
    offscreen cache, combine all the page objects into one list, then implement
    the OnPageReceive device of the PDF device and feed the pages in manually.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

This discussion has been closed.