Crystal Reports 间歇性错误“无法提交请求以进行后台处理。”

发布于 2024-08-19 18:36:02 字数 1367 浏览 15 评论 0原文

我们在带有 .NET Framework 3.5 SP1 的 Windows Server 2008 上运行 Crystal Reports。

我见过许多导致一般错误“无法提交请求进行后台处理”的原因。在其他论坛上,但是由于特定报告的特定格式问题,它们往往是持久且可重复的,仅影响单个报告。
我们在下面的堆栈跟踪中间歇性地看到此错误。

  • 它影响我们拥有的多个不同的报告。
  • 它对某一特定报告的影响比对其他报告的影响更频繁。
  • 一旦报告受到影响,相同的错误通常会在大约同一时间出现在多个报告中,例如。接下来的 10 分钟。
  • 使用相同参数运行的相同报表在再次运行(不久之后)时可能会起作用,或者应用程序可能需要重新启动才能成功重新运行报表。

这些报告以前都可以正常工作,没有任何问题。服务器或代码似乎没有明显的变化导致此错误。所有背后的代码都是 VB.NET,

我们在测试环境中很难重现它,并且升级到最新版本的 Crystal 也没有任何帮助。 如果您能为解决此问题提供任何帮助或建议,我们将不胜感激。


"The request could not be submitted for background processing."  
  at CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.ReplaceConnection(Object oldConnection, Object newConnection, Object parameterFields, Object crDBOptionUseDefault)  
  at CrystalDecisions.CrystalReports.Engine.Table.SetDataSource(Object val, Type type)  
  at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)  
--- End of inner exception stack trace ---  
  at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)  
  at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)  
  at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataSet dataSet)  
  at "USER CODE"

We are running Crystal Reports on a Windows Server 2008 with .NET framework 3.5 SP1.

I have seen many causes of the general error "The request could not be submitted for background processing." on other forums, however they tend to be persistent and repeatable affecting just a single report due to a specific formatting issue with a specific report.
We are seeing this error with the below stack trace, intermittently.

  • It affects multiple different reports we have.
  • It affects one particular report more frequently than other reports.
  • Once a report is affected the same error will often appear in multiple reports at approximately the same time eg. for the next 10 minutes.
  • The same report run with the same parameters may work when run again (soon after) or the application may need restarting before the report can be successfully re run.

These reports all worked previously without issue. No change in server or code seems apparent which would have precipitated this error. All code behind for this is VB.NET

We have had difficulty reproducing it in test environments and upgrading to the latest version of Crystal has not helped at all.
Any help or suggestions that you might be able to make to resolve this issue would be appreciated.


"The request could not be submitted for background processing."  
  at CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.ReplaceConnection(Object oldConnection, Object newConnection, Object parameterFields, Object crDBOptionUseDefault)  
  at CrystalDecisions.CrystalReports.Engine.Table.SetDataSource(Object val, Type type)  
  at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)  
--- End of inner exception stack trace ---  
  at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)  
  at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)  
  at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataSet dataSet)  
  at "USER CODE"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

我的鱼塘能养鲲 2024-08-26 18:36:02

很多天后,我终于发现了问题的根源是什么,如果您在报告中包含 jpg 图像

问题是VS2008或更高版本的CR,无法处理CMYK模式的jpg文件。 CR只能处理RGB模式的jpg文件。

有趣的是,较低版本的 CR(VS2003 附带的版本)可以处理任何类型的 jpg 文件。谢谢,水晶。

After many days, finally I discovered what is the root of problem, in case you are including jpg images in your report.

The thing is that CR for VS2008 or later versions, can’t handle jpg files in CMYK mode. CR only can handle jpg files in RGB mode.

It’s funny that lower versions of CR (the one that came with VS2003) could handle any kind of jpg files. Thanks, Crystal.

枕花眠 2024-08-26 18:36:02

对我来说,问题在于 Windows 的 TEMP 文件夹中生成的临时 Crystal Report。 Crystal 报表引擎在循环处理时可以生成的临时 Crystal 报表的数量是有限的。要么由于 C 盘内存不足而导致 Temp 文件夹中的空间耗尽,要么达到报告限制,之后单次运行水晶报告无法进一步导出。它将给出所讨论的错误。

对我来说,这个问题在每处理 500 份报告时就会重复出现(例如,我生成报告一年,并使用我的应用程序将它们逐一导出到系统文件夹)。

解决方案很简单。 导出临时 .rpt Crystal Report 文件后,务必将其关闭并丢弃



    for i as integer=0 to reportcount -1
        Dim rpt as New MyCrystalReport
        Dim filename as String = "MyReport" & i & ".Pdf"
        //Query the DB obtain the dataset then set the datasource to the report
        ...
        //Export the report
       rpt.ExportToDiskCrystalDecisions.Shared.ExportFormatType.PortableDocFormat,fileName)
        rpt.Close()
        rpt.Dispose()
    next


For me the issue was with the Temporary Crystal Report that gets generated in the TEMP folder in Windows. There is a limit to the number of Temporary Crystal Reports that can be generated by Crystal report engine while processing it in a loop. Either the space in Temp folder runs out due to low memory in C drive or the limit of reports is reached after which in one single run crystal report cannot export further. It will give the error mentioned in question.

For me this issue was recurring at every 500 reports that were processed (I was generating the reports say, for a year and exporting them to a system folder one by one using my application)

The solution is simple. Always close and dispose the temporary .rpt Crystal Report file after exporting it .



    for i as integer=0 to reportcount -1
        Dim rpt as New MyCrystalReport
        Dim filename as String = "MyReport" & i & ".Pdf"
        //Query the DB obtain the dataset then set the datasource to the report
        ...
        //Export the report
       rpt.ExportToDiskCrystalDecisions.Shared.ExportFormatType.PortableDocFormat,fileName)
        rpt.Close()
        rpt.Dispose()
    next


眼泪都笑了 2024-08-26 18:36:02

隔离报告生成代码。

我们的最终解决方案是采用生成报告的代码并将其移至自己的独立服务中。然后,我们原来的服务使用相关参数和 Crystal RPT 文件调用我们的新 Crystal 服务。这显然是一个成本高昂的解决方案,因为它涉及修改所有报告生成代码以调用 Crystal 服务。 Crystal 服务未显示该错误。除此之外,代码没有改变,所以我们只能推测错误的原因是水晶报表引擎和我们的应用程序中的环境之间的一些交互。

Isolate the report generation code.

Our final resolution was to take the code that was generating the report and move it into its own isolated service. Our original service then calls our new Crystal service with the relevant parameters and Crystal RPT file. This is obviously a costly solution as it involves modifying all report generation code to call the Crystal service instead. The Crystal service does not exhibit the error. The code had not changed besides that, so we can only presume the cause of the error was some interaction of the Crystal reports engine and the environment within our application.

终遇你 2024-08-26 18:36:02

报表对象是否有可能在服务器内存中泄漏?我遇到了类似的情况,其中报表对象被存储到会话对象中,因此当用户在页面之间导航时不需要重新加载报表。但是,当用户完成报告后,该对象仍保留在会话中,并且当会话被服务器销毁时,该对象没有被正确清理。我必须在 global.asax 的 Session_End 事件中添加一些代码来查找报告对象并对其调用 dispose 方法。

事实上,这种情况间歇性地出现,但随后影响所有报告大约 10 分钟,这让我认为这可能与会话相关。在我的情况下,服务器达到了可以在服务器上(在内存中)创建的报告数量的限制,因为它们没有被释放。症状和你的很相似。

希望这有帮助!

Is there a chance the report object is leaked in the server's memory? I ran into a similar case where the report object was being stored into a Session object, so the report didn't need to get reloaded as the user navigated between pages. However, when the user was done with the report, the object remained in the Session, and wasn't cleaned up properly when the Session was destroyed by the server. I had to add a bit of code in the Session_End event in global.asax to find the report object and call the dispose method on it.

The fact that this appears intermittently but then affects all reports for a matter of 10 minutes makes me think it could be session-related. In my situation the server reached a limit on the number of reports that could be created on the server (in memory) because they weren't being released. The symptoms were similar to yours.

Hope this helps!

三月梨花 2024-08-26 18:36:02

试试这个:如果您在水晶报表(页眉、页脚或任何部分)留下任何空白,请抑制它。就这样。我遇到了这个问题,我用这种方法解决了。

Try this: If you left any blank space at crystal report(header,footer or any sections) suppress it. that's all. I had this problem and i fixed this way.

丘比特射中我 2024-08-26 18:36:02

我也遇到过这样的问题,我发现有照片的专栏正在创造这个问题。解决方法是将照片(SQL Server 中的数据类型 Image)从 .NET 数据集转换为字节,然后将其另存为位图。之后,该相同的 BMP 文件可以转换为字节并替换为所识别行的适当列。这样空间就大大减少了,导出报表文档和数据表后就得到了妥善处理。

I too have come across such issue, where I figured out the Column having Photographs was creating the issue. The way out was to convert the photograph (Datatype Image in SQL Server) from .NET Data set to byte and then save it as Bitmap. After , that this same BMP file can be converted to bytes and replaced to appropriate column of the identified row. By this the space reduced to a great extend and then after exporting the Report document and Datatable was disposed properly.

无声静候 2024-08-26 18:36:02

这是由于 Crystal Report Viewer 10 中的一个错误导致的,该错误不兼容查看尺寸为 1600 像素(宽)x 1082 像素(高)的图像。

谢谢

This is due to a bug in Crystal Report Viewer 10 which is not compatible with viewing images with a size of 1600 pixels (width) x 1082 pixels (height).

Thank you

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文