Intraweb session variables - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html) +----- Thread: Intraweb session variables (/thread-1045.html) |
Intraweb session variables - msgopala - 04-24-2019 Had some report crossover as far as fastreport and cache issues are concerned read a post that https://doc.atozed.com/en/iw14/develop/session/ to keep local variables to a minimum as they are common to all threads so moved over reporting variables to UserSession datamodule. What is happening is if a user is printing a report, sometimes its right. Sometimes the report has data which was previously printed by a completely different client. The reports are exported using frxPDFExport component and saved on the server where my dll is hosted from. Of course this didn't happen in the standalone and while we tested because we didnt have multiple external users accessing the application. The reports are first generated and exported and then sent via Webapplication.sendfile(path + filename). Filename changes everytime. What I have tried : Rpt.free, Exportfilter.stream.free, moving variables to USersessionDM. Still continues to happen. Report for John Doe prints correctly, Next while printing Jane Doe the report name says Jane Doe but data inside is of John Doe. How do I rectify this. My rpRpt.fr3 is stored on the server as well and how do I get it to to be specific to each session. The print report proc is not in the UserSessionDM but on the main form. Thanks for all your help. RE: Intraweb session variables - Jose Nilton Pace - 04-24-2019 Hi, if you don't prepare report, prepare it before export. Code: frxReport.PrepareReport; RE: Intraweb session variables - zsleo - 04-24-2019 (04-24-2019, 07:22 PM)msgopala Wrote: Had some report crossover as far as fastreport and cache issues are concerned read a post that https://doc.atozed.com/en/iw14/develop/session/ to keep local variables to a minimum as they are common to all threads so moved over reporting variables to UserSession datamodule. This is a common FR threading issue. For potential solutions see https://www.atozed.com/forums/showthread.php?tid=920&pid=2407&highlight=Fastreport#pid2407 RE: Intraweb session variables - msgopala - 04-25-2019 (04-24-2019, 07:43 PM)Jose Nilton Pace Wrote: Hi, if you don't prepare report, prepare it before export. this my code QRpt := TfrxReport.Create(Nil); QRpt.EngineOptions.DestroyForms := False; QRpt.EngineOptions.SilentMode := True; QRpt.EngineOptions.EnableThreadSafe := True; (* assigning all frx datasets here *) (* opening all frx datasets *) QRpt.Clear; QRpt.LoadFromFile if QRpt.PrepareReport(True) then begin QoExportfilter := TfrxCustomExportFilter(frxPDFExport1); QoExportfilter.FileName := QteUrl; QRpt.Export(QoExportfilter); end else begin raise Exception.Create('Reporting error'); end; QoExportFilter.Stream.Free; QRpt.Free; (04-24-2019, 07:58 PM)zsleo Wrote:ok Thanks(04-24-2019, 07:22 PM)msgopala Wrote: Had some report crossover as far as fastreport and cache issues are concerned read a post that https://doc.atozed.com/en/iw14/develop/session/ to keep local variables to a minimum as they are common to all threads so moved over reporting variables to UserSession datamodule. |