Jump to content

FastReport on standalone server


markokas

Recommended Posts

You can't. A VCL dialog can't be displayed in web mode. uniGUI doesn't provide a mean to achieve this. If you need such a dialog then you must design it yourself using uniGUI controls.

 

What is component unigui controls for design report displayed in web mode ?

Link to comment
Share on other sites

  • Administrators

You can't. A VCL dialog can't be displayed in web mode. uniGUI doesn't provide a mean to achieve this. If you need such a dialog then you must design it yourself using uniGUI controls.

 

What is component unigui controls for design report displayed in web mode ?

 

General uniGUI components: UniButton, UniEdit,..etc.

 

uniGUI doesn't offer components for a specific purpose, just general components which you can use for any purpose.

Link to comment
Share on other sites

  • 3 months later...

Hi!

Im using UniGui, the most recent version, in the application I'm using ReportBuilder v14 Enterprise, i save the PDF in "localhost:8077/Reportes/Report.PF" and in a new form i use the UniURLFrame and assign the URL property, when i run the application in localhost i can see the PDF, but the page freezes and can't save the file, when i run the application in other PC i can't see the page, any idea?

Link to comment
Share on other sites

This is an example to apply FastReport to UniGUI framework.

 

To prevent dialogs showing at server you should be set the following properties of TfrxReport

EngineOptions.SilentMode = True
EngineOptions.NewSilentMode = simSilent

and for TfrxPDFExport

ShowDialog = False
ShowProgress = False
OverwritePrompt = False

Example

define the following components

frxRepData: TfrxReport;
frxPDFExport: TfrxPDFExport
PrintURLFrame: TUniURLFrame;

Code:

var
 _LFile: String;
begin
 ...

 // The following 5 lines below could be set at design time
 frxRepData.EngineOptions.SilentMode := True;
 frxRepData.EngineOptions.NewSilentMode := simSilent;
 frxPDFExport.ShowDialog := False;
 frxPDFExport.ShowProgress := False;
 frxPDFExport.OverwritePrompt := False;

 frxRepData.DataSet := cdsMiscDataSet;
 if (cdsMiscDataSet.Active) then
   cdsMiscDataSet.Close();

 cdsMiscDataSet.CommandText := 'SELECT * FROM XXX_DATA';
 frxReport.LoadFromFile(UniServerModule.FilesFolderPath + 'some_report.fr3', False);

 cdsMiscDataSet.Open();
 if (not cdsMiscDataSet.IsEmpty) then
 begin
   // pass True to clear a previous generated report.
   // If you need to merge a variant of reports set it to False
   frxReport.PrepareReport(True); 

   _LFile := 'payment_' + FormatDateTime('hhmmss.zzz', Now()) + '.pdf';
   frxPDFExport.FileName := _LFile;
   frxPDFExport.DefaultPath := UniServerModule.LocalCachePath;
   try
     frxReport.Export(frxPDFExport);
     PrintURLFrame.URL := UniServerModule.LocalCacheURL + _LFile + '#';
   except
     ShowMessage('Error, Can not generate printing documents to PDF format.');
   end;  
 end else
   ShowMessage('There are no pages to generated printing.');
end

 

The above example write on the fly at the post time, sorry if there are some error. :)

Link to comment
Share on other sites

If it helps, this is the code I use without problems UNIGUI + FASTREPORT

 

Var
   Report:TFrxReport;
   frxDataset:TfrxDBDataset;
   PDFExport:TfrxPDFexport;
Begin
   Try
    frxDataset:=TfrxDBDataset.Create(Nil);
    frxDataset.DataSet:=UniMainModule.DatasetQuery;
    frxDataset.Name:='frxDataset';
    Report:=TFrxReport.Create(Nil);
    Report.DataSet:=frxDataset;
    Report.DataSetName:='frxDataset';
    Report.LoadFromFile(ReportsPath+'\report.fr3');
    Report.PrepareReport(True);
   except
   End;
   FileName:='xyz.pdf';
   PDFExport:=TfrxPDFexport.Create(Nil);
   PDFExport.FileName:=TempPath+'\'+FileName;
   PDFExport.ShowDialog:=False;
   PDFExport.ShowProgress:=False;
   Report.Export(PDFExport);
   UniLabel10.Visible:=True;
   UniLabel10.Caption:='<a href="'+FileName+'" target=new>"Download Report!!"</a>';
End;

Link to comment
Share on other sites

Hi!

Im using UniGui, the most recent version, in the application I'm using ReportBuilder v14 Enterprise, i save the PDF in "localhost:8077/Reportes/Report.PF" and in a new form i use the UniURLFrame and assign the URL property, when i run the application in localhost i can see the PDF, but the page freezes and can't save the file, when i run the application in other PC i can't see the page, any idea?

 

This is my solution :

Report.TextFileName := UniServerModule.LocalCachePath+StringReplace(UniMainModule.nombre, ' ','',[rfReplaceAll])+'.pdf'; //assign name and route to file
Report.Print; // send a message to report for print the file
ReporteForm.UniURLFrame1.URL := UniServerModule.LocalCacheURL+StringReplace(UniMainModule.nombre, ' ','',[rfReplaceAll])+'.pdf'; //Assign the route to url property of the  uniurlframe
reporteform.show; // and display the report in new form, in new form only contain an UniURLFrame, I'm testing in Opera, Chrome and IE9

 

I hope that someone would be useful.

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...