I need to print just a specific page of a report, and tried to use ppReport.PrintPage(). But this doesn't work- it just happens noting. Do I miss something? Thanks for your help, greets ben
I've seen that the PrintPage method is replaced by the RequestPage method. But I have no idea who to use RequestPage to print a specific page of a report.
procedure ppReportBeforePrint(Sender: TObject); begin with ppReport.PrinterDevice do begin PageSetting := psSinglePage; PageRequested := #Page; end; end;
After loading a template I assign the BeforePrint function: dm_reports.ppReport1.BeforePrint := ppReport1BeforePrint;
But when printing the report, I get an access violation. Any ideas?
Try doing something like the following example, which prints the pages inside a report backward. Instead of looping through and printing every page, simple select the page object you would like to print and send it to the printer device.
Sorry for the late reply, I somehow lost track of your post.
Take a look at demo 124 located in the Demos\1. Reports\... directory. This shows how to manually print a page list using the ppTextToPageList routine. Specifically take a look at the BeforePrint event.
Comments
I've seen that the PrintPage method is replaced by the RequestPage method.
But I have no idea who to use RequestPage to print a specific page of a
report.
Could somebody help me out with an example?
Thx very much,
Greets ben
I found this example code for printing:
procedure ppReportBeforePrint(Sender: TObject);
begin
with ppReport.PrinterDevice do begin
PageSetting := psSinglePage;
PageRequested := #Page;
end;
end;
After loading a template I assign the BeforePrint function:
dm_reports.ppReport1.BeforePrint := ppReport1BeforePrint;
But when printing the report, I get an access violation.
Any ideas?
Thanks again,
greets ben
Try doing something like the following example, which prints the pages
inside a report backward. Instead of looping through and printing every
page, simple select the page object you would like to print and send it to
the printer device.
http://www.digital-metaphors.com/rbWiki/Output/Printer/How_To...Print_a_Report_Backwards
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
thx for your help, this solutions works fine.
But one question: Is there a way to print a preview?
I tried it with something like
lPage := ppReport1.Publisher.Pages[iPage-1];
ppReport2.RequestPage(self,lPage);
ppReport2.Print;
but this gives me only a blank page.
Greetings,
ben
Sorry for the late reply, I somehow lost track of your post.
Take a look at demo 124 located in the Demos\1. Reports\... directory. This
shows how to manually print a page list using the ppTextToPageList routine.
Specifically take a look at the BeforePrint event.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com