【问题标题】:Crystal Reports Goes Blank, Need IIS to RestartCrystal Reports 出现空白,需要重新启动 IIS
【发布时间】:2017-07-31 09:56:06
【问题描述】:

我已在“windows server 2010”中发布了我的 Web 应用程序。我所有的水晶报表都运行良好。

问题是:几个小时后,所有水晶报告显示空白页。当我重新启动 IIS 时,它又开始工作了。

水晶报表.aspx

<%@ Page Title="" Language="C#" MasterPageFile="~/ASPNetForms/SiteMaster.Master" AutoEventWireup="true" CodeBehind="CrystalForm.aspx.cs" Inherits="WebApplication.ASPNetForms.CrystalForm" %>

CrystalForm.aspx.cs

protected void Page_Init(object sender, EventArgs e)
    {
        try
        {
            string strReportName = Session["ReportName"].ToString();
            var rptSource = Session["rptSource"];
            var xmlPath = Session["xmlPath"];

            ReportDocument rd = new ReportDocument();

            string strRptPath = Server.MapPath("~/") + "XML\\" + strReportName;
            rd.Load(strRptPath); //Loading Report
            rd.SetDataSource(rptSource);

            CrystalReportViewer1.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None;
            CrystalReportViewer1.HasCrystalLogo = false;
            CrystalReportViewer1.ReportSource = rd;
        }
        catch (Exception ex)
        {
            string exception = ex.Message;
        }
    }

【问题讨论】:

    标签: asp.net asp.net-mvc-4 crystal-reports


    【解决方案1】:

    终于可以解决页面卸载关闭和处理报表文件的问题了。

    protected void Page_UnLoad(object sender, EventArgs e)
        {
            rd.Close();
            rd.Dispose();
        }
    

    【讨论】:

      猜你喜欢
      • 2013-11-12
      • 1970-01-01
      • 2011-06-01
      • 2012-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多