Asp.net Crystal报告Sql Server登录失败

Asp.net Crystal报告Sql Server登录失败,asp.net,sql-server,c#-4.0,crystal-reports,Asp.net,Sql Server,C# 4.0,Crystal Reports,我们已经在这个问题上工作了好几天,似乎无法解决它。想知道是否有人能帮上忙。我们有一个.NET应用程序,它使用: CrystalDecisions.CrystalReports.Engine版本:12.0.2000.0 CrystalDecisions.共享版本:12.0.2000.0 我们使用系统DSN连接到部署应用程序的prod Server上的Sql Server。它使用Sql Server版本6.00.6002.18005作为数据源。它很好用。服务器是Windows server Ente

我们已经在这个问题上工作了好几天,似乎无法解决它。想知道是否有人能帮上忙。我们有一个.NET应用程序,它使用:

CrystalDecisions.CrystalReports.Engine版本:12.0.2000.0

CrystalDecisions.共享版本:12.0.2000.0

我们使用系统DSN连接到部署应用程序的prod Server上的Sql Server。它使用Sql Server版本6.00.6002.18005作为数据源。它很好用。服务器是Windows server Enterprise SP2,32位

当我们将其部署到测试盒上时,即Windows Server 2008 R2 64位。系统Dsn Sql Server版本为6.01.7601.17514。我安装了更新:

SAP Crystal Reports,针对Microsoft Visual Studio SP5-MSI的开发人员版本(64位)

然后我们使用: CrystalDecisions.CrystalReports.Engine版本:13.0.2000.0 CrystalDecisions.共享版本:13.0.2000.0

我收到一个登录错误: CrystalDecisions.CrystalReports.Engine.LogOnException:数据库登录失败

以下是我正在使用的.Net代码:

 using (ReportDocument rd = new ReportDocument())
        {
            if (reportType == "Current")
                rd.Load(Server.MapPath("~/bin/Reports/MyLoan_MonthlyBillingStatement_CurrentMonth.rpt"));
            else
                rd.Load(Server.MapPath("~/bin/Reports/MyLoan_MonthlyBillingStatement_History.rpt"));


            DataSourceConnections dsc = rd.DataSourceConnections;


            IConnectionInfo connInfo = dsc[0];
            connInfo.SetLogon("creds here", "creds here");
            rd.SetParameterValue("month", month);
            rd.SetParameterValue("year", year);                

This is where the error hits:               
                oStream =     (MemoryStream)rd.ExportToStream(ExportFormatType.PortableDocFormat);

            string filename = string.Format("{0}_{1}.pdf", loanId, reportDate.ToString("m_d_yyyy"));


            Response.Buffer = true;
            Response.Clear();
            Response.AddHeader("content-disposition", "attachment; filename=" + filename);
            Response.ContentType = "application/pdf";
            Response.BinaryWrite(oStream.ToArray());


            oStream.Flush();
            oStream.Close();
        }
我们已确认该端口已打开,可以远程登录到系统dsn中使用的sql server。另外,我们的Crystal Reports开发人员获取Crystal Report并运行它(独立运行,而不是在.net应用程序中),它连接起来,工作正常。我被难住了。我认为这是crystal reports dll和系统dsn中sql server版本的问题。任何帮助都将不胜感激

谢谢!
Brian

服务器是64位的。我安装了64位Crystal Reports驱动程序更新(我以前安装了32位更新)。在IIS应用程序池中,在“高级设置”下有一个设置“启用32位应用程序”。这是真的。我把它改成了假的。然后它成功了

哪个版本的Visual Studio?我们使用的是VS 2012。您需要使用Crystal 13而不是12。我不知道这是否有帮助,但SAP是这么说的。此外,您还可以尝试使用此工具重置报表连接:(使用试用版)我现在无法对此进行检查,但据我所知,ReportDecoment类有一个方法setdatabaselogoninfo(或类似方法)。您是否尝试使用它而不是连接信息方法?