水晶报表数据库登录时,转移到服务器

本文关键字:转移 服务器 报表 数据库 登录 水晶 | 更新日期: 2023-09-27 18:17:17

如何解决这个问题?

当我通过我的本地机器运行我的系统时,它不需要任何Log On to Database认证,我可以直接看到我的报告。但是,当我将我的系统转移到服务器以便其他人可以远程访问它时,它需要一个登录数据库,甚至信息是正确的。这里是我的。cs代码

public partial class PrintPreview : System.Web.UI.Page
{
    ReportDocument crPrint = new ReportDocument();
    protected void Page_Init(object sender, EventArgs e)
    {
        if (Session["ID"] == null)
        {
            Response.Redirect("../Account/LogIn.aspx");
        }
        else
        {
            string i = Session["tID"].ToString();
            //CrystalReportViewer1.Visible = true;
            string reportPath = Server.MapPath("../CrystalReport2.rpt");
            crPrint.Load(reportPath);
            crPrint.SetDatabaseLogon("sa", "Pr0cess", "172.20.3.24", "PO");
            crPrint.SetParameterValue("MOSEFNo", i);
            CrystalReportViewer1.ReportSource = crPrint;
        }

    }

}

页面总是需要数据库登录时,我把它转移到数据库,为什么?

,当我转移文件夹到IIS,"asp_client"文件夹总是空的,我如何解决这个问题?谢谢!

水晶报表数据库登录时,转移到服务器

问题是,当你重新加载页面会话["ID"]将重置为NULL。尝试检查会话状态到状态服务器模式