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

Help... Export pages separately

edited June 2004 in General
Hi all...

I am using TExtraDevices (http://www.waler.com/textradevices.htm) and I
need to export a report (10 pages) to PDF.
The problem: I need to export the pages separately.
Each page will be a PDF file.
I already tried to use the method "PrintPage" but it doesn't work... :(
Well....
How do I do to export like this?
Ah... I don't want to use the print dialog.

My code:
ppReport.DeviceType:='PDFfile';
ppReport.ShowPrintDialog:=False;
for iPage:=1 to 10 do
begin
ppReport.TextFileName:='C:\'+IntToStr(iPage)+'.pdf';
ppReport.PrintPage(iPage);
end;

If I use the method "Print", everything works fine...
But it creates a PDF with 10 pages! :(

TIA,

Rafael Borges Garcia
--------------------
HT Informatica Ltda
rafael@ht.com.br
Florianopolis - Brasil

Comments

  • edited June 2004
    PrintPage does nothing. The actual code is commented out in RB. You will need to use the page list
    property.

    James Waler
    Waler Ltd
    http://www.waler.com
  • edited June 2004
    Hi,

    Thanks for the answer. :)
    Do you have some example to show me?

    Thanks again

    Rafael Borges Garcia
    --------------------
    HT Informatica Ltda
    rafael@ht.com.br
    Florianopolis - Brasil


    =======================================================
  • edited June 2004
    Add this to the BeforePrint event:

    Rpt.Publisher.Devices[0].PageSetting := psPageList;
    Rpt.Publisher.Devices[0].PageList.Text := '%Page Number Here%';


    James Waler
    Waler Ltd
    http://www.waler.com
This discussion has been closed.