Question

I'm .net developer. now I'm working with crystal report. when I'm printing or exporting crystal report then print dialog open when I press Print, then no print operation occurs. This Print and Export not working at fire fox. only chrome support this functions. Is there extra code required for do this job.

---------------------------updated-----------------------------------------

at class declaration :

 public partial class EndUser_FS_File_History : System.Web.UI.Page
    {
        ReportDocument reportdocument = null;
        ..........

at load crystal report:

reportdocument = new ReportDocument();
                    string connectionString = ConfigurationManager.ConnectionStrings["FileSystemConnectionString"].ConnectionString;
                    SqlConnectionStringBuilder SConn = new SqlConnectionStringBuilder(connectionString);
                    reportdocument.Load(Server.MapPath(@"~/Admin/UserReport.rpt"));
                    reportdocument.SetDataSource(myDataSet);
                    reportdocument.DataSourceConnections[0].SetConnection(SConn.DataSource, SConn.InitialCatalog, SConn.UserID, SConn.Password);
                    CrystalReportViewer1.ReportSource = reportdocument;

and at Page_Unload event:

protected void Page_Unload(object sender, EventArgs e)
    {
        if (reportdocument != null)
        {
            reportdocument.Close();
            reportdocument.Dispose();
        }
        GC.Collect();
    }

still problem occurs with large no of records:

    The maximum report processing jobs limit configured by your system administrator has been reached.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: The maximum report processing jobs limit configured by your system administrator has been reached.

Source Error:


Line 782:                    string connectionString = ConfigurationManager.ConnectionStrings["FileSystemConnectionString"].ConnectionString;
Line 783:                    SqlConnectionStringBuilder SConn = new SqlConnectionStringBuilder(connectionString);
Line 784:                    reportdocument.Load(Server.MapPath(@"~/Admin/UserReport.rpt"));
Line 785:                    reportdocument.SetDataSource(myDataSet);
Line 786:                    reportdocument.DataSourceConnections[0].SetConnection(SConn.DataSource, SConn.InitialCatalog, SConn.UserID, SConn.Password);


Source File: f:\EasyWeb\Admin\User_Management.aspx.cs    Line: 784

Stack Trace:


[COMException (0x80041016): The maximum report processing jobs limit configured by your system administrator has been reached.]
   CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +144
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +526

[CrystalReportsException: Load report failed.]
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +621
   CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +1969
   CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +186
   Admin_User_Management.lbut_print_Click(Object sender, EventArgs e) in f:\EasyWeb\Admin\User_Management.aspx.cs:784
   System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +79
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Was it helpful?

Solution

There are few steps:

Before Pageload, declare the report as

ReportDocument rpt = null;
protected void Page_Load(object sender, EventArgs e)
{
  try
     {
     rpt= new ReportName; //this is the name of your report
     // do all the logic here
     }
  catch()
     {
     }
}

protected void Page_Unload(object sender, EventArgs e)
{
  if(rpt!=null)
   {
    rpt.Close();
    rpt.Dispose();
   }
  GC.Collect();
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top