Changing Style of Text does not work
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!
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!
This discussion has been closed.
Comments
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;"
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
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.
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
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com