Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2161

Maximum report processing job limit for crystal reports

$
0
0

Hi,

 

We have been using report viewer 13.0.15 with a few reports and have the problem of "Processing Job Limit" resulting in "Load Report Failed". I have been through several forums and tried a few implementations which I have documented below.

 

I have placed two scenarios below, one which results in "Load report failed" after running a few reports (Scenario 1) and Scenario 2 which runs without the "Load Report Failed" issue

 

The problem with scenario 2 is that the report data is extracted on every page navigation.

Scenario 1 is great for large reports as it does only one DB call, but results in the "Processing Job Limit" issue.

 

Scenario 1 - Using session object to store the Report Document and bind to the report viewer on a popup page

In this case, we are building the ReportDocument and placing this into session. We then open up a popup form which contains the CrystalReportViewer and bind the viewer to the session object.

 

This scenario allows us to make one DB call to bind the ReportDocument and place this into session. On the POPUP form, we get the ReportDocument from session and bind it to the viewer. This method results in the Processing Job Limit (Load report failed) issue after we run several reports. The workaround is to recycle the application pool, however, the error will be back again after a few reports are run.

 

Code for Popup form with Crystal Report Viewer. Note: We cannot dispose the ReportDocument using this method.

protected void Page_Init(object sender, EventArgs e)

        {

            if (Request.QueryString["ReportID"] != null)

            {

                string reportID = Request.QueryString["ReportID"].ToString();

                ReportDocument report = new ReportDocument();

 

                report = (ReportDocument)Session[reportID];

 

                crvReport.ReportSource = report;

                crvReport.DataBind();

            }

        }

 

Scenario 2 - Build the ReportDocument on every postback and dispose on Page_Unoad

This scenario runs without causing the Processing Job Limit (Load report failed), however, this method will make a DB call on page navigation.

 

protected void Page_Init(object sender, EventArgs e)

        {

                string reportID = Request.QueryString["ReportID"].ToString();

                if (Request.QueryString["ReportID"] != null)

                {

                    rpt = (ReporterEntity)Session["ReportDefinition"];

                    rpv = (ReportParameterValues)Session["ReportParameterValues"];

                    string reportPath = rpt.Reportname;

                    report.Load(reportPath);

                    SetParameterValues();

 

                    //Connect to database and bind

                    SetReportConnection(report);

                    crvReport.ReportSource = report;

                    crvReport.DataBind();

                }

        }


protected void Page_Unload(object sender, EventArgs e)

        {

            if (report != null)

            {

                report.Close();

                report.Dispose();

                GC.Collect();

            }

        }

 

Is there a way to use the session object to store the report document (Scenatio 1) but prevent database calls when the user navigates through multiple pages?


Viewing all articles
Browse latest Browse all 2161

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>