当我们在.NET 3.5中运行报表时,没有问题。当我们转向.NET 4.5并将Crystal升级到这些版本时:
我们不断收到此错误:
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)
已达到系统管理员配置的最大报告处理作业限制。
at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
在代码中调用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部分
<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>
更改注册表中的PrintJobLimit = -1
并未解决问题。
我们是否需要购买水晶报告的完整版本,或者还有其他因素导致此问题?
答案 0 :(得分:1)
我们遇到了类似的问题。在我们的例子中,我们在服务器中安装了两个版本的水晶报告。不知何故,安装在服务器中的较新的Crystal Report版本似乎不起作用。当我们使用report.Load()
时,它会永远悬空。这就是我们解决的问题。
Web.config&gt;运行部分。
<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>
答案 1 :(得分:0)
使用带有过滤器的 procmon.exe 来查找错误...在我的情况下我丢失了2天,错误是:访问被拒绝到某个文件夹: