Expression Condition

;) <span style='font-family:Arial'>I use two nested Group Header, GH1 + GH2, in FR defined with same source data field, splitted in two strings bytwo differents expressions.

Expression for GH1 is: <span style='font-family:Courier'>Copy(<resulthd."Nature-Nature">,1,iif(Pos('||',<resulthd."Nature-Nature">)=0,1024,Pos('||',<resulthd."Nature-Nature">)-2))</span>

Expression for GH2 is : <span style='font-family:Courier'>iif(Pos('||',<resulthd."Nature-Nature">)=0,Copy(<resulthd."Nature-Nature">,Length(<resulthd."Nature-Nature">)+1,1),Copy(<resulthd."Nature-Nature">,Pos('||',<resulthd."Nature-Nature">)+3,Length(<resulthd."Nature-Nature">)))</span>

Condition properties are same as expression formulae defined.

System Memo Field [COUNT(MasterData1)] defined in GroupFooter2 Band return correct record count.

Following code do not display [COUNT(MasterData1)] value in GroupHeader2 Band for NbNature2 field. How to get it? Regards.

<span style='font-family:Courier'>procedure GroupHeader2OnBeforePrint(Sender: TfrxComponent);
begin
if Engine.FinalPass then NbNature2.Text := 'Sum: ' + Get(iif(Pos('||',<resulthd."Nature-Nature">)=0,Copy(<resulthd."Nature-Nature">,Length(<resulthd."Nature-Nature">)+1,1),Copy(<resulthd."Nature-Nature">,Pos('||',<resulthd."Nature-Nature">)+3,Length(<resulthd."Nature-Nature">))));
end;

procedure GroupFooter2OnBeforePrint(Sender: TfrxComponent);
begin
Set(iif(Pos('||',<resulthd."Nature-Nature">)=0,Copy(<resulthd."Nature-Nature">,Length(<resulthd."Nature-Nature">)+1,1),Copy(<resulthd."Nature-Nature">,Pos('||',<resulthd."Nature-Nature">)+3,Length(<resulthd."Nature-Nature">))), IntToStr(<COUNT(MasterData1)>));
end;

begin</span>
end.</span>

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 6:35AM
    here is a sample modify 45.fr3 of main demo to show count in the inner header.

    added memo7 to inner group header
    added code to memo7 obp

    procedure Memo7OnBeforePrint(Sender: TfrxComponent);
    begin
    if Engine.FinalPass then
    memo7.text := 'Items: '+VarToStr(Get(<Sales."Order No">));
    end;

    added code to obp of inner group footer

    procedure Band8OnBeforePrint(Sender: TfrxComponent);
    begin
    Set(<Sales."Order No">,COUNT(Band6));
    end;

    ;)

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.