Jump to content

Problem passing value to Variables at runtime to Fast Report using UniGui


ElCherchu

Recommended Posts

Hello

I'm trying to pass value to variable at runtime but when I pass text the band is not displayed.

In Fast Report using Unigui I define 3 variables:

FromDate

ToDate

Title

I use this function:

function TfrDM.GeneraReportePDF(const RepName: string; Rep, Title: string; FromDate, ToDate: TDateTime): string;
begin
    frxRep.PrintOptions.ShowDialog            := False;
    frxRep.ShowProgress                       := false;

    frxRep.EngineOptions.SilentMode           := True;
    frxRep.EngineOptions.EnableThreadSafe     := True;
    frxRep.EngineOptions.DestroyForms         := False;
    frxRep.EngineOptions.UseGlobalDataSetList := False;

    frxRep.LoadFromFile(UniServerModule.FilesFolderPath + 'Reportes\' + RepName + '.fr3');

    frxPDFExport.Background   := True;
    frxPDFExport.ShowProgress := False;
    frxPDFExport.ShowDialog   := False;
    frxPDFExport.FileName     := UniServerModule.NewCacheFileUrl(False, 'pdf', '', '', Result, True);
    frxPDFExport.DefaultPath  := '';

    frxRep.PreviewOptions.AllowEdit := False;

    frxRep.Variables['FromDate'] := FromDate;
    frxRep.Variables['ToDate']   := ToDate;
    frxRep.Variables['Title']    := Title;

    frxRep.PrepareReport;
    frxRep.Export(frxPDFExport);
end;

The frxRep.Variables['Title'] doesn't admit a text, I don't know why...

I need your help.

Thanks.

I using Delphi 10.2

Unigui 1.90.0.1530

Link to comment
Share on other sites

8 hours ago, Efrenis said:

Hello

Markokas your right, I found the solution using:

frxRep.Variables['Title']    := QuotedStr(Title);

Thanks a lot.

Hi,

Standard Method :

var Memo: TfrxMemoView;  //  frxClass
var  txt:string;
begin
  txt:='Hellow world';
 
  if frxReport1.FindObject('mem_MyMemo') as TfrxMemoView <> Nil then
  begin
    Memo := frxReport1.FindObject('mem_MyMemo') as TfrxMemoView;
    Memo.Lines.Add(txt);
  end;
end;

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...