Return Variable Value
Hi All,
I have a collection of reports on a FastReport Server - internally these reports have a function CreateFileName() which creates the file name based on different internal values and update's the rFileName variable, I know the variable is being set correctly, What I need to achieve is to access the value of this variable from Delphi(2009) code, Now I'm using frxReportClient not frxReport I'm not sure if that would make any difference, my diffuclity is no matter what I try I cannot seem to get this value , I've also tried to set the "Name" of the report and access this through Delphi - But I can't seem to update the value of Name either, Any help greatly appreciated
// Internal Report Function - different depending on the report
function CreateFileName() : String;
begin
result := <rWkEnd>+'-'+<rCustCode>+'-Storage-Summary';
end;
procedure frxReportOnReportPrint(Sender: TfrxComponent);
begin
Report.ReportOptions.Name := CreateFileName();
end;
In my application Delphi(2009) I'm doing the below;
// create the object
try
with frxReportClient1 do
begin
Name := 'frxReportClient1';
Version := '5.0.10';
DotMatrixReport := False;
IniFile := '\Software\Fast Reports';
ScriptLanguage := 'PascalScript';
StoreInDFM := False;
Connection := DataForm.frxServer;
LoadFromFile(fReport);
if PrepareReport then
begin
for I := 0 to frxReportClient1.Variables.Count - 1 do
if (frxReportClient1.Variables.Items.Name = 'rFileName') then
begin
lvFileName := frxReportClient1.Variables.Items.Value;
end ;
showmessage(lvFileName);
lvFileName := lvfileName + '.csv';
I have a collection of reports on a FastReport Server - internally these reports have a function CreateFileName() which creates the file name based on different internal values and update's the rFileName variable, I know the variable is being set correctly, What I need to achieve is to access the value of this variable from Delphi(2009) code, Now I'm using frxReportClient not frxReport I'm not sure if that would make any difference, my diffuclity is no matter what I try I cannot seem to get this value , I've also tried to set the "Name" of the report and access this through Delphi - But I can't seem to update the value of Name either, Any help greatly appreciated
// Internal Report Function - different depending on the report
function CreateFileName() : String;
begin
result := <rWkEnd>+'-'+<rCustCode>+'-Storage-Summary';
end;
procedure frxReportOnReportPrint(Sender: TfrxComponent);
begin
Report.ReportOptions.Name := CreateFileName();
end;
In my application Delphi(2009) I'm doing the below;
// create the object
try
with frxReportClient1 do
begin
Name := 'frxReportClient1';
Version := '5.0.10';
DotMatrixReport := False;
IniFile := '\Software\Fast Reports';
ScriptLanguage := 'PascalScript';
StoreInDFM := False;
Connection := DataForm.frxServer;
LoadFromFile(fReport);
if PrepareReport then
begin
for I := 0 to frxReportClient1.Variables.Count - 1 do
if (frxReportClient1.Variables.Items.Name = 'rFileName') then
begin
lvFileName := frxReportClient1.Variables.Items.Value;
end ;
showmessage(lvFileName);
lvFileName := lvfileName + '.csv';
Comments