Home End User

Different bis for each page with page chaching on and double pass report

edited February 2010 in End User
Hello,

I am trying to set different printer bis for each report page. The
report has page chaching on and is set to double pass rendering.

I am using the Report.OnPageStart event in following manner:

procedure TMyClass.ReportStartPageEvent(Sender: TObject);
begin
if (Report.Engine.Page.AbsolutePageNo > 1) then
Report.PrinterDevice.Printer.PrinterSetup.BinName := 'Tray 2'
end;
This simply does not work.

No does this work:

procedure TMyClass.ReportStartPageEvent(Sender: TObject);
begin
if (Report.Engine.Page.AbsolutePageNo > 1) then
Report.Engine.Page.PrinterSetup.BinName := 'Tray 2'
end;

I have already tryed following events with the same effect:

Report.OnPrinterDeviceStateChange,
Report.PrinterDevice.OnStartPage

It seems to me that the bin name setting comes in all those events too
late to take effect to the page being printed.

Please give me a hint.

My RB Version is 11.05 for Delphi 7

Thanks a lot!

Kind regadrs

Leo Kaploun

Comments

  • edited February 2010
    Hi Leo,

    Do not use the actual name of the printer bin to define it. Instead use a
    reference to the bin using the BinNames property to ensure the correct
    value.

    Take a look at the following article.

    http://www.digital-metaphors.com/rbWiki/Output/Printer/Control_Bin

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2010
    Nico Cizik (Digital Metaphors) schrieb:

    Hallo Nico,

    thanks a lat for Your prompt answer!

    Unfortunately, is the link dead (server time out).
    Could You please post the article part in question here.


    Kind regards

    Leo Kaploun
  • edited February 2010
    Hi Leo,

    To access the rbWiki, you need to be able to access port 8080 on our server.

    TECH TIP: Selecting Paper Bins for Each Page

    Sometimes you may want to print the first page of a report to the manual bin
    and then print the remaining pages to the default bin.

    You can use the Report.OnStartPage event to set the bin for any page.

    Example:

    procedure TForm1.ppReport1OnStartPageEvent(Sender:TObject);
    var
    lsBinName: String;
    begin

    if ppReport1.AbsolutePageNo = 1 then
    lsBinName := ppReport1.PrinterSetup.BinNames[3]
    else
    lsBinName := ppReport1.PrinterSetup.BinNames[1];


    ppReport1.Engine.Page.PrinterSetup.BinName := lsBinName;

    end;

    Note: The above example assumes the manual bin is 4th in the list (remember
    its a 0 based index). To account for different print drivers, you could
    search for the 'manual' bin in code by performing a search on the printer's
    available bin names:

    for liBin := 0 to ppReport1.PrinterSetup.BinNames.Count-1 do
    if Pos('manual', ppReport1.PrinterSetup.BinNames[liBin]) > 0 then
    begin
    lsBinName := ppReport1.PrinterSetup.BinNames[liBin];
    break;

    end;


    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.