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

Comments

  • Anu de DeusAnu de Deus Hampshire, UK
    edited 6:13PM
    Considering any new statemente must start in an odd page number (1, 5, 7...),
    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.


  • edited 6:13PM
    wrote:
    Hope I gave you some ideas.

    You did indeed, thanks. I'll report back once I have the final answer.

    Thanks again

    Didier
  • gordkgordk St.Catherines On. Canada.
    edited 6:13PM
    Considering any new statemente must start in an odd page number (1, 5, 7...),
    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.
    title bands are poor bands to use for example theiy are only available once in the life of a report.
  • edited 6:13PM
    gordk wrote: »
    title bands are poor bands to use for example theiy are only available once in the life of a report.

    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
  • Anu de DeusAnu de Deus Hampshire, UK
    edited 6:13PM
    Ok, then after your group footer, add a new Masterdata band, without a dataset assigned to it, with rowcount = 1 and StartNewPage := true.
    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.


  • edited 6:13PM
    Clever! I'll get onto that early next week and let you know.

    thanks a lot

    I appreciate very much you taking the time

    Didier

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.