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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...