QuickReport??s expression in FastReport
Hello,
Before I was using ???QuickReport??? to design my reports. I am just new to FastReport.
I will like to build reports using FastReport 4.13.2 for Delphi XE5. I could not find the appropriate chapter in help-documentation that addresses the issue below.
In the QuickReport, I can write this code: QRLabel1.Caption: = 'Some text'. How can I use FastReport to do so in TfrReport.OnBefore event?
Any help and enlightenment about this issue will be highly appreciated. Thanks.
Regards,
Alex
Ps:
In other words, what is the equivalent of below expression in FastReport?
procedure TTarjous1.QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
QRTarjous1Toimitusehto.caption:=F_main_LSF.ToimitusehtoEdit.text; //An Edit:Variables of the type "String" from the Main Form
QRTarjous1hintaan.caption:=FloatToStrF(F_main_LSF.CalculatedValue,ffNumber,15,0)+' ??¬'; //Variable of the type "Double" converted to String
QRTarjous1Lasinleveys.caption:=F_main_LSF.Saler2B.text+' mm'; //An Edit
QR_Rs_Name.caption := Optioner.Rs_Name; //Variables of the type "String" from Unit "Optioner"
QR_Rs_Address.caption := Optioner.Rs_Address;
end;
Before I was using ???QuickReport??? to design my reports. I am just new to FastReport.
I will like to build reports using FastReport 4.13.2 for Delphi XE5. I could not find the appropriate chapter in help-documentation that addresses the issue below.
In the QuickReport, I can write this code: QRLabel1.Caption: = 'Some text'. How can I use FastReport to do so in TfrReport.OnBefore event?
Any help and enlightenment about this issue will be highly appreciated. Thanks.
Regards,
Alex
Ps:
In other words, what is the equivalent of below expression in FastReport?
procedure TTarjous1.QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
QRTarjous1Toimitusehto.caption:=F_main_LSF.ToimitusehtoEdit.text; //An Edit:Variables of the type "String" from the Main Form
QRTarjous1hintaan.caption:=FloatToStrF(F_main_LSF.CalculatedValue,ffNumber,15,0)+' ??¬'; //Variable of the type "Double" converted to String
QRTarjous1Lasinleveys.caption:=F_main_LSF.Saler2B.text+' mm'; //An Edit
QR_Rs_Name.caption := Optioner.Rs_Name; //Variables of the type "String" from Unit "Optioner"
QR_Rs_Address.caption := Optioner.Rs_Address;
end;
Comments
QR: QRLabel1.Caption := 'some text'; //*Delphi code
FR: frxMemoView1.Memo.Text := 'here, too.'; //*FastScript code
And...
If you want to assign some event handlers in FastReport, you do by same way of Delphi.
sample code:
Hi,
I am unable to comply the code following your suggestion and enlightenment herein.
The name of the memo in frxReport1 is
Memo3: TFrxMemoView
ERROR
E2003 Undeclared identifier: frxMemoViewMemo3
What is wrong in my code (see below)? I using FastReport 4.13.2 for Delphi XE5.
Regards,
Alex
see the programmers manual on working with report objects
My suggestion means that you should set the porperty of TfrxMemoView component *in FastScript*.
In your case, the name of TfrxMemoView is 'Memo3',
and you are trying to set the value of Delphi side component to the FastReport's component.
In such case, I would write:
[In Delphi]
[In FastReport(PascalScript)]
please do not forget to assign event by using report designer.
or directly set to Memo3.Memo by using object inspector of report designer.
(in this case, the value to set is '[SomeText]' because of variable reference.)
if you don't want to use script,
ie
begin
if sender.name = 'Memo3' then
with sender as tfrxmemoview do
begin
set any properties here
sender.memo.text:= 'the text you want';
end;
end;