【问题标题】:Crystal Report with IIS带有 IIS 的水晶报表
【发布时间】:2014-12-31 03:20:56
【问题描述】:

我在 Visual Studio 2008 中使用水晶报表。在我的项目中,我有一个带有内部子报表的报表。我使用水晶报表查看器来显示我的报表。当我在 Visual Studio 调试模式下运行网站时,它的所有工作都非常好,我的报告显示正确。

但是当我在 IIS(版本 8.5,Windows 10 Dev Preview)上设置我的网站(也在开发 PC 上)时,我的报告没有显示,它要求主报告和子报告之间的参数链接。

谁能告诉我什么是问题以及如何解决这个问题? 非常感谢。

这是我在报告查看器 webcontrol 上的代码

protected void Page_Load(object sender, EventArgs e)
{
    int xid = 0;
    if (!IsPostBack)
    {
        if (!string.IsNullOrEmpty(Request.Params["preUrl"].ToString()))
        {
            previousUrl = Request.Params["preUrl"].ToString();
        }
    }
    if (!string.IsNullOrEmpty(Request.Params["pxid"].ToString()))
    {
        xid = Convert.ToInt16(Request.Params["pxid"].ToString());
    }
    GetDatasource(xid);
    theReport = new ReportDocument();
    theReport.Load(Server.MapPath("~/Report/Test.rpt"));
    theReport.SetDataSource(ds);
    CrystalReportViewer1.ReportSource = theReport;
    firstload = 1;
}

protected int firstload
{
    get { return (int?)ViewState["firstload"] ?? 0; }
    set { ViewState["firstload"] = value; }
}
protected void GetDatasource(int xid)
{
    if (firstload == 0)
    {
        //dsReportSanxuat ds = new dsReportSanxuat();
        SqlDataAdapter sAdp = new SqlDataAdapter();
        SqlDataAdapter sAdpDu = new SqlDataAdapter();
        ds = new dsReportSanxuat();
        sAdp = oreport.GetReportSanxuatAdp(xid);
        sAdpDu = oreport.GetReportSanxuatDuAdp(xid);
        sAdp.Fill(ds, "dtReportSanxuat");
        sAdpDu.Fill(ds, "dtReportDu");
        firstload = 1;
    }
}
protected dsReportSanxuat ds
{
    get {
        return (dsReportSanxuat)ViewState["ds"];
    }
    set
    {
        ViewState["ds"] = value;

    }
}

【问题讨论】:

    标签: c# asp.net iis crystal-reports


    【解决方案1】:

    谢谢大家。我的问题解决了。如果您需要回答,我的 PC 是 64 位基本操作系统,我刚刚在 IIS 应用程序池上“启用 32 位”就可以了。

    【讨论】:

    • 非常感谢您!我需要为本地客户端安装执行此操作。
    猜你喜欢
    • 2010-11-07
    • 2020-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-08
    相关资源
    最近更新 更多