Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Duplex on last page

edited April 2014 in General
Hi!

Is it possible to turn on the duplex mode only for the last two pages?
So that I can print some legal infos on the last page (in real the
previous page).

I know that it could occur that the legal info is on a own page when it
is not odd pagecount.

Gruß aus den Bergen
Günter

Comments

  • edited April 2014
    Hi Gunter,

    The duplex setting is document wide so it is not possible to change it
    mid-print.

    One option would be to split your report into two separate sections
    (using Section Subreports). You would start by creating an empty report
    with a detail band only. Then place two Section subreports inside the
    detail band and set their NewPrintJob property to True and
    ParentPrinterSetup to False.

    The first subreport would represent your main report. The second would
    be the legal information at the end. Set the PrinterSetup.Duplex
    property for the second subreport.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2014
    Nico Cizik (Digital Metaphors) wrote:


    I've actually had some success toggling duplex mid-print -
    unfortunately, most "small office printer" drivers ignore the commands
    (they stick to whatever was first set at initial print setup).

    There are certain larger network printers that work perfectly.

    EdB
  • edited April 2014
    Hi Ed!

  • edited April 2014
    Günter Kieninger wrote:


    I don't use RAP, so cannot comment.

    I have a number of simple test programs I used to work things out - I'm
    (still) using D7 with RB15.

    The test program has a ClientDataSet that I fill with enough records to
    print 5 pages.

    The report is simple :

    [header] - single line with on ppDBText item
    [Detail] - single line of two ppDBText items
    [footer] - single line with information about current duplex mode

    The main form has a couple of radiogroups with duplex options to try.
    It also has a Memo where I log events.

    The ppReport has an event called "OnStartPage" (Code below).

    In this event, I detect when the 3rd page will be printed, and try to
    reset the Duplex mode.

    I'm happy to bundle it up and leave it somewhere you can download - can
    you use TClientDataSet, RB15, and convert D7 projects?

    Cheers,
    EdB


    procedure TForm1.ppReport1StartPage(Sender: TObject);
    begin
    mmo1.Lines.Add(Format('start page:%d',[ppReport1.AbsolutePageNo]));
    mmo1.Lines.Add(Format('was :
    %s',[DuplexToStr(ppReport1.Engine.Page.PrinterSetup.Duplex)]));
    mmo1.Lines.Add(Format('was :
    %s',[OrientationToStr(ppReport1.Engine.Page.PrinterSetup.Orientation)]))
    ;

    if (ppReport1.AbsolutePageNo=3) then begin
    mmo1.Lines.Add(Format('found page :%d',[ppReport1.AbsolutePageNo]));
    if (ppReport1.Engine.Page.PrinterSetup.Duplex<>dpNone) then begin
    ppReport1.Engine.Page.PrinterSetup.Duplex:=dpNone;
    if chkUseReportPrnSetup.Checked then
    ppReport1.PrinterSetup.Duplex:=dpNone;
    mmo1.Lines.Add(Format('is :
    %s',[DuplexToStr(ppReport1.Engine.Page.PrinterSetup.Duplex)]));
    mmo1.Lines.Add(Format('is :
    %s',[OrientationToStr(ppReport1.Engine.Page.PrinterSetup.Orientation)]))
    ;
    end;
    end
    else
    begin
    if (ppReport1.Engine.Page.PrinterSetup.Duplex<>FPrnDp) then begin
    mmo1.Lines.Add(Format('was not %s, setting to %s for page
    %d',[DuplexToStr(FPrnDp),DuplexToStr(FPrnDp),ppReport1.AbsolutePageNo]))
    ;
    ppReport1.Engine.Page.PrinterSetup.Duplex:=FPrnDp;
    if chkUseReportPrnSetup.Checked then
    ppReport1.PrinterSetup.Duplex:=FPrnDp;
    mmo1.Lines.Add(Format('is :
    %s',[DuplexToStr(ppReport1.Engine.Page.PrinterSetup.Duplex)]));
    mmo1.Lines.Add(Format('is :
    %s',[OrientationToStr(ppReport1.Engine.Page.PrinterSetup.Orientation)]))
    ;
    end;
    end;
    end;
This discussion has been closed.