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';

Comments

  • gpigpi
    edited 7:47PM
    Try to set TfrxReport.EngineOptions.DestroyForms to False

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.