【发布时间】: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