We have started receiving load report failed error again in one of our production servers. This problem occurred some months ago and on that time we found that in the code reportdocument.close method was not called so we added into the code and set the print job limit to 400 and problem went away for couple of months but now it has started again.
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()
This is our code
Private m_oReportDocument As New ReportDocument
Private ReadOnly Property ReportId() As Integer
Get
Return Integer.Parse(Me.Request.QueryString("r"))
End Get
End Property
Private Property CacheKey() As String
Get
Dim sCacheKey As String = Me.Request.QueryString("ck")
If sCacheKey Is Nothing OrElse sCacheKey.Length = 0 Then
sCacheKey = CStr(Me.ViewState("CacheKey"))
End If
Return sCacheKey
End Get
Set(ByVal Value As String)
Me.ViewState("CacheKey") = Value
End Set
End Property
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Me.IsPostBack Then
LoadReport()
End If
End Sub
Private Sub btnPDF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPDF.Click
'Redirect to the PDF Viewer passing it the ReportId and CacheKey
Me.Response.Redirect(String.Format(ReportHelper.PDFViewerURL, Me.ReportId, Me.CacheKey))
End Sub
Private Sub btnRTF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRTF.Click
'Redirect to the RTF Viewer passing it the ReportId and CacheKey
Me.Response.Redirect(String.Format(ReportHelper.RTFViewerURL, Me.ReportId, Me.CacheKey))
End Sub
Private Sub btnExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExcel.Click
'Redirect to the Excel Viewer passing it the ReportId and CacheKey
Me.Response.Redirect(String.Format(ReportHelper.ExcelViewerURL, Me.ReportId, Me.CacheKey))
End Sub
Private Sub crvMain_Navigate(ByVal source As Object, ByVal e As CrystalDecisions.Web.NavigateEventArgs) Handles crvMain.Navigate
LoadReport()
End Sub
Private Sub crvMain_Search(ByVal source As Object, ByVal e As CrystalDecisions.Web.SearchEventArgs) Handles crvMain.Search
LoadReport()
End Sub
Private Sub crvMain_ViewZoom(ByVal source As Object, ByVal e As CrystalDecisions.Web.ZoomEventArgs) Handles crvMain.ViewZoom
LoadReport()
End Sub
Private Sub crvMain_Drill(ByVal source As Object, ByVal e As CrystalDecisions.Web.DrillEventArgs) Handles crvMain.Drill
LoadReport()
End Sub
Private Sub crvMain_DrillDownSubreport(ByVal source As Object, ByVal e As CrystalDecisions.Web.DrillSubreportEventArgs) Handles crvMain.DrillDownSubreport
LoadReport()
End Sub
Private Sub crvMain_ReportRefresh(ByVal source As Object, ByVal e As CrystalDecisions.Web.ViewerEventArgs) Handles crvMain.ReportRefresh
LoadReport(True)
End Sub
Private Sub LoadReport()
LoadReport(False)
End Sub
Private Sub LoadReport(ByVal bRefresh As Boolean)
If Common.CouldBeMultiDB(User.Identity.Name) AndAlso TypedSession.OverrideCompany.Length > 0 Then
Common.Settings.OverrideCompany = TypedSession.OverrideCompany
End If
'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 m_oReportDocument
.Load(ReportHelper.GetReportPath(Me.ReportId))
.SetDataSource(dtReport)
.PrintOptions.PaperSize = Common.Settings.CrystalPaperSize
End With
crvMain.ReportSource = m_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
m_oReportDocument.Close()
m_oReportDocument.Dispose()
End Sub
Can any one tell if we are doing anything wrong in our code. We don't use sub reports any more however we do use paging and some of our reports have 200+ pages. Also is it possible to find out print job limit and concurrent users by writing some code.
Thanks