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

Is there an Event to know when a page is printing to printer vs showing to the screen?

edited April 2004 in General
Hi,

Is there a way to know when the report is printed to actual printer? I
guess TppReport.DeviceType would indicate where the output is going.
But, does this rule apply the same when user click on the Print button
on the report view screen?

I am trying to get color-group-separated report to print but when the
colors look good on the screen does not print well on paper (black and
white printer). On the paper print out, it is too light. So, if I set
it to darker color, paper printout is ok but the screen report does not
look good.

I want to see if I can programatically change the TppShape.Brush.Color
depends on whether it is going to screen vs printer.

Is there other way to print %-grey scaled print out?

TIA,

SeHun

Comments

  • edited April 2004
    Hi SeHun,

    You can use the device specific events to control a report as it is sent to
    different devices. For instance if you want to change your report only when
    it is sent to the printer device, you could connect the TppDevice.OnStartJob
    event inside the TppReport.BeforePrint event and code the changes
    accordingly. Something like the following...

    procedure TForm1.ppReport1BeforePrint(Sender: TObject);
    begin
    if (ppReport1.PrinterDevice <> nil) then
    ppReport1.PrinterDevice.OnStartJob := ehPrinterDeviceStartJob;
    end;

    procedure TForm1.ehPrinterDeviceStartJob(Sender: TObject);
    begin
    //Make changes here
    end;

    --
    Best Regards,

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