I am developing a simple web app that has 3 reports created on VS 2013, for some reason those reports run fine from developer mode, but when I publish the website they give me "Database logon failed" Error. What could be causing this? VS is installed on the same server that I am publishing the reports. I have created a local admin user with exactly the same info as the ODBC connection logon user for IIS authentication, but still no luck.
below is my code:
public partial class OpenWOsWebForm : System.Web.UI.Page
{
ConnectionInfo EPAKconnectionInfo = new ConnectionInfo();
protected void SetConnectionInfo()
{
EPAKconnectionInfo.ServerName = ConfigurationManager.AppSettings["EPAK_SERVER_NAME"];
EPAKconnectionInfo.UserID = ConfigurationManager.AppSettings["EPAK_USER_NAME"];
EPAKconnectionInfo.Password = ConfigurationManager.AppSettings["EPAK_PASSWORD"];
}
private void Page_Init(object sender, EventArgs e)
{
ReportDocument report = new ReportDocument();
report.Load("C:\\Delray Beach\\Delray Beach\\Reports\\OpenWOsReport.rpt");
SetConnectionInfo();
TableLogOnInfo crTableLogoninfo = new TableLogOnInfo();
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in report.Database.Tables)
{
crTableLogoninfo = CrTable.LogOnInfo;
crTableLogoninfo.ConnectionInfo = EPAKconnectionInfo;
CrTable.ApplyLogOnInfo(crTableLogoninfo);
}
foreach (ReportDocument subreport in report.Subreports)
{
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in subreport.Database.Tables)
{
crTableLogoninfo = CrTable.LogOnInfo;
crTableLogoninfo.ConnectionInfo = EPAKconnectionInfo;
CrTable.ApplyLogOnInfo(crTableLogoninfo);
}
}
OpenWOsViewer.ReportSource = report;
OpenWOsViewer.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None;
}
}
Thanks