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

Manipulating Font

edited March 2004 in RAP
I want to be able to tell every field on my report to be bold, underlined,
italic or specify a specific font and size.

When i do the following
DBText1.Font.Bold := (DocumentDetail['DocumentLineFontB'] = 1);

Comments

  • edited March 2004
    Sorry previous post incomplete

    I want to be able to tell every field on my report to be bold, underlined,
    italic or specify a specific font and size.


    DBText1.Font.Bold := (DocumentDetail['DocumentLineFontB'] = 1);
    DBText1.Font.Underline := (DocumentDetail['DocumentLineFontU'] = 1);
    DBText1.Font.Italic := (DocumentDetail['DocumentLineFontI'] = 1);
    DBText1.Font.Size := 6 + (DocumentDetail['DocumentLineFontS']);

    However when i put previous lines in my OnPrint event the layout of the
    field is not changed even if the database fields contain 1. (Compiling the
    report doesn't generate errors nor does Printing it).
  • edited March 2004

    I created a simple test using DBDemos. I created a query on the customer
    table and added a single DBText to the report. In the DBText.OnPrint I
    implemented the following RAP event-handler:

    DBText1.Font.Bold := customer['CustNo'] > 1500;

    The result is that all the customer numbers greater than 1500 appear in
    bold.

    Perhaps in your report, the value of 1 is not being returned by the
    datafield?



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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2005
    Nard Moseley (Digital Metaphors) wrote:

    Why in My Report builder is not declared Bold property?
    I've tried to set may TppDBText(Sender).Font.Bold on 'OnPrint Event
    handler, but it doesn't known...
  • edited January 2005
    Hi,

    This and many other helpful tips are available in the ReportBuilder and RAP
    help file. \RBuilder\Help\...


    Q:
    Since RAP doesn't support Set types, will I be able to set TFont.Style in
    code?

    A:
    Yes. We have added properties to TFont to allow you to set these values in
    code. Normally for a Set type property such as TFont.Style, you might use
    the Include and Exclude procedures to change its value. In RAP, however, we
    have added the following boolean properties to TFont for this purpose: Bold,
    Italic, Normal, Underline and Strikeout. To set a font to bold in RAP, you
    would say myFont.Bold := True; Likewise to remove style specifications from
    a font, you would say myFont.Normal := True;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

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