ISAPI web application hanging if FastReport.PrepareReport is called

China☆狼群 提交于 2019-12-11 13:18:27

问题


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



来源:https://stackoverflow.com/questions/27607416/isapi-web-application-hanging-if-fastreport-preparereport-is-called

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!