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

Group Page print from different Tray?

edited October 2003 in General
I have a RB7.03 on D5 report which prints customer bills. There is one
group, grouped by customer and is set to start a new page. The group header
band contains all the customers base info (address, amount due, etc) and
then there is a sub-report in the detail band which prints out the customers
detailed account entries which can be multiple pages long.

I need the first page (group header band) to print from a custom paper tray
which holds pre-perforated paper and then all subsequent pages to print from
the default paper tray. I have tried changing the paper tray at run time in
the GroupHeaderBand1.BeforePrint event but that does nothing. The printer
itself can be told to print the first page from the custom tray but that
will not work with RB since it batches all the pages as one print job. I
have been trying to weed through the examples, the newsgroup, and the
developers guide but I haven't found anything that helps.

The Developers guide (pg. 119) hints that this is possible and that examples
121-124 exhibit this behavior. However, the only "121-124" examples that I
could find are crosstab reports that do not appear to do this.

Any help at all would be most appreciated.

Larry

Comments

  • edited October 2003
    --------------------------------------------
    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;


    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2003
    This is the method I was using except I am using ppReport1.PageNo as I want
    to change bins each time the group record change resets the page count.
    However, the result is that all pages are printing from the bin selected
    when PageNo is one.

    The code is running as I have placed two labels in the sub-report that spans
    multiple pages (including the first page for each group record change) that
    prints the selected tray and the page number and the labels display the
    correct bin name when on a PageNo other than one (i.e. Default or Tray 2)
    yet the paper is pulled from the custom page tray (Tray 3) regardless. This
    occurs on two seperate printers an HP LJ 5si and an HP LJ8100N.

    What am I missing?

    Larry

    P.S. Nico I accidently sent this to the support e-mail. Sorry about that.


This discussion has been closed.