Number of Pages before Print
Hello,
I need to create some executive versions of reports, First and last page, so
I need to know how many pages before I print. I am using two pass.
How do I do this? I know i need to use PageList and PageSetting, but how and
when do I get the last page number?
Thanks
I need to create some executive versions of reports, First and last page, so
I need to know how many pages before I print. I am using two pass.
How do I do this? I know i need to use PageList and PageSetting, but how and
when do I get the last page number?
Thanks
This discussion has been closed.
Comments
If you are using a two pass report, you can use the Report.AbsolutePageCount
property inside the OnStartSecondPass to determine the total amount of pages
in your report.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Page(Report.AbsolutePageCount ) at that point before the second pass. The
second pass sends the pages, correct?, I tried setting the PageList in this
event and I got an Exception.
I do not want to call print twice- reports to big
Thanks
Sorry, I did not understand the initial question. See Demo 124 located in
the \RBuilder\Demos\1. Reports\... directory (dm0124.pas) for an example of
how to print only the pages you define. This example coincidentally prints
the first and last page of a 30 page report.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
number, In your demo you have 1,30 hard coded for pages to send in the
"Before Print" event, Is this the only place to set this?
if (ppReport1.PrinterDevice <> nil) then
begin
ppReport1.PrinterDevice.PageSetting := psPageList;
if ppReport1.AbsolutePageCount > 1 then
ppTextToPageList('1,'+IntToStr(ppReport1.AbsolutePageCount),
ppReport1.PrinterDevice.PageList, True) else
ppTextToPageList('1', ppReport1.PrinterDevice.PageList, True);
end;
Thanks for your help