We have an ASP.NET C# 4.5 Application on a Windows Server 2012 server. This is a new server for this application and we encountered this max job report error late into the first day of use. We have CR XI in place on the server.
We put a couple of lines in place to help cleanup the files. Does anyone have any suggestions on the code attached to help our cause?
case "TravelerRpt":
NewTravelerRpt oTraveler = new NewTravelerRpt();
oTraveler.SetDataSource(Session["RptData"]);
CrystalReportViewer1.ReportSource = oTraveler;
try
{
byte[] byteArray = null;
var xStream = oTraveler.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
byteArray = new byte[xStream.Length];
xStream.Read(byteArray, 0, Convert.ToInt32(xStream.Length - 1));
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.BinaryWrite(byteArray);
Response.Flush();
Response.Close();
CrystalReportViewer1.Visible = true;
}
catch (Exception ex)
{
this.txtError.Text = ex.ToString();
this.txtError.Visible = true;
}
finally
{
oTraveler.Dispose();
Session["ReportData"] = null;
}
break;