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>
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
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;