I am using Crystal Report and I get an error:
The maximum report processing jobs limit configured by your system administrator has been reached
I searched stackoverflow and found 2 topics:
But when I do as topic 1, change PrintJobLimit = -1, the error will happen anyway.
When I do as topic 2, I have not tested it yet, because my report should move between pages. To proceed, I have to save the report in the session:
ReportDocument reportDocument = null;
protected override void OnInit(EventArgs e)
{
if (IsPostBack && Session["reportDocument"] != null)
{
reportDocument = (ReportDocument)Session["reportDocument"];
crvReport.ReportSource = reportDocument;
}
}
protected void Page_Load(object sender, EventArgs e)
{
reportDocument = new ReportDocument();
Session["reportDocument"] = reportDocument;
crvReport.ReportSource = reportDocument;
reportDocument.Load(Server.MapPath("~/files/Users.rpt"));
reportDocument.SetDatabaseLogon("******", "******", "*.*.*.*", "*****");
reportDocument.VerifyDatabase();
crvReport.DataBind();
}
So, I cannot destroy reportDocument in unload because Session ["reportDocument"] will change to null
protected void crvReport_Unload(object sender, EventArgs e)
{
if (reportDocument != null)
{
reportDocument.Close();
reportDocument.Dispose();
reportDocument = null;
GC.Collect();
}
}
, , ?