Jump to content

FastReport Support


vbdavie

Recommended Posts

I've seen several posts here that are old referring to FastReports.

 

Since the preview window of fast reports is for VCL, does that mean this will NOT WORK for uniGUI?

 

If it DOES work, is there a decent demo? I downloaded the corrected RAR file demo, but it doesn't appear to load. I will have to see about dependencies.

 

Anyway, the demo looks like it turns off the visual preview mode and uses an internal processes of the report and then sticks it into a FormURLView type of framed component.

 

Is that the correct way?

 

Is Fast Reports thread safe? I'm having trouble understanding what types of components I can use. IE: If fast reports used some sort of global variables, then it would not be thread-safe. It used to be that a lot of the graphics objects in Delphi were not thread-safe. So, since the Fast Reports does a lot of graphics and charts etc.... I am concerned that it's a disaster waiting to happen. Hmmmm.

 

On a minor note: When you say run the uiGUI in VCL mode, does that mean run it right on your desktop WITHOUT a browser? Since I couldn't find or get that feature, can I presume that that feature is turned off for Trial Versions?

 

Thanks

Davie

Link to comment
Share on other sites

Hi Davie

 

In my case, I started using FastReport with uniGUI following this sample, it works good for simple reports (no much DB process), right now that way is not good to my due to I have to make heavy db process and this way turns too slow  (DB process must to ends first and then export the report to PDF). There is a faster way, if you have the Fastreport Enterprise Components installed, you can create a Fastreport Server (I prefer it as a service) and publish all your reports there, so you can load your reports on a TUniURLFrame component.

 

Best regards

Link to comment
Share on other sites

Thanks for your reply, I got my sample project working, but was wondering if FastReports was thread-safe.

 

My sample project just reads in a few lines from DB and displays some detail lines and a couple of charts. Then in code, it composes it and then exports to PDF and then loads the PDF into the URLFrame component.

 

How is that DIFFERENT from what YOU are doing? Your way seems more complicated with more steps involved. Mine is like....

button to VIEW report...

procedure TFormRep1.ButtonViewClick(Sender: TObject);
begin
   MainForm.DwnRepoFile:=False;
   QryCity.Open;
   DataFrTools.MyFrxShow(frxReport1);
   QryCity.Close;
end;

function to do the displaying. Stuff it into a URLFrame

procedure TDataFrTools.MyFrxShow(frxReport: TfrxReport);
var
   fn:String;
   FormUrlView1: TFormUrlView;
begin
   fn:= 'R-' +FormatDateTime('hhmmss.zzz', Now()) +'.pdf'; // Create a unique name for report.
   frxReport.PrintOptions.ShowDialog := False;
   frxReport.ShowProgress:=false;
   frxReport.PrintOptions.ShowDialog:=false;
   frxReport.EngineOptions.SilentMode:=True;
   frxPDFExport1.Background:=True;
   frxPDFExport1.ShowProgress:=False;
   frxPDFExport1.ShowDialog:=False;
   frxPDFExport1.FileName := UniServerModule.LocalCachePath +fn;
   frxPDFExport1.DefaultPath := '';
   if Mainform.WebMode then begin
      frxReport.PrepareReport(); // Create Report
      frxReport.Export(frxPDFExport1); // Export Report
      if MainForm.DwnRepoFile then begin
         UniSession.SendFile(UniServerModule.LocalCachePath +fn, fn);
      end else begin
         FormUrlView1:=TFormUrlView.Create(UniApplication);
         FormUrlView1.URLFrame.URL := UniServerModule.LocalCacheURL +fn; // Displayed on UniURLFrame
         FormUrlView1.Show;
      end;
   end else begin
      frxReport.ShowReport();
   end;
end;
 

 

And that's pretty much it.

 

Thanks

Davie

Link to comment
Share on other sites

Hi Davie

 

About Fastreport Server as a Service is something done just one time and can be useful for all your project in the future, so my step is this:

procedure TfrmReportsMyModule.UniPanel2Click(Sender: TObject);
var
  MyForm: TFormUrlView;
