【问题标题】:The maximum report processing jobs limit crystal report ,this is due to my code mistake?最大报表处理作业限制水晶报表,这是由于我的代码错误?
【发布时间】:2016-06-09 06:13:23
【问题描述】:

我正在使用 Visual Studio 2012 的 Microsoft Crystal Report 开发人员版本。在我的报告工作正常之前,但是当我在生产中部署我的报告时,之后我收到错误,系统管理员配置的最大报告处理作业限制为在水晶报告和c->windows->temp文件夹中。rpt文件没有被删除。我怎样才能在临时文件夹中删除它。我的代码有什么错误。我正在使用以下代码。我该如何摆脱这个错误。我也阅读了各种论坛,但我没有找到解决方案

public partial class myClass : System.Web.UI.Page
    {
ReportDocument crystalReport = new ReportDocument();

protected void Page_Init(object sender, EventArgs e)
        {


crystalReport.Load(Server.MapPath("~/path/mainrep.rpt"));
                    crystalReport.SetDataSource(dtblstdtmtbl);
int exportFormatFlags = (int)(CrystalDecisions.Shared.ViewerExportFormats.PdfFormat);
                    cviewer.AllowedExportFormats = exportFormatFlags;
                    cviewer.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None;
                    cviewer.HasToggleGroupTreeButton = false;
                    cviewer.HasToggleParameterPanelButton = false;
                    cviewer.DisplayGroupTree = false;
                    cviewer.EnableDrillDown = false;

                    cviewer.ReportSource = crystalReport;
   }




protected void Page_Unload(object sender, EventArgs e)
        {
            CloseReports(crystalReport); 
            crystalReport.Close();
            crystalReport.Dispose();
            cviewer.Dispose();
            crystalReport = null;
            cviewer = null;
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }//end page unload 


        private void CloseReports(ReportDocument reportDocument)
        {
            Sections sections = reportDocument.ReportDefinition.Sections;
            foreach (Section section in sections)
            {
                ReportObjects reportObjects = section.ReportObjects;
                foreach (ReportObject reportObject in reportObjects)
                {
                    if (reportObject.Kind == ReportObjectKind.SubreportObject)
                    {
                        SubreportObject subreportObject = (SubreportObject)reportObject;
                        ReportDocument subReportDocument = subreportObject.OpenSubreport(subreportObject.SubreportName);
                        subReportDocument.Close();
                    }
                }
            }
            reportDocument.Close();
        }
}

【问题讨论】:

  • 你是如何在生产中部署的?
  • 我构建项目并部署

标签: c# asp.net vb.net reporting-services crystal-reports


【解决方案1】:

这是水晶报表中一个非常常见的错误,当它给出以下消息时。

“已达到系统管理员配置的最大报表处理作业限制。”

这实际上意味着已达到 Crystal Report 打印作业限制,您应该通过增加注册表中的作业限制来解决此问题。这个问题的根本原因是垃圾收集器(GC)在其收集过程中无法清除报告文档的引用,它只能清除报告查看器。

HKEY_LOCAL_MACHINE\SOFTWARE\CRYSTAL DECISIONS\10.0\REPORT APPLICATION SERVER\SERVER\PrintJobLimit

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-29
    相关资源
    最近更新 更多