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

BinName

edited July 2002 in General
Hi All,

We are trying to set the BinName dynamically before printing a report. We
do this with the PrinterName and it works fine, but the BinName never seems
to change from the Default to the one we assign it. Can the BinName be
overridden by the printer settings? Any idea what is happening? We do
display the print dialog and if you manually change the print tray it works
fine.

Thanks for any suggestions.

Dana

Comments

  • edited July 2002
    Are you using the TechTip? Yes BinName can be overriden by another setting
    of the PrinterSetup, of course this all depends on when you set the
    PrinterSetup or BinName or when you are loading a report template.


    Cheers,

    Jim Bennett
    Digital Metaphors Corp.

    --------------------------------------------
    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;


    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com



This discussion has been closed.