CodePudding user response:
Use TGRDesigner to design reportsCodePudding user response:
Design the report form codeThe unit uReportDesigner;
Interface
USES the
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls grdesLib_TLB, OleServer grproLib_TLB;
Type
TfrmReportDesigner=class (TForm)
GRDesigner1: TGRDesigner;
GridppReport1: TGridppReport;
Procedure FormShow (Sender: TObject);
Procedure FormCreate (Sender: TObject);
Procedure GRDesigner1SaveReport (Sender: TObject);
Procedure GRDesigner1OpenReport (Sender: TObject);
Private
{Private declarations}
Public
{Public declarations}
StrReportFile: string;
end;
Var
FrmReportDesigner: TfrmReportDesigner;
Implementation
{$R *. DFM}
Procedure TfrmReportDesigner. FormShow (Sender: TObject);
The begin
GridppReport1. LoadFromFile (strReportFile);
GRDesigner1. Reload;
GRDesigner1. DefaultAction:=true;
end;
Procedure TfrmReportDesigner. FormCreate (Sender: TObject);
The begin
GRDesigner1. DefaultInterface. Report:=GridppReport1 DefaultInterface;
end;
Procedure TfrmReportDesigner. GRDesigner1SaveReport (Sender: TObject);
The begin
GRDesigner1. Post ();
GridppReport1. SaveToFile (self. StrReportFile);
GRDesigner1. DefaultAction:=false;
end;
Procedure TfrmReportDesigner. GRDesigner1OpenReport (Sender: TObject);
The begin
GRDesigner1. DefaultAction:=false;
end;
End.
Call the design report form code
If frmReportDesigner=nil then
The begin
FrmReportDesigner:=TfrmReportDesigner. Create (self);
end;
FrmReportDesigner. StrReportFile:=self. StrReportFile;
FrmReportDesigner. ShowModal;
Freeandnil (frmReportDesigner);
CodePudding user response:
Design the report form code
The unit uReportDesigner;
Interface
USES the
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls grdesLib_TLB, OleServer grproLib_TLB;
Type
TfrmReportDesigner=class (TForm)
GRDesigner1: TGRDesigner;
GridppReport1: TGridppReport;
Procedure FormShow (Sender: TObject);
Procedure FormCreate (Sender: TObject);
Procedure GRDesigner1SaveReport (Sender: TObject);
Procedure GRDesigner1OpenReport (Sender: TObject);
Private
{Private declarations}
Public
{Public declarations}
StrReportFile: string;
end;
Var
FrmReportDesigner: TfrmReportDesigner;
Implementation
{$R *. DFM}
Procedure TfrmReportDesigner. FormShow (Sender: TObject);
The begin
GridppReport1. LoadFromFile (strReportFile);
GRDesigner1. Reload;
GRDesigner1. DefaultAction:=true;
end;
Procedure TfrmReportDesigner. FormCreate (Sender: TObject);
The begin
GRDesigner1. DefaultInterface. Report:=GridppReport1 DefaultInterface;
end;
Procedure TfrmReportDesigner. GRDesigner1SaveReport (Sender: TObject);
The begin
GRDesigner1. Post ();
GridppReport1. SaveToFile (self. StrReportFile);
//GridppReport1. SaveToFile (' d: \ 2. GRF);
GRDesigner1. DefaultAction:=false;
end;
Procedure TfrmReportDesigner. GRDesigner1OpenReport (Sender: TObject);
The begin
GRDesigner1. DefaultAction:=false;
end;
End.
CodePudding user response: