Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Intraweb session variables
#1
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.
Reply
#2
Hi, if you don't prepare report, prepare it before export.
Code:
frxReport.PrepareReport;
frxReport.Export( frxPDFExport );
Reply
#3
(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. 

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.

This is a common FR threading issue.  For potential  solutions see https://www.atozed.com/forums/showthread...rt#pid2407
Reply
#4
(04-24-2019, 07:43 PM)Jose Nilton Pace Wrote: Hi, if you don't prepare report, prepare it before export.
Code:
frxReport.PrepareReport;
frxReport.Export( frxPDFExport );

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

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.

This is a common FR threading issue.  For potential  solutions see https://www.atozed.com/forums/showthread...rt#pid2407
ok Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)