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 2: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 2: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 2:42PM
    Try (<Line#> MOD 2)=0
  • tmetme
    edited 2:42PM
    gpi wrote: »
    Try (<Line#> MOD 2)=0

    It doesn't work.

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

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.