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

Comments

  • edited 3:42PM
    Hi Tor

    try this
    HLMemo.HighLight.Condition := '<Line#> MOD 2=0'

    Regards
    bushtor wrote: »
    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
  • tmetme
    edited 3:42PM
    The code below
    frxMemoView1.HighLight.Condition := '<Line#> MOD 2=0'
    

    results in an Error:
    wrote:
    '<' is not a valid Integer value
    .


    What's going wrong?

    I use
    FR5: 5.6.8
    Delphi Berlin
  • gpigpi
    edited 3:42PM
    Try (<Line#> MOD 2)=0
  • tmetme
    edited 3:42PM
    gpi wrote: »
    Try (<Line#> MOD 2)=0

    It doesn't work.

    Error-Message:
    gpi wrote: »
    '(' is not a valid Integer
  • gpigpi
    edited 3:42PM
    tme wrote: »
    It doesn't work.
    Works OK in the FRDemo 1.fr3

Leave a Comment