mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-04 04:57:41 +01:00
LazReport: Add OnFinalSetup event in TFrPrintGrid, patch from Zdravko Gabrovski, issue #37021
git-svn-id: trunk@63182 -
This commit is contained in:
parent
ac6b80f0c2
commit
9cdfd55ed4
@ -32,9 +32,14 @@ type
|
||||
ColumnWidth: Integer;
|
||||
end;
|
||||
|
||||
TColumnInfoArr = Array of TColumnInfo;
|
||||
|
||||
TSetupColumnEvent=procedure(Sender:TFrPrintGrid; const Column: TColumn;
|
||||
var PrintColumn:boolean; var ColumnWidth:Integer) of object;
|
||||
|
||||
TFinalSetupEvent=procedure(Sender:TFrPrintGrid; var FReport : TfrReport;
|
||||
var FColumnsInfo : TColumnInfoArr ) of object;
|
||||
|
||||
{ TfrPrintGrid }
|
||||
|
||||
TfrPrintGrid = class(TComponent)
|
||||
@ -42,6 +47,7 @@ type
|
||||
FDBGrid : TCustomDBGrid;
|
||||
FOnGetValue: TDetailEvent;
|
||||
FOnSetUpColumn: TSetupColumnEvent;
|
||||
FOnFinalSetup : TFinalSetupEvent;
|
||||
FPrinterIndex : Integer;
|
||||
FReport : TfrReport;
|
||||
FReportDataSet : TfrDBDataSet;
|
||||
@ -53,7 +59,7 @@ type
|
||||
FCaption : String;
|
||||
FShowCaption : Boolean;
|
||||
FDataSet : TDataset;
|
||||
FColumnsInfo : array of TColumnInfo;
|
||||
FColumnsInfo : TColumnInfoArr;
|
||||
FTemplate : string;
|
||||
|
||||
procedure OnEnterRect(Memo: TStringList; View: TfrView);
|
||||
@ -86,6 +92,8 @@ type
|
||||
property ShowProgress : Boolean read fShowProgress write fShowProgress default false;
|
||||
property OnSetupColumn: TSetupColumnEvent read FOnSetUpColumn write FOnSetupColumn;
|
||||
property OnGetValue: TDetailEvent read FOnGetValue write FOnGetValue;
|
||||
property OnFinalSetup: TFinalSetupEvent read FOnFinalSetup write FOnFinalSetup;
|
||||
|
||||
end;
|
||||
|
||||
|
||||
@ -371,6 +379,9 @@ begin
|
||||
FReport.PrepareReport;
|
||||
end;
|
||||
|
||||
if Assigned( OnFinalSetup ) then
|
||||
OnFinalSetup( Self, FReport, FColumnsInfo );
|
||||
|
||||
FReport.ShowReport;
|
||||
finally
|
||||
FDataSet.GotoBookmark(BM);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user