Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IntraWeb and FastReports
#1
Delphi XEII
Intraweb 15.0.17
FastReport 14.14

Has anyone had any experience with FastReports and HttpSys (although IIS might exhibit the same issues)?

I've been running Intraweb 14.x as Indy SA servers. The UserSession contains the appropriate datasets and a TfrxReport component. Different reports are loaded at runtime. PDFs produced are saved to the UserCache and displayed. In the past that worked fine. I've upgraded to 15.x and also converted to using HttpSys and now get lots of errors such as blank PDFs (i.e. no data) or PDFs displaying data from a different UserSession. On that last one ... I checked that the pdf was in the appropriate user's cache (it was) and the session's query (dataset) contains the correct data. 

I've done much googling / checking both this and FastReport's forums. There is plenty of advice, such as "DO NOT leave ANY TfrxReport components on any form, frame or data module" (create / destroy them at runtime); EnableThreadSafe := true (didn't solve the problem); UseGlobalDataSetList := False (blank report); use threads.

Before I start writing a ton of code I just wondering if anyone else as struck similar issues and how they solved them.
Reply
#2
If you think the problem is related to threading problems, what seems to be an easy way to knock that out is to do it in a CGI.

https://github.com/Atozed/IntraWeb/tree/.../CGIRunner

I haven't played with it but have a couple of libs that I don't trust with multithreading and eventually will do this.

As I recall TIWCGIRunner was introduced in 15. Might be worth looking into if you don't find an easier solution. Life is too short for tracing threading problems through a 3rd party lib.

Others may have better suggestions.

More info here: https://www.atozed.com/forums/showthread...60#pid1860

Dan
Reply
#3
Thanks Dan, I shall have a look at that.
Reply
#4
Hi,

I use IW and FastReport extensively and this is definitely a FastReport threading issue! 

There are other methods but TIWCGIRunner should definitely be your first choice.

Best regards 
Reply
#5
I use Fast Report extensively.

Here is some code and notes that may help.

      // this code is very important and needs to be called right after the report is created.
      lFrxReport.EngineOptions.EnableThreadSafe     := True;
      lFrxReport.EngineOptions.UseGlobalDataSetList := False;
      lFrxReport.ReportOptions.Compressed           := True;
      lFrxReport.EngineOptions.SilentMode           := True;
      //https://www.youtube.com/watch?v=PUUQ7LUbhD4
      lFrxReport.EngineOptions.DestroyForms         := True;
      lFrxReport.EngineOptions.UseFileCache         := False;
      lFrxReport.ShowProgress                       := False;
      lFrxReport.OnLoadTemplate                     := frxReportLoadTemplate;
Reply
#6
Thanks Dan & zsleo (and Alexandre for the demo).

I've got the first "trial" run of the CGIRunner and FastReport working. I had started to re-code the usersession report procedures with the enablethreadsafe etc. options but have decided that separating these out to a GIRunner makes more sense and means updating reports (beyond layout changes) can be done without having to shut done the IWServer itself.

Thanks joel. The video was also helpful.

I think part of the problem was that the IW / Indy server (previously used) didn't have any issues. But going to httpsys showed up a coding weakness on my part. I think I found people using the ISAPI option and FastReport had experienced similar to myself. Hopefully all okay now ... I'll find out in couple of days!
Reply
#7
(01-28-2019, 10:32 PM)TonyNZ Wrote: Thanks Dan & zsleo (and Alexandre for the demo).

I've got the first "trial" run of the CGIRunner and FastReport working. I had started to re-code the usersession report procedures with the enablethreadsafe etc. options but have decided that separating these out to a GIRunner makes more sense and means updating reports (beyond layout changes) can be done without having to shut done the IWServer itself.

Thanks joel. The video was also helpful.

I think part of the problem was that the IW / Indy server (previously used) didn't have any issues. But going to httpsys showed up a coding weakness on my part. I think I found people using the ISAPI option and FastReport had experienced similar to myself. Hopefully all okay now ... I'll find out in  couple of days!

If it helps we only deploy under ISAPI, however, nowdays alot of our reports are generated from our Middle Tier so that is a little different.   (We made the switch since ISAPI can have permission issues that can interfer with special fonts etc.)
Reply
#8
(01-28-2019, 10:32 PM)TonyNZ Wrote: Thanks Dan & zsleo (and Alexandre for the demo).

I've got the first "trial" run of the CGIRunner and FastReport working. I had started to re-code the usersession report procedures with the enablethreadsafe etc. options but have decided that separating these out to a GIRunner makes more sense and means updating reports (beyond layout changes) can be done without having to shut done the IWServer itself.

Thanks joel. The video was also helpful.

I think part of the problem was that the IW / Indy server (previously used) didn't have any issues. But going to httpsys showed up a coding weakness on my part. I think I found people using the ISAPI option and FastReport had experienced similar to myself. Hopefully all okay now ... I'll find out in  couple of days!

Hi,

How do I get the TIWCGIRunner? I dont have that in my component palette. We are experiencing this same issue and I was exploring other options. If you dont mind, please share your code here so that I might learn and code from it. 

My ISAPI dll went live this Monday and Fastreport is seemingly causing all kinds of issue. FastReport is yet to reply. 

Thanks for the help
Reply
#9
Hi, CGIRunner is in IW15. The demo is here.
Reply
#10
(04-25-2019, 06:08 PM)Jose Nilton Pace Wrote: Hi, CGIRunner is in IW15. The demo is here.

Thanks Jose,

I know now its a class and not a component. As I already have a dll application integrated with fastreports, Will I have to call CGIRunner from my dll application which will then call FastReport ie the tfrx component? 

Is there other documentation than the demo?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)