在ASP.NET中的Crystal Report中提示“登录”窗口

时间:2015-01-12 05:47:01

标签: mysql asp.net crystal-reports

  1. 我正在使用VS 2012
  2. MySql
  3. MySQL的连接器-ODBC-5.3.4-win32.msi

    4.在Windows Server 2008上运行_crystal报告运行时。

  4. 我的Web应用程序在我的开发系统中运行正常,但在部署到Windows Server 2008之后,Crystal报告会询问有关登录信息的附加信息,如下面的屏幕所示。 enter image description here

    使用以下代码。

        string databaseName = "hr";
        string serverName = "192.168.137.6";
        string userID = "co";
        string pass = "password";
    protected void btn_search_Click(object sender, EventArgs e)
        {
            CrystalReportViewer1.Visible = true;
    
            ReportDocument reportDocument = new ReportDocument();
            TableLogOnInfo TabLogOnInfo = new TableLogOnInfo();
            TableLogOnInfos  TabInfos = new TableLogOnInfos();
            ConnectionInfo conInfo = new ConnectionInfo();
            string reportPath = Server.MapPath(@"~/GeneralEmpReports/ddoWiseEmpRpt.rpt");
            string ddoCode = tbx_ddoCode.Text.ToUpper();
            reportDocument.Load(reportPath);
            reportDocument.SetParameterValue("D", ddoCode);
    
    
            conInfo.ServerName = serverName;
            conInfo.DatabaseName = databaseName;
            conInfo.UserID = userID;
            conInfo.Password = pass;
            conInfo.AllowCustomConnection = false;
            conInfo.IntegratedSecurity = false;
    
            foreach (CrystalDecisions.CrystalReports.Engine.Table T in reportDocument.Database.Tables)
            {
                TabLogOnInfo = T.LogOnInfo;
                TabLogOnInfo.ConnectionInfo = conInfo;
                T.ApplyLogOnInfo(TabLogOnInfo);
            }
    
            CrystalReportViewer1.ReportSource = reportDocument;
            CrystalReportViewer1.ReuseParameterValuesOnRefresh = true;
            CrystalReportViewer1.AutoDataBind = true;
            CrystalReportViewer1.Zoom(80);
    
    
        }
    

    我不知道如何解决这个问题。

0 个答案:

没有答案