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

Need differrent font style and color for viewing vs. printing

edited October 2003 in General
Hi Guys,

I'm using RB7 standard with D7.

I need to have components like TppDBText display in TppViewer with
blue and underlined font attributes, but when printed to the printer
change to black without the underline.

How can I change the font properties going to the printer without
messing up the display in TppViewer?

Thanks,
Steve

Comments

  • edited October 2003

    Try using the Report.BeforePrint event to set the font style

    if (Report.PrinterDevice <> nil) then
    {printing to the printer - set simple font style}
    else
    {use underline font style}


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2003
    I'm sorry. Maybe I wasn't clear. I'm printing from the TppViewer.
    I'm using a customized version of your default preview form. The
    Print button's OnClick event does a ppViewer1.Print.

    I want the underline font to display in the viewer but when the user
    presses the Print button and the report goes to the printer, the
    underline needs to be removed. I haven't been able to figure out how
    to modify the font's style property and even if I could, I'm afraid it
    would remove the underline from the viewer once the report had been
    printed.

    Steve

    On Fri, 24 Oct 2003 10:11:00 -0600, "Nard Moseley \(Digital
  • edited October 2003

    Just tried it out and had to use the Label.OnPrint event.

    You modify the Font property by specifying the font style

    1. For Delphi code Label.Font.Style is a set:

    myLabel.Font.Style := [fsUnderline] or myLabel.Font.Style := []

    2. For RAP code you use a different syntax:

    if (Report.PrinterDevice <> nil) then

    Label1.Font.UnderLine := False

    else

    Label1.Font.UnderLine := True;


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

    Best regards,

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