|
@@ -1536,7 +1536,6 @@ type
|
|
procedure RTBeginUsePrevVariableValues;
|
|
procedure RTBeginUsePrevVariableValues;
|
|
procedure RTEndUsePrevVariableValues;
|
|
procedure RTEndUsePrevVariableValues;
|
|
protected
|
|
protected
|
|
- FBands: TBandList;
|
|
|
|
class function IsStringValueZero(const AValue: string): boolean; virtual;
|
|
class function IsStringValueZero(const AValue: string): boolean; virtual;
|
|
function CreateVariables: TFPReportVariables; virtual;
|
|
function CreateVariables: TFPReportVariables; virtual;
|
|
function CreateImages: TFPReportImages; virtual;
|
|
function CreateImages: TFPReportImages; virtual;
|
|
@@ -1660,19 +1659,21 @@ type
|
|
FRTPage: TFPReportCustomPage;
|
|
FRTPage: TFPReportCustomPage;
|
|
FCurrentRTColumnFooterBand: TFPReportCustomColumnFooterBand;
|
|
FCurrentRTColumnFooterBand: TFPReportCustomColumnFooterBand;
|
|
FDataLevelStack: UInt8;
|
|
FDataLevelStack: UInt8;
|
|
- procedure ClearBandList;
|
|
|
|
|
|
+ FBands: TBandList;
|
|
function GetPage(AIndex: integer): TFPReportCustomPage;
|
|
function GetPage(AIndex: integer): TFPReportCustomPage;
|
|
function GetRTCurDsgnPageIdx: Integer;
|
|
function GetRTCurDsgnPageIdx: Integer;
|
|
function GetPerDesignerPageCount(Index : Cardinal): Cardinal;
|
|
function GetPerDesignerPageCount(Index : Cardinal): Cardinal;
|
|
function GetRTCurPageIdx: Integer;
|
|
function GetRTCurPageIdx: Integer;
|
|
function GetRTIsLastColumn: Boolean;
|
|
function GetRTIsLastColumn: Boolean;
|
|
function GetRTObjects: TFPList;
|
|
function GetRTObjects: TFPList;
|
|
|
|
+ procedure HandleDataHeaderBands;
|
|
procedure SetGetPerDesignerPageCount(Index : Cardinal; AValue: Cardinal);
|
|
procedure SetGetPerDesignerPageCount(Index : Cardinal; AValue: Cardinal);
|
|
Function GetPageNumberPerDesignerPage : Integer;
|
|
Function GetPageNumberPerDesignerPage : Integer;
|
|
procedure SetRTCurDsgnPageIdx(pPageIdx: Integer);
|
|
procedure SetRTCurDsgnPageIdx(pPageIdx: Integer);
|
|
Procedure SetPageNumberPerDesignerPage(aValue : Integer);
|
|
Procedure SetPageNumberPerDesignerPage(aValue : Integer);
|
|
function FooterSpaceNeeded: TFPReportUnits;
|
|
function FooterSpaceNeeded: TFPReportUnits;
|
|
protected
|
|
protected
|
|
|
|
+ procedure ClearBandList;
|
|
procedure RemoveBandsFromPage(aList: TBandList); virtual;
|
|
procedure RemoveBandsFromPage(aList: TBandList); virtual;
|
|
function HandleOverflowedBands(aHandledBands: TBandList; aBand: TFPReportCustomBand; var aRTBand: TFPReportCustomBand): TOverFlowAction; virtual;
|
|
function HandleOverflowedBands(aHandledBands: TBandList; aBand: TFPReportCustomBand; var aRTBand: TFPReportCustomBand): TOverFlowAction; virtual;
|
|
procedure CheckNewOrOverFlow(CheckMulticolumn: Boolean = True); virtual;
|
|
procedure CheckNewOrOverFlow(CheckMulticolumn: Boolean = True); virtual;
|
|
@@ -1728,6 +1729,9 @@ type
|
|
property RTIsLastColumn: Boolean read GetRTIsLastColumn;
|
|
property RTIsLastColumn: Boolean read GetRTIsLastColumn;
|
|
Property PageNumberPerDesignerPage : Integer Read GetPageNumberPerDesignerPage Write SetPageNumberPerDesignerPage;
|
|
Property PageNumberPerDesignerPage : Integer Read GetPageNumberPerDesignerPage Write SetPageNumberPerDesignerPage;
|
|
Public
|
|
Public
|
|
|
|
+ Constructor Create(aOwner : TComponent); override;
|
|
|
|
+ Destructor Destroy; override;
|
|
|
|
+
|
|
Procedure Execute(aReport : TFPCustomReport);
|
|
Procedure Execute(aReport : TFPCustomReport);
|
|
Property Report : TFPCustomReport Read FMyReport;
|
|
Property Report : TFPCustomReport Read FMyReport;
|
|
end;
|
|
end;
|
|
@@ -7257,7 +7261,9 @@ end;
|
|
function TFPReportCustomPage.GetBand(AIndex: integer): TFPReportCustomBand;
|
|
function TFPReportCustomPage.GetBand(AIndex: integer): TFPReportCustomBand;
|
|
begin
|
|
begin
|
|
if Assigned(FBands) then
|
|
if Assigned(FBands) then
|
|
- Result := TFPReportCustomBand(FBands[AIndex]);
|
|
|
|
|
|
+ Result := TFPReportCustomBand(FBands[AIndex])
|
|
|
|
+ else
|
|
|
|
+ Raise EListError.CreateFmt(SErrInvalidChildIndex,[aIndex]);
|
|
end;
|
|
end;
|
|
|
|
|
|
function TFPReportCustomPage.GetBandCount: integer;
|
|
function TFPReportCustomPage.GetBandCount: integer;
|
|
@@ -7589,17 +7595,14 @@ Var
|
|
|
|
|
|
begin
|
|
begin
|
|
FPageCount:=0;
|
|
FPageCount:=0;
|
|
- FBands:=Nil;
|
|
|
|
L:=CreateLayouter;
|
|
L:=CreateLayouter;
|
|
try
|
|
try
|
|
FDataAdded:=TFPList.Create;
|
|
FDataAdded:=TFPList.Create;
|
|
- FBands:=TBandList.Create;
|
|
|
|
SetLength(FPerDesignerPageCount, PageCount);
|
|
SetLength(FPerDesignerPageCount, PageCount);
|
|
L.Execute(Self);
|
|
L.Execute(Self);
|
|
finally
|
|
finally
|
|
SetLength(FPerDesignerPageCount, 0);
|
|
SetLength(FPerDesignerPageCount, 0);
|
|
FreeAndNil(FDataAdded);
|
|
FreeAndNil(FDataAdded);
|
|
- FreeAndNil(Fbands);
|
|
|
|
L.Free;
|
|
L.Free;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -10974,6 +10977,28 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TFPReportLayouter.HandleDataHeaderBands;
|
|
|
|
+
|
|
|
|
+Var
|
|
|
|
+ D : TFPReportCustomDataBand;
|
|
|
|
+ i , j: Integer;
|
|
|
|
+ lBand : TFPReportCustomBand;
|
|
|
|
+
|
|
|
|
+begin
|
|
|
|
+ for I := 0 to FBands.Count-1 do
|
|
|
|
+ begin
|
|
|
|
+ lBand := FBands[I];
|
|
|
|
+ if (lBand is TFPReportCustomDataBand) then
|
|
|
|
+ begin
|
|
|
|
+ inc(FDataLevelStack);
|
|
|
|
+ D:=TFPReportCustomDataBand(lBand);
|
|
|
|
+ if (D.HeaderBand <> nil) then
|
|
|
|
+ ShowDataHeaderBand(D.HeaderBand);
|
|
|
|
+ dec(FDataLevelStack);
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TFPReportLayouter.HandleDataBands;
|
|
procedure TFPReportLayouter.HandleDataBands;
|
|
|
|
|
|
Var
|
|
Var
|
|
@@ -10982,15 +11007,13 @@ Var
|
|
lBand : TFPReportCustomBand;
|
|
lBand : TFPReportCustomBand;
|
|
|
|
|
|
begin
|
|
begin
|
|
- for I := 0 to Report.FBands.Count-1 do
|
|
|
|
|
|
+ for I := 0 to FBands.Count-1 do
|
|
begin
|
|
begin
|
|
- lBand := TFPReportCustomBand(Report.FBands[I]);
|
|
|
|
|
|
+ lBand := TFPReportCustomBand(FBands[I]);
|
|
if (lBand is TFPReportCustomDataBand) then
|
|
if (lBand is TFPReportCustomDataBand) then
|
|
begin
|
|
begin
|
|
inc(FDataLevelStack);
|
|
inc(FDataLevelStack);
|
|
D:=TFPReportCustomDataBand(lBand);
|
|
D:=TFPReportCustomDataBand(lBand);
|
|
- if D.HeaderBand <> nil then
|
|
|
|
- ShowDataHeaderBand(D.HeaderBand);
|
|
|
|
ShowDataBand(D);
|
|
ShowDataBand(D);
|
|
{ set DetailsPrinted in all groups }
|
|
{ set DetailsPrinted in all groups }
|
|
for j := 0 to FGroupHeaderList.Count-1 do
|
|
for j := 0 to FGroupHeaderList.Count-1 do
|
|
@@ -11024,7 +11047,7 @@ end;
|
|
procedure TFPReportLayouter.ClearBandList;
|
|
procedure TFPReportLayouter.ClearBandList;
|
|
|
|
|
|
begin
|
|
begin
|
|
- Report.FBands.Clear;
|
|
|
|
|
|
+ FBands.Clear;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TFPReportLayouter.InitBandList(aPage: TFPReportCustomPage;
|
|
procedure TFPReportLayouter.InitBandList(aPage: TFPReportCustomPage;
|
|
@@ -11053,7 +11076,7 @@ begin
|
|
{ Do a quick sanity check - we may not have more than one master data band }
|
|
{ Do a quick sanity check - we may not have more than one master data band }
|
|
if FFoundDataBand then
|
|
if FFoundDataBand then
|
|
ReportError(SErrMultipleDataBands);
|
|
ReportError(SErrMultipleDataBands);
|
|
- Report.FBands.Add(lBand);
|
|
|
|
|
|
+ FBands.Add(lBand);
|
|
FFoundDataBand := True;
|
|
FFoundDataBand := True;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
@@ -11065,7 +11088,7 @@ begin
|
|
continue; // this is not the toplevel GroupHeader Band.
|
|
continue; // this is not the toplevel GroupHeader Band.
|
|
if lBand is TFPReportCustomGroupFooterBand then
|
|
if lBand is TFPReportCustomGroupFooterBand then
|
|
continue; // we will get the Footer from the GroupHeaderBand.FooterBand property
|
|
continue; // we will get the Footer from the GroupHeaderBand.FooterBand property
|
|
- Report.FBands.Add(aPage.Bands[I]); { all non-data bands are of interest }
|
|
|
|
|
|
+ FBands.Add(aPage.Bands[I]); { all non-data bands are of interest }
|
|
end;
|
|
end;
|
|
|
|
|
|
if lBand is TFPReportCustomSummaryBand then
|
|
if lBand is TFPReportCustomSummaryBand then
|
|
@@ -11084,8 +11107,7 @@ begin
|
|
HandleOverflowed;
|
|
HandleOverflowed;
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure TFPReportLayouter.RunDataLoop(aPageIdx: Integer;
|
|
|
|
- aPageData: TFPReportData);
|
|
|
|
|
|
+procedure TFPReportLayouter.RunDataLoop(aPageIdx: Integer; aPageData: TFPReportData);
|
|
|
|
|
|
Var
|
|
Var
|
|
I : integer;
|
|
I : integer;
|
|
@@ -11125,6 +11147,8 @@ begin
|
|
PrepareRecord;
|
|
PrepareRecord;
|
|
if FNewPage then
|
|
if FNewPage then
|
|
StartNewPage;
|
|
StartNewPage;
|
|
|
|
+ if not FDataHeaderPrinted then
|
|
|
|
+ HandleDataHeaderBands;
|
|
if FHasGroups then
|
|
if FHasGroups then
|
|
HandleGroupBands;
|
|
HandleGroupBands;
|
|
// This must be done after the groups were handled.
|
|
// This must be done after the groups were handled.
|
|
@@ -11136,19 +11160,19 @@ begin
|
|
PrepareRecord;
|
|
PrepareRecord;
|
|
end;
|
|
end;
|
|
CheckNewOrOverFlow(True);
|
|
CheckNewOrOverFlow(True);
|
|
|
|
+ if FHasGroupFooter then
|
|
|
|
+ HandleLastGroupFooters;
|
|
// only print if we actually had data
|
|
// only print if we actually had data
|
|
if assigned(aPageData) and (aPageData.RecNo > 1) then
|
|
if assigned(aPageData) and (aPageData.RecNo > 1) then
|
|
begin
|
|
begin
|
|
- for I := 0 to Report.FBands.Count-1 do
|
|
|
|
|
|
+ for I := 0 to FBands.Count-1 do
|
|
begin
|
|
begin
|
|
- lBand := TFPReportCustomBand(Report.FBands[I]);
|
|
|
|
|
|
+ lBand := TFPReportCustomBand(FBands[I]);
|
|
if lBand is TFPReportCustomDataBand then
|
|
if lBand is TFPReportCustomDataBand then
|
|
if TFPReportCustomDataBand(lBand).FooterBand <> nil then
|
|
if TFPReportCustomDataBand(lBand).FooterBand <> nil then
|
|
ShowBandWithChilds(TFPReportCustomDataBand(lBand).FooterBand);
|
|
ShowBandWithChilds(TFPReportCustomDataBand(lBand).FooterBand);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
- if FHasGroupFooter then
|
|
|
|
- HandleLastGroupFooters;
|
|
|
|
if Assigned(aPageData) and (not TwoPass or not IsFirstPass) then
|
|
if Assigned(aPageData) and (not TwoPass or not IsFirstPass) then
|
|
aPageData.Close;
|
|
aPageData.Close;
|
|
end;
|
|
end;
|
|
@@ -11203,9 +11227,9 @@ Var
|
|
lBand : TFPReportCustomBand;
|
|
lBand : TFPReportCustomBand;
|
|
|
|
|
|
begin
|
|
begin
|
|
- for I:=0 to Report.FBands.Count-1 do
|
|
|
|
|
|
+ for I:=0 to FBands.Count-1 do
|
|
begin
|
|
begin
|
|
- lBand := TFPReportCustomBand(Report.FBands[I]);
|
|
|
|
|
|
+ lBand := TFPReportCustomBand(FBands[I]);
|
|
if lBand is TFPReportCustomSummaryBand then
|
|
if lBand is TFPReportCustomSummaryBand then
|
|
begin
|
|
begin
|
|
{ We are allowed to use design Layout.Height instead of RTLayout.Height
|
|
{ We are allowed to use design Layout.Height instead of RTLayout.Height
|
|
@@ -11469,6 +11493,18 @@ begin
|
|
Report.DoProcessTwoPass;
|
|
Report.DoProcessTwoPass;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+constructor TFPReportLayouter.Create(AOwner : TComponent);
|
|
|
|
+begin
|
|
|
|
+ Inherited Create(AOwner);
|
|
|
|
+ FBands:=TBandList.Create;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+destructor TFPReportLayouter.Destroy;
|
|
|
|
+begin
|
|
|
|
+ FreeAndNil(Fbands);
|
|
|
|
+ inherited Destroy;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TFPReportLayouter.Execute(aReport: TFPCustomReport);
|
|
procedure TFPReportLayouter.Execute(aReport: TFPCustomReport);
|
|
begin
|
|
begin
|
|
FGroupFooterList := Nil;
|
|
FGroupFooterList := Nil;
|