Programmatically forcing a new page
I am preparing a report (personnel resumes) that may contain 2 or more pages
and will be printed in duplex mode. I have it set to begin a new page when
my Group changes, which works well for reports that have an even number of
pages; however, I need to have the first page of each group be an odd
numbered page, so that it can be printed out as a stand alone document.
I am toying with the GroupHeaderBandAfterPrint event to evaluate the PageNo
property. I check to see if it is EVEN or ODD and that seems to let me know
where I am. Now all I have to do is force a new page.
Thanks
and will be printed in duplex mode. I have it set to begin a new page when
my Group changes, which works well for reports that have an even number of
pages; however, I need to have the first page of each group be an odd
numbered page, so that it can be printed out as a stand alone document.
I am toying with the GroupHeaderBandAfterPrint event to evaluate the PageNo
property. I check to see if it is EVEN or ODD and that seems to let me know
where I am. Now all I have to do is force a new page.
Thanks
This discussion has been closed.
Comments
Take a look at the following article. This can also be done using a
TppPageBreak component. We are considering adding this as a feature for a
later release.
------------------------------------------------------
Article: Forcing Group Headers to Start on Odd Pages
------------------------------------------------------
Question:
I have a report that is printing duplexed
and therefore I want to force the group headers to
start on odd pages.
Solution:
Using demo report #71 do the following:
1. Add a subreport to the GroupFooter band, just below the existing
controls.
2. Set the subreport's PrintBehavior property to pbSection - do not add
any controls to the subreport - leave it blank.
3. Add a Private field to the form: FPrintingSpacer: Boolean.
4. Add an event handler for the FormCreate event with the following
code:
FPrintingSpacer := False;
5. Add an event handler for the ppOrderDetailGroupFooterBand1BeforePrint
event with the following code:
if not FPrintingSpacer then
begin
ppSubReport1.Visible := odd(ppOrderDetail.AbsolutePageNo) and
not ppOrderDetailGroupFooterBand1.Overflow;
FPrintingSpacer := ppSubReport1.Visible;
end
else
FPrintingSpacer := False;
6. Run the project and view report #71.
Note that when a group is to start, it will only start on an odd page.
Caveats: We are brute-forcing this solution by causing the even numbered
page to be taken up by the section style subreport. As a result, any
page headers or footers you have in the main report will not appear on
the even pages that are blank. To get around this, you could add
identical header/footers or custom header/footers with only page
numbers, or some such.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
10:21 AM >>>
Hi Craig,
Take a look at the following article. This can also be done using a
TppPageBreak component. We are considering adding this as a feature for a
later release.
------------------------------------------------------
Article: Forcing Group Headers to Start on Odd Pages
------------------------------------------------------
Question:
I have a report that is printing duplexed
and therefore I want to force the group headers to
start on odd pages.
Solution:
Using demo report #71 do the following:
1. Add a subreport to the GroupFooter band, just below the existing
controls.
2. Set the subreport's PrintBehavior property to pbSection - do not add
any controls to the subreport - leave it blank.
3. Add a Private field to the form: FPrintingSpacer: Boolean.
4. Add an event handler for the FormCreate event with the following
code:
FPrintingSpacer := False;
5. Add an event handler for the ppOrderDetailGroupFooterBand1BeforePrint
event with the following code:
if not FPrintingSpacer then
begin
ppSubReport1.Visible := odd(ppOrderDetail.AbsolutePageNo) and
not ppOrderDetailGroupFooterBand1.Overflow;
FPrintingSpacer := ppSubReport1.Visible;
end
else
FPrintingSpacer := False;
6. Run the project and view report #71.
Note that when a group is to start, it will only start on an odd page.
Caveats: We are brute-forcing this solution by causing the even numbered
page to be taken up by the section style subreport. As a result, any
page headers or footers you have in the main report will not appear on
the even pages that are blank. To get around this, you could add
identical header/footers or custom header/footers with only page
numbers, or some such.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com