begin
  MyForm := TFormUrlView.Create(Self.UniApplication);
  MyForm.URLFrame.URL := 'http://inv-web:8097/result?report=1.CajaPSA\\Estado%20de%20Tarjetas%20de%20ISLAZUL%28nuevo%29.fr3&format=PDF';
  MyForm.ShowModal();
end;

So, in the URL I just write the URL to my report published on my FastReport Server.

 

Cheers

Link to comment
Share on other sites

Ah, so basically what I see as the advantage is that you don't have to have code in your program to EXPORT TO PDF. It looks like you just print to the server and the server keeps the data in a compressed internal FR3 format and then you tell the server that you want a paricular report and you tell it you want the PDF FORMAT type and poof, the server dishes it up to you? Is that the benefit?

 

Thanks

Davie

Link to comment
Share on other sites

Hi Davie

 

Fastreport Server do all the heavy work for you. It is simpler than you think. Fastreport Server is a web server with your reports published on him. So, you just have to write the URL to access to your report on the web, and FastReport let you choose how do you want to export it, as PDF, as XLS, etc, or if you want to print it.

 

Cheers

Link to comment
Share on other sites

Hi Ronny

 

I had never try ReportBuilder. It allow to publish all my reports on a web server?

 

Hola Ronny

 

Nunca he visto ni experimentado con ReportBuilder. Me permite publicar todos mis reportes en un servidor web?

 

Cheers

Link to comment
Share on other sites

Really You just can Convert to PDF,HTML or Excel  and show in the browser 

Example 

 

procedure TUniMainModule.Imprimir(ReporteSalida: TppReport);
var
  lPDFDevice: TppPDFDevice;
  CacheFileName: string;
begin
 
  // creat and configure the PDFDevice
  lPDFDevice := TppPDFDevice.Create(nil);
  CacheFileName := UniServerModule.LocalCachePath + FormatDateTime('hhmmsszzz',
    NOW) + 'Reporte.pdf';
 
  try
    lPDFDevice.PDFSettings := ReporteSalida.PDFSettings;
    lPDFDevice.FileName := CacheFileName; // assign output stream
    lPDFDevice.Publisher := ReporteSalida.Publisher;
 
    // generate the report
 
    ReporteSalida.PrintToDevices;
    UniSession.SendFile(CacheFileName);
  finally
    lPDFDevice.Free;
  end;
 
end;
Link to comment
Share on other sites

Hi Ronny,

 

  We do the same also with FastReport without any problem.

 

@vbdavie, We do use FastReport, it's working very well as far as you don't interact with dialogs designed to be shown in VCL desktop application, such as preview windows, progress dialogs, etc.

 

You need just to export it to PDF or HTML and show it inside browser.

 

 

Really You just can Convert to PDF,HTML or Excel  and show in the browser 

Example 

 

procedure TUniMainModule.Imprimir(ReporteSalida: TppReport);
var
  lPDFDevice: TppPDFDevice;
  CacheFileName: string;
begin
 
  // creat and configure the PDFDevice
  lPDFDevice := TppPDFDevice.Create(nil);
  CacheFileName := UniServerModule.LocalCachePath + FormatDateTime('hhmmsszzz',
    NOW) + 'Reporte.pdf';
 
  try
    lPDFDevice.PDFSettings := ReporteSalida.PDFSettings;
    lPDFDevice.FileName := CacheFileName; // assign output stream
    lPDFDevice.Publisher := ReporteSalida.Publisher;
 
    // generate the report
 
    ReporteSalida.PrintToDevices;
    UniSession.SendFile(CacheFileName);
  finally
    lPDFDevice.Free;
  end;
 
end;

 

Link to comment
Share on other sites

  • 4 weeks later...

What does background=true do? Does that create additional threads? If it fails on 64bit, does that mean it's not thread safe? Hmmm.

 

EddyRocha sent me this....

frxReport.EngineOptions.EnableThreadSafe := True;

 

What does that mean? Does that mean it's not threadsafe to start with and you have to set a property?

 

Davie

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