【问题标题】:Clear crystal reports temp files清除水晶报告临时文件
【发布时间】:2015-06-25 05:28:15
【问题描述】:

Crystal 报告临时文件,删除 c# 形式的关闭按钮的代码。 如何清除报告缓存? 提前致谢。

【问题讨论】:

    标签: c# crystal-reports


    【解决方案1】:

    这个链接对我很有帮助。试试吧

    http://www.pedautreppe.com/post/Crystal-Reports-generates-temporary-files.aspx

        private void Page_Unload(object sender, EventArgs e) 
        { 
            CloseReports(cr); 
            cr.Dispose(); 
            CrystalReportViewer1.Dispose(); 
            CrystalReportViewer1 = null; 
    
        } 
    
    
        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(); 
        } 
    

    全局打开报表,在页面内全局关闭。会有帮助的

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-05
      相关资源
      最近更新 更多