Variables in Report Name (ReportOptions.Name)
I have the following problem:
I found the Name property of FR document (Report.ReportOptions.Name) or MenuBar/Report/Property/Description/Name.
I can set it there and when i open Print Preview-> print PDF (i use FreePDF) the name of the document is how i called it! If i let these fields free, its default "Fast Report Document"
My problem is that i want to do a composite name out of a string and a variable:
Report.Name := 'Invoice_' + <frx_rep01."MASKENKEY">;
Is it even possible to do a composite report name for the pdf with a variable and how does it work? And in which procedure i have to do it?
I tried it in:
Page1OnBeforePrint
frxReport1OnReportPrint
Thx for your help!
I found the Name property of FR document (Report.ReportOptions.Name) or MenuBar/Report/Property/Description/Name.
I can set it there and when i open Print Preview-> print PDF (i use FreePDF) the name of the document is how i called it! If i let these fields free, its default "Fast Report Document"
My problem is that i want to do a composite name out of a string and a variable:
Report.Name := 'Invoice_' + <frx_rep01."MASKENKEY">;
Is it even possible to do a composite report name for the pdf with a variable and how does it work? And in which procedure i have to do it?
I tried it in:
Page1OnBeforePrint
frxReport1OnReportPrint
Thx for your help!
Comments
frxreport.Report.FileName:='Invoice_' + <frx_rep01."MASKENKEY">;
Kim
procedure frxReport1OnReportPrint(Sender: TfrxComponent);
begin
Showmessage(Report.Reportoptions.Name);
Report.Reportoptions.Name := ''''+'Auftragsbestaetigung_'+<frx_rep01."MASKENKEY">+'''';
Showmessage(Report.Reportoptions.Name);
end;
First Line, the name of my Report is shown. I named it in Report/Reportoptions/Name "Test123" (my messagebox confirms that to me)
Second Line, i rename the ReportName (my messagebox in Line3 confirms the Report.Reportoptions.Name to "Auftragsbestaetigung_12345678"
But if i press the Print Button in Fastreport and go to Printer "FreePDF", then the Filename is mentioned there as "Test123" again.
I tried to put the code in different procedures of "Page" and "Report", but still the "old" name occurs.
Where do i need to change the name that it is changed before FreePDF tooks the name? What is the first procedure of all? (i guess onReportPrint (Report) or OnBeforePrint (Page))
Is it even possible to change a property value of the report in code so the changed value will be used when (in my case) i want to save the report as pdf. I guess the value of Name is saved somewhere before and will be used, no matter if we change it in code.
What do you mean in Delphis code? You mean before FR is starting, i have to change it in the Software which calls the FastReport (in my case AVERP ERP)?
The renaming is working (see my other post), but still the name is not taken by the Printer FreePDF.
Report.Reportoptions.Name := ''''+'Auftragsbestaetigung_'+<frx_rep01."MASKENKEY">+'''';
in the main procedure of the report script
The name has to be defined in AverpDesigner in Objectinspector/FormShow and not in the FastReport Designer.
I put following code in FormShow and it worked:
q_rep1.open();
frxReport1.ReportOptions.Name := 'Name_'+AsString(q_rep1.FieldByName('MASKENKEY'));
Hello there! I am trying to accomplish this exact same thing and I am having the same frustrating results.
Will someone please help?
What do you mean by "AverpDesigner" ?