Adding a background colour
I would like to add a background colour to some fields based on a certain condition, that being the fastest time over a series of times. I tried to use an expression but as I'm using Boolean it could not convert the variant type.
The code is like this:
procedure MemoBestTimeOnBeforePrint(Sender: TfrxComponent);
begin
if <lapTimesData."fastestlap"> = <lapTimesData."Nr"> then
TfrxMemoview(Sender).font.style := fsUnderline
else
TfrxMemoview(Sender).font.style := 0;
end;
The example above will underline the fastest time, but how can I add a coloured background to it, such as grey? I just need to know the code I think.
Many thanks for any help.
The code is like this:
procedure MemoBestTimeOnBeforePrint(Sender: TfrxComponent);
begin
if <lapTimesData."fastestlap"> = <lapTimesData."Nr"> then
TfrxMemoview(Sender).font.style := fsUnderline
else
TfrxMemoview(Sender).font.style := 0;
end;
The example above will underline the fastest time, but how can I add a coloured background to it, such as grey? I just need to know the code I think.
Many thanks for any help.
Comments
Note you must have an 'else' clause to set the color to something else if the condition is not met (even clNone) otherwise the first time your condition is met the colour will change but then it will stay changed for the rest of the report, regardless of the data in the following rows.