Crystal reports crystal报表打印和导出不工作

Crystal reports crystal报表打印和导出不工作,crystal-reports,asp.net-3.5,Crystal Reports,Asp.net 3.5,我是.net开发者。现在我在和crystal report合作。当我打印或导出crystal report然后打印对话框时,当我按print时打开,则不会执行任何打印操作。此打印和导出在fire fox不起作用。只有chrome支持此功能。做这项工作需要额外的代码吗 ------------------------------------更新------------------------------------------ 课堂申报: public partial class EndUser

我是.net开发者。现在我在和crystal report合作。当我打印或导出crystal report然后打印对话框时,当我按print时打开,则不会执行任何打印操作。此打印和导出在fire fox不起作用。只有chrome支持此功能。做这项工作需要额外的代码吗

------------------------------------更新------------------------------------------

课堂申报:

 public partial class EndUser_FS_File_History : System.Web.UI.Page
    {
        ReportDocument reportdocument = null;
        ..........
装载时水晶报告:

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;
以及在页面卸载事件中:

protected void Page_Unload(object sender, EventArgs e)
    {
        if (reportdocument != null)
        {
            reportdocument.Close();
            reportdocument.Dispose();
        }
        GC.Collect();
    }
仍然存在大量记录的问题:

    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
有几个步骤:

在Pageload之前,将报表声明为

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();
}

如果出现打印对话框,则打印有问题,因为至少报告显示了该对话框,在某些情况下,javascript会导致问题,并且打印对话框根本不可见。另外一个问题是为最大作业限制而发布的。当我关闭时,dispose,gc.collect抛出未找到对象引用…我在过去几个小时内阅读了与我的问题相同的问题。是的,直到加载报告时才会出现此问题,您尝试处理相同的问题,尝试将dispose等放在Page_UnLoad方法中。这将为您提供一个WorkID,您可以尝试上面更新的部分。此处rpt=new ReportDocument();在这里,您将初始化您创建的报告。是的,它可以很好地处理少量记录。但在处理大量记录时仍然出现错误,因此更新了问题。reportdocument.Clone();替换为Clone by close();是的,我纠正它。我调试源代码,然后发现加载报告失败。在reportdocument.Load(Server.MapPath(@“~/Admin/UserReport.rpt”);