Highlight every second line...
Hi,
In FR3 VCL I used some code like below to highlight every second detail line.
In the report I first created a TfrxMemo called HiLiteLine and stretched it to cover the entire line, then I called the below method in the report's OnBeginDoc event like this:
InitHiLiteLine(TfrxReport(Sender),clMoneyGreen);
procedure TReportingFrm.InitHiLiteLine(aReport:TFrxReport; aStripeColor : TColor);
var
HLMemo : TfrxMemoView;
begin
with aReport do begin
HLMemo := NIL;
HLMemo := FindObject('HiLiteLine') as TfrxMemoView;
if HLMemo = NIL then
ShowMessage(aReport.Name+' does not have an object called ''HiLiteLine''!')
else begin
HLMemo.HighLight.Condition := '<Line#> MOD 2'
HLMemo.HighLight.Color := aStripeColor;
end;
end;
end;
However this does not work in FR5. What has changed or what am I doing wrong...?
Thanks a lot for help on this.
best regards
Tor
In FR3 VCL I used some code like below to highlight every second detail line.
In the report I first created a TfrxMemo called HiLiteLine and stretched it to cover the entire line, then I called the below method in the report's OnBeginDoc event like this:
InitHiLiteLine(TfrxReport(Sender),clMoneyGreen);
procedure TReportingFrm.InitHiLiteLine(aReport:TFrxReport; aStripeColor : TColor);
var
HLMemo : TfrxMemoView;
begin
with aReport do begin
HLMemo := NIL;
HLMemo := FindObject('HiLiteLine') as TfrxMemoView;
if HLMemo = NIL then
ShowMessage(aReport.Name+' does not have an object called ''HiLiteLine''!')
else begin
HLMemo.HighLight.Condition := '<Line#> MOD 2'
HLMemo.HighLight.Color := aStripeColor;
end;
end;
end;
However this does not work in FR5. What has changed or what am I doing wrong...?
Thanks a lot for help on this.
best regards
Tor
Comments
try this
HLMemo.HighLight.Condition := '<Line#> MOD 2=0'
Regards
results in an Error:
.
What's going wrong?
I use
FR5: 5.6.8
Delphi Berlin
It doesn't work.
Error-Message: