Home General

Print to file, only one page

Hello,

I want to print only one page in a file, without dialog.
So, I try :

ppReport1.AllowPrintToFile := True;
ppReport1.ShowPrintDialog := false;
ppReport1.DeviceType := 'PDF';
ppReport1.Print;

but how can I specify I want only the first page ?

Comments

  • Hi Arnaud,

    Take a look at demo 124 of the main reports demo for an example of manually sending ReportBuilder a list of pages to be printed. This is the same method used for the Page Range of the Printer Dialog.

    It uses the ppTextToPageList routine to resolve the page range entry. Something like the following…

    procedure TForm1.ppReportBeforePrint(Sender: TObject);
    begin

    if (Report.PrinterDevice <> nil) then
    begin
    Report.PrinterDevice.PageSetting := psPageList;

    ppTextToPageList(‘1', Report.PrinterDevice.PageList, True); //Print page 1
    end;

    end;
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Hi Nico,

    Thank you.
Sign In or Register to comment.