Transferring global variables into a report
Hello,
I will like to build reports using FastReport 4.13.2 for Delphi XE5. I am just new to FastReport; and I could not find the appropriate chapter in help-documentation that addresses this issue.
I will like to show the report, by a Click-event of a button from the MainForm.
Thus, I will be linking the FastReport's form to the MainForm in order to acquire Global variables??? values, to be inserted into FastReport???s text-contents. In order words, how can I display parameters/values from application MainForm anywhere within the FastReport (:using ???Text??? Object)?
Global variables can of the types ???String???, Integer???, Float-type???, etc. Let???s say, for example, Edit1.Text or Myvariable:= 99 from the MainForm. How can I transfer/access variables defined in the Delphi project in my FastReport?
Any help and enlightenment about this issue will be highly appreciated. Thanks very much in advance!
Regards,
Alex Siron
N.B:
unit Main;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls;
type
TfrmMain = class(TForm)
btnPreview: TButton;
procedure btnPreviewClick(Sender: TObject);
Edit1: TEdit;
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmMain: TfrmMain;
implementation
{$R *.DFM}
procedure TfrmMain.btnPreviewClick(Sender: TObject);
begin
frxReport1.ShowReport;
end;
end.
I will like to build reports using FastReport 4.13.2 for Delphi XE5. I am just new to FastReport; and I could not find the appropriate chapter in help-documentation that addresses this issue.
I will like to show the report, by a Click-event of a button from the MainForm.
Thus, I will be linking the FastReport's form to the MainForm in order to acquire Global variables??? values, to be inserted into FastReport???s text-contents. In order words, how can I display parameters/values from application MainForm anywhere within the FastReport (:using ???Text??? Object)?
Global variables can of the types ???String???, Integer???, Float-type???, etc. Let???s say, for example, Edit1.Text or Myvariable:= 99 from the MainForm. How can I transfer/access variables defined in the Delphi project in my FastReport?
Any help and enlightenment about this issue will be highly appreciated. Thanks very much in advance!
Regards,
Alex Siron
N.B:
unit Main;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls;
type
TfrmMain = class(TForm)
btnPreview: TButton;
procedure btnPreviewClick(Sender: TObject);
Edit1: TEdit;
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmMain: TfrmMain;
implementation
{$R *.DFM}
procedure TfrmMain.btnPreviewClick(Sender: TObject);
begin
frxReport1.ShowReport;
end;
end.
Comments
also how to use the ongetvalue event.