mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 16:49:07 +02:00
* Small refactoring, moving processaggregates to where it belongs
git-svn-id: trunk@37667 -
This commit is contained in:
parent
4467ff81a6
commit
9b219e5a6e
@ -934,6 +934,7 @@ type
|
|||||||
procedure ResolveDataName;
|
procedure ResolveDataName;
|
||||||
procedure SetData(const AValue: TFPReportData);
|
procedure SetData(const AValue: TFPReportData);
|
||||||
protected
|
protected
|
||||||
|
procedure ProcessAggregates(const AData: TFPReportData); virtual;
|
||||||
Procedure SaveDataToNames; override;
|
Procedure SaveDataToNames; override;
|
||||||
Procedure RestoreDataFromNames; override;
|
Procedure RestoreDataFromNames; override;
|
||||||
function GetData: TFPReportData; override;
|
function GetData: TFPReportData; override;
|
||||||
@ -2551,6 +2552,7 @@ begin
|
|||||||
Result := EncodeDate(lY, lM, lD) + EncodeTime(lH, lMi, lS, 0);
|
Result := EncodeDate(lY, lM, lD) + EncodeTime(lH, lMi, lS, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TFPReportElementEditor }
|
{ TFPReportElementEditor }
|
||||||
|
|
||||||
procedure TFPReportElementEditor.SetElement(AValue: TFPReportElement);
|
procedure TFPReportElementEditor.SetElement(AValue: TFPReportElement);
|
||||||
@ -7030,23 +7032,14 @@ procedure TFPCustomReport.ProcessAggregates(const APageIdx: integer; const AData
|
|||||||
|
|
||||||
|
|
||||||
var
|
var
|
||||||
b: integer;
|
|
||||||
c: integer;
|
|
||||||
i: integer;
|
i: integer;
|
||||||
m: TFPReportCustomMemo;
|
P : TFPReportCustomPage;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Writeln('TFPCustomReport.ProcessAggregates');
|
P:=Pages[APageIdx];
|
||||||
for b := 0 to Pages[APageIdx].BandCount-1 do
|
for I := 0 to P.BandCount-1 do
|
||||||
begin
|
if P.Bands[I] is TFPReportCustomBandWithData then
|
||||||
if Pages[APageIdx].Bands[b] is TFPReportCustomBandWithData then
|
TFPReportCustomBandWithData(P.Bands[I]).ProcessAggregates(AData);
|
||||||
begin
|
|
||||||
if TFPReportCustomBandWithData(Pages[APageIdx].Bands[b]).Data <> AData then
|
|
||||||
Continue; // band is from a different data-loop
|
|
||||||
end;
|
|
||||||
for c := 0 to Pages[APageIdx].Bands[b].ChildCount-1 do
|
|
||||||
if Pages[APageIdx].Bands[b].Child[c] is TFPReportCustomMemo then
|
|
||||||
TFPReportCustomMemo(Pages[APageIdx].Bands[b].Child[c]).UpdateAggregates;
|
|
||||||
end; { bands }
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFPCustomReport.ClearReferenceList;
|
procedure TFPCustomReport.ClearReferenceList;
|
||||||
@ -8128,6 +8121,20 @@ begin
|
|||||||
FData.FreeNotification(Self);
|
FData.FreeNotification(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TFPReportCustomBandWithData.ProcessAggregates(const AData: TFPReportData);
|
||||||
|
|
||||||
|
Var
|
||||||
|
I : Integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if AData<>Data then
|
||||||
|
exit;
|
||||||
|
for I := 0 to ChildCount-1 do
|
||||||
|
if Child[I] is TFPReportCustomMemo then
|
||||||
|
TFPReportCustomMemo(Child[I]).UpdateAggregates;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TFPReportCustomBandWithData.SaveDataToNames;
|
procedure TFPReportCustomBandWithData.SaveDataToNames;
|
||||||
begin
|
begin
|
||||||
inherited SaveDataToNames;
|
inherited SaveDataToNames;
|
||||||
|
Loading…
Reference in New Issue
Block a user