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

Changing Style of Text does not work

edited April 2013 in RAP
The following code will not compile why?

Delphi XE
RB 12.05


procedure DBText2OnPrint;
flSlmv : String;
ThisFont : TFont;

begin
flslmv := Uppercase(Item_Ticket['Slow Moving']);
if( flslmv = 'Z' )or( flslmv = 'V' )then
begin
DBText2.Font.Style := [fsBold,fsItalic];
end;
end;

Gives compilation error '(' or '[' expected, but found 'Style' instead!

Comments

  • edited April 2013
    Hi Robert,

    Below is an exerpt from the RAP FAQ in the help documentation.

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

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2013
    I have been using the Developers Guide Fourth Edition for my resource.
    There was no mention of the solution to this issue in there.

    Where is this RAP FAQ? I cannot find it.

    Where is the best place to find examples/documentation on RAP?

    Kind Regards,

    Robert.


  • edited April 2013
    Hi Robert,

    The RAP FAQ is located in the ReportBuilder RAP Reference which is
    installed into the Delphi help system when ReportBuilder is installed.

    There are also numerous RAP articles and examples located on-line in our
    rbWiki site.

    http://www.digital-metaphors.com/rbWiki/RAP

    Best Regards,

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