1

當我們在.NET 3.5中運行報表時,沒有任何問題。當我們搬到了.NET 4.5和升級的水晶到這些版本:加載報告失敗。在CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()

我們不斷收到此錯誤:

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

PrintJobLimit = -1(使其沒有系統內存限制等限制)不適用於VS 13的CR 13 ...而是嘗試將其設置爲1000 - 10000之類的值,具體取決於CR引擎上預期的負載。 –

回答

1

我們有類似的問題。在我們的例子中,我們在服務器中安裝了兩個水晶報告版本。不知何故,安裝在服務器上的新版Crystal Report版本似乎沒有工作。當我們使用report.Load()它永遠懸掛。這就是我們解決的方法。

  • 添加DLL版本(的 部署)的bin文件夾中刪除物理水晶報表的DLL重定向在web.config中使用舊版本

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>