Home RAP

Changing the printer...

edited December 2003 in RAP
Hi,

I try to change the printer of a report in RAP.
In the OnStartPage event I set:

Report.PrinterSetup.PrinterName:='New Printer';
Report.PrinterSetup.PaperName:='A4';
Report.PrinterSetup.Orientation:=poLandscape; {poPortrait }
Report.PrinterSetup.BinName:='Fach 1';

But when I print the report, it always use the printer that was set in the
pagesettings.

Best Martin

Comments

  • edited December 2003

    1. PrinterName

    Once the report starts printing, aWindows print job is created for the
    specified printer. You cannot modify the printer name once the print job has
    begun.

    The Report.BeforePrint event can be used to modify the printer name, but due
    to timing you have to access the report engine's Page.PrinterSetup rather
    than the Report.PrinterSetup. To set the PrinterName you should use one of
    the entries in the PrinterNames[] array.

    For example:

    myReport.Engine.Page.PrinterSetup.PrinterName :=
    Report.PrinterSetup.PrinterNames[0];

    First get this working in Delphi code. Then create a custom RAP pass-through
    function that you can call from RAP.


    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.