vb.net 加载报告失败。在 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22761527/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 17:15:45  来源:igfitidea点击:

Load report failed. at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()

asp.netvb.netcrystal-reportscrystal-reports-xicrystal-reports-2010

提问by 3355307

When we were running reports in .NET 3.5 there was no problem. As we moved to .NET 4.5 and upgraded Crystal to these versions:

当我们在 .NET 3.5 中运行报告时,没有问题。当我们迁移到 .NET 4.5 并将 Crystal 升级到这些版本时:

We keep getting this error:

我们不断收到此错误:

Load report failed.
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
at AppSuite.WebApp.CrystalViewer.LoadReport(Boolean bRefresh)
at AppSuite.WebApp.CrystalViewer.Page_Load(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

The maximum report processing jobs limit configured by your system administrator has been reached.

已达到系统管理员配置的最大报告处理作业限制。

at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()

The dispose method is called in the code so i don't think that's causing problem:

在代码中调用了 dispose 方法,所以我认为这不会导致问题:

Private oReportDocument As New ReportDocument

Private Sub LoadReport(ByVal bRefresh As Boolean)

    'Get the report data
    Dim dtReport As DataTable = ReportHelper.GetReportData(Me.CacheKey, bRefresh)

    'If there is data to display bind it to the Crystal Viewer
    If dtReport.Rows.Count > 0 Then
        With oReportDocument
            .Load(ReportHelper.GetReportPath(Me.ReportId))
            .SetDataSource(dtReport)
            .PrintOptions.PaperSize = Common.Settings.CrystalPaperSize
        End With
        crvMain.ReportSource = oReportDocument
    Else
        'Hide the controls and display a message if there is no data
        crvMain.Visible = False
        btnPDF.Visible = False
        btnExcel.Visible = False
        lblNoResults.Visible = True
    End If

End Sub

Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
    oReportDocument.Dispose()
End Sub

ASPX part

ASPX 部分

<CR:CRYSTALREPORTVIEWER id="crvMain"  HasPrintButton="False" HasExportButton="False" 
    runat="server" ToolPanelView="None" BorderColor="Transparent" BorderStyle="None"
    Height="50px" Width="350px" HasRefreshButton="True" HasCrystalLogo="False" 
    HasToggleGroupTreeButton="False" meta:resourcekey="crvMainResource1"></CR:CRYSTALREPORTVIEWER>

Changing the PrintJobLimit = -1in registry did not solve the problem.

更改PrintJobLimit = -1注册表并没有解决问题。

Do we need to buy the full version of crystal reports or there is something else that's causing this issue?

我们是否需要购买完整版的水晶报告,或者还有其他原因导致了这个问题?

回答by JenonD

We had a similar issue. In our case we had two versions of crystal reports installed in the server. Somehow the newer Crystal Report version installed in the server doesn't seems to be working. When we use report.Load()it was hanging forever. This is how we solved.

我们有一个类似的问题。在我们的例子中,我们在服务器中安装了两个版本的水晶报表。不知何故,安装在服务器中的较新的 Crystal Report 版本似乎不起作用。当我们使用report.Load()它时,它永远挂着。我们就是这样解决的。

  • Delete physical Crystal Report dlls from the bin folder (of the deployment)
  • Added dll version redirect in the web.config to use the old version
  • 从(部署的)bin 文件夹中删除物理 Crystal Report dll
  • 在 web.config 中添加了 dll 版本重定向以使用旧版本

Web.config > runtime section.

Web.config > 运行时部分。

<runtime>
  <assemblyBinding>
    <dependentAssembly>
     <assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" publicKeyToken="692fbea5521e1304"/>
     <bindingRedirect oldVersion="13.0.2000.0" newVersion="10.5.3700.0"/>
    </dependentAssembly>

     <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.CrystalReports.Shared" publicKeyToken="692fbea5521e1304"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="10.5.3700.0"/>
    </dependentAssembly>

     <dependentAssembly>
       <assemblyIdentity name="CrystalDecisions.Shared" publicKeyToken="692fbea5521e1304"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="10.5.3700.0"/>
    </dependentAssembly>
  </assemblyBinding>
</runtime>

回答by Hernaldo Gonzalez

Use procmon.exewith filters works to find the error...In my case I lost 2 days and the error was: Access Denied to some folder:

使用带有过滤器的procmon.exe可以找到错误...在我的情况下,我丢失了 2 天,错误是:访问拒绝某些文件夹:

https://stackoverflow.com/a/41942720/1536197

https://stackoverflow.com/a/41942720/1536197