Jump to content

Problem In FastReport Convert To ISAPI


Ario.Paxaz

Recommended Posts

Hi

 

I used below function ,but don't  fixed.

procedure TMainForm.PrintRpt(FileName: String);
begin
  frxReport1.LoadFromFile(FileName);
  Form_Print.frxReport1:=frxReport1;
  Form_Print.PrepareAndShow(Form_Print.frxReport1,Form_Print.frxPDFExport1);
  Form_Print.ShowModal;
end;

and this 

procedure TMainForm.PrintRpt(FileName: String);
begin
  frxReport1.LoadFromFile(FileName);
  Form_Print.frxReport1:=frxReport1;
  Form_Print.PrepareAndShow(Form_Print.frxReport1,Form_Print.frxPDFExport1);
end;

 all of them,in stand alone work.

 

 

 

Best Regards.

Link to comment
Share on other sites

As commente in  this forum, the problem is the order of doing tings:

 

 

I do like this, and works in isapi without any problem:

 

procedure Tlibr.report(xr: string);
var
   rpt: TfrxReport;
   exp: TfrxPDFExport;
   xreport: string;
begin
   xreport := 'test.pdf';
   
   exp := TfrxPDFExport.create(self);
   rpt := TfrxReport.Create(self);

   rpt.Clear;
   rpt.EngineOptions.DestroyForms := False;
   rpt.EngineOptions.SilentMode := True;
   rpt.EngineOptions.UseGlobalDataSetList := False;
   rpt.EngineOptions.EnableThreadSafe := True;
   rpt.PrintOptions.ShowDialog := False;
   rpt.PreviewOptions.AllowEdit := False;
   rpt.ShowProgress := False;

   exp.ShowDialog := False;
   exp.ShowProgress := False;
   exp.OverwritePrompt := False;
   exp.Background := True;
   exp.EmbeddedFonts := True;
   exp.FileName := UniServerModule.StartPath + 'files\tmp\' + xreport;
   exp.DefaultPath := '';

   rpt.LoadFromFile(UniServerModule.StartPath +'rep\' + xr);

   rpt.PrepareReport;
   rpt.Export(exp);

   UniSession.SendFile(UniServerModule.StartPath + 'files\tmp\' + xreport,xreport);
end;
 

 

Hope this help you.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...