Last post May 04, 2011 10:09 AM by EmilyLeeParsons
May 18, 2010 11:31 PM|eXtension|LINK
I'm having a weird problem:
I have a button in a form that generates a crystal report in a popup window
DataSet ds = new DataSet();
Session["Dataset"] = ds;
Response.Write("<SCRIPT>window.open('PreviewReport.aspx'), 'Visitor Report', 'scrollbars=no, toolbar=no, location=no, directories=no, status=no, menubar=no,width=100%, height=100%', true</SCRIPT>");
And in the the popup aspx page:
protected void Page_Load(object sender, EventArgs e)
DataSet dsVisitor = new DataSet();
ReportDocument rptDoc = new ReportDocument();
MemoryStream oStream = null;
if (Session["Dataset"] != null)
dsVisitor = (DataSet)Session["Dataset"];
rptDoc.Load(Request.PhysicalApplicationPath + "CrystalReport2.rpt");
rptDoc.SummaryInfo.ReportAuthor = User.Identity.Name;
oStream = (MemoryStream)rptDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
Response.Buffer = true;
Response.ContentType = "application/pdf";
catch (Exception ex)
Global.WriteLog(ex, "PreviewReport - Page_Load", "");
rptDoc = null;
Session["Dataset"] = null;
So this works with no problem, it's been deployed onto a client's server and has been running smoothly, for the first few weeks, until they complained that the report can't be displayed. I logged onto the website, and clicked on the View Report button, and
it pops up a blank page instead. No error logs generated despite my try catch blocks.
I did a iisreset, and everything works fine again, until about 3 months later, same problem occured, did a iisreset, works fine. So far this has happened twice, any idea what maybe wrong? It's only the viewing of the crystal report that seems affected, people
are still able to login and out normally of the website.
May 19, 2010 12:49 AMfirstname.lastname@example.org|LINK
Yes, it happened when Crystal Report reached on its maximum limit. there is only way(restart IIS) when you can resolve it..
and check your web config
<location allowOverride="true" inheritInChildApplications="true">
<add key="CrystalImageCleaner-AutoStart" value="true" />
<add key="CrystalImageCleaner-Sleep" value="60000" />
<add key="CrystalImageCleaner-Age" value="120000" />
hope this will help you...
May 19, 2010 01:57 AM|eXtension|LINK
Here's the settings in my web config
<add key="CrystalImageCleaner-AutoStart" value="true"/>
<add key="CrystalImageCleaner-Sleep" value="60000"/>
<add key="CrystalImageCleaner-Age" value="120000"/>
May I know which setting is directly affecting the crystal report? And when you mention "reached its maximum limit" what limit is this? Number of times the report has been viewed? Could you please elaborate a little further? Thanks for the help thus far.
Is there a way such that I don't have to restart IIS?
May 19, 2010 02:05 AMemail@example.com|LINK
Crystal Report is maximum limit is 75 Time.
May 19, 2010 02:07 AMfirstname.lastname@example.org|LINK
public class ReportFactory
protected static Queue reportQueue = new Queue();
protected static ReportClass CreateReport(Type reportClass)
object report = Activator.CreateInstance(reportClass);
public static ReportClass GetReport(Type reportClass)
//75 is my print job limit.
if (reportQueue.Count > 75) ((ReportClass)reportQueue.Dequeue()).Dispose();
you need to implement accourding to your requirement.
May 19, 2010 02:07 AM|eXtension|LINK
75? 75 mins? hours? days?
May 19, 2010 02:13 AMemail@example.com|LINK
after 75 attempt.
May 19, 2010 03:14 AM|eXtension|LINK
May 04, 2011 10:09 AM|EmilyLeeParsons|LINK
Where do I put this code is there a generic name I should use?