ISAPI web application hanging if FastReport.Prepar

2019-08-08 17:31发布

问题:

begin
  try
    Raport.PrepareReport(True);
  except on E:Exception do
    raise ;
  end;
//  if Raport.Engine.Run then
  Raport.Export(frxPDF);
end;

When running as an Isapi dll the web application hangs o Raport.PrepareReport(true), when running with a local application server as an .exe application it runs!...
The folder has permissions for total control files for IIS_IUSRS.
Why it would be hanging?

回答1:

I've experienced if there is an unhandled exception in the ISAPI dll the app crashes. You're handling the general exception E: Exception but re-raising it to pass over to a higher level handler. So, if there's no upper level handler, it goes to IIS and this makes IIS to make the app crash, since from the IIS perspective there was an unhandled exception and it has no idea how to handle it.

You should not re-raise the exceptions happening in ISAPI; if you're at the highest handler, just handle it properly. Try write back E.message for example to investigate further to understand what happened and what caused the exception in the first place.



回答2:

i have the same web service and use fast report as report generate and it work like a charm but you should set this properties

      FrxRep.ShowProgress := False;
      FrxRep.ReportOptions.Clear;
      FrxRep.EngineOptions.SilentMode := True;
  frxPDFExport1.ShowProgress    := False;
  frxPDFExport1.ShowDialog      := False;
  frxPDFExport1.OverwritePrompt := False;

be sure that you never use ui relative commands like showmessage or messagedlg and ...



回答3:

The problem was a RichEdit control, that isn´t supported for ISAPI fxReport