Print double sided and page breaks
Hi,
One customer has requested me to change an existing report (statement of account) to allow it to be printed on double sided printer. This report prints statements of accounts for a range of client accounts. That's easy enough to achieve and it's been working great for a long time. for each new client there is a group break which starts a new page.
My client now wants to print on a double sided printer which means that I must 'know' on which side of the paper I am printing to decide to start a new page of skip a page then start a new page. I am not sure if I am making myself clear:
Sheet 1 (front) : Page 1 - Statement for client 1
Sheet 1 (back) : Page 2 - Statement for client 1 (continued)
Sheet 2 (front) : Page 3 - Statement for client 1 (continued) . In the middle of that page there is a group break,
Sheet 2 (back ) Must be blank
Sheet 3 (front) start of next statement
.....
I do not see where to start and your ideas will be very welcomed.
Didier
One customer has requested me to change an existing report (statement of account) to allow it to be printed on double sided printer. This report prints statements of accounts for a range of client accounts. That's easy enough to achieve and it's been working great for a long time. for each new client there is a group break which starts a new page.
My client now wants to print on a double sided printer which means that I must 'know' on which side of the paper I am printing to decide to start a new page of skip a page then start a new page. I am not sure if I am making myself clear:
Sheet 1 (front) : Page 1 - Statement for client 1
Sheet 1 (back) : Page 2 - Statement for client 1 (continued)
Sheet 2 (front) : Page 3 - Statement for client 1 (continued) . In the middle of that page there is a group break,
Sheet 2 (back ) Must be blank
Sheet 3 (front) start of next statement
.....
I do not see where to start and your ideas will be very welcomed.
Didier
Comments
create a OnBeforePrintEvent for the top band of your page, and check if it's printing in a even number page.
If it's not, then you set the StartNewPage property to true, to force a new jump/blank page.
I'm think you can read the current page number in the Engine properties, I remember reading something in one of the manuals. Or maybe just the [Page] value may do it.
For example, if you have a Titleband at the beginning of each client statement, have something like:
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->procedure frxTitleBand.OnBeforePrintEvent(sender...);
begin
if (Engine.PageNumber mod 2) <> 1 then // or try to get the value from [Page], GetValue('Page') comes to my mind
frxTitleBand.StartNewPage := true
else
frxTitleBand.StartNewPage := false
end;
<!--fontc--></span><!--/fontc-->
Also, there are other bands that have the StartNewPage property, like the MasterData, check what's best for you.
Hope I gave you some ideas.
You did indeed, thanks. I'll report back once I have the final answer.
Thanks again
Didier
I agree title is probably not best, but what would be your suggestion then ? I am currently using a group; it will always be at Startnewpage = true; the issue being creating a second newpage if necessary.
Didier
All you have to do is to find the condition when you need it to be printed, i.e. when you need the extra page (my suggestion was to use the page numbering for that), you make the masterdata band visible, otherwise, make it invisible.
So:<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->
procedure GroupFooter.OnBeforePrint(sender);<!--fontc--></span><!--/fontc-->
begin
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto--> DummyMasterBand.visible := (Engine.PageNumber mod 2) =1;<!--fontc--></span><!--/fontc--> (or whatever condition you want to use)
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->end;
<!--fontc--></span><!--/fontc-->
So you decide if the blankpage masterband will be printed before the engine gets to it, i.e. when printing the GroupFooter just before it.
thanks a lot
I appreciate very much you taking the time
Didier