Bug in Manual For Group Header
just For information
the example in FR4.0 PDF has a bug
var
List: TStringList;
i: Integer;
procedure frReport1OnStartReport(Sender: TfrxComponent);
begin
List := TStringList.Create;
end;
procedure frReport1OnStopReport(Sender: TfrxComponent);
begin
List.Free;
96 FastReport 4.0 User's Manual
?© 1998-2006 FastReports Inc.
end;
procedure Page1OnBeforePrint(Sender: TfrxComponent);
begin
i := 0;
end;
procedure GroupHeader1OnBeforePrint(Sender: TfrxComponent);
begin
if Engine.FinalPass then
Memo8.Text := 'Sum: ' + List;
end;
procedure GroupFooter1OnBeforePrint(Sender: TfrxComponent);
begin
if not Engine.FinalPass then
// Its Wrong ...The Correct Is
// if Engine.FinalPass then
List.Add(FloatToStr(SUM(<Group."ItemsTotal">,MasterData1)));
Inc(i);
end;
begin
end.
A friendly Note : This way is much better for Show sum in Group header but dont forget Two pass Option
the example in FR4.0 PDF has a bug
var
List: TStringList;
i: Integer;
procedure frReport1OnStartReport(Sender: TfrxComponent);
begin
List := TStringList.Create;
end;
procedure frReport1OnStopReport(Sender: TfrxComponent);
begin
List.Free;
96 FastReport 4.0 User's Manual
?© 1998-2006 FastReports Inc.
end;
procedure Page1OnBeforePrint(Sender: TfrxComponent);
begin
i := 0;
end;
procedure GroupHeader1OnBeforePrint(Sender: TfrxComponent);
begin
if Engine.FinalPass then
Memo8.Text := 'Sum: ' + List;
end;
procedure GroupFooter1OnBeforePrint(Sender: TfrxComponent);
begin
if not Engine.FinalPass then
// Its Wrong ...The Correct Is
// if Engine.FinalPass then
List.Add(FloatToStr(SUM(<Group."ItemsTotal">,MasterData1)));
Inc(i);
end;
begin
end.
A friendly Note : This way is much better for Show sum in Group header but dont forget Two pass Option
Comments
Look At the C code bellow in manual
Not dosnt work in my FR...i change it and it work now
you can check it too