Hello...
I have seen this several times around the forum and still no working answer that I can find, maybe its something I'm doing not sure. Basically whenever I load a report from an aspx page it asks for aditional information EVEN THOUGH its set in the code behind. Has anyone run into this? Or have any idea why?
This one looked promising, but still the same thing happened:
http://forums.asp.net/t/1206308.aspx/1/10
Here is my code:
protected void getReportDDL_SelectedIndexChanged(object sender, EventArgs e) { ConfigureCrystalReports(); Panel1.Visible = true; } protected void RefreshButton_Click(object sender, EventArgs e) { reportViewer.RefreshReport(); } private void ConfigureCrystalReports() { ReportDocument rpt = new ReportDocument(); string reportPath = Server.MapPath("~/reporting/reports/" + getReportDDL.SelectedValue); rpt.Load(reportPath); ConnectionInfo connectionInfo = new ConnectionInfo(); connectionInfo.DatabaseName = "database"; //changed for security connectionInfo.UserID = "user"; //changed for security connectionInfo.Password = "password"; //changed for security connectionInfo.IntegratedSecurity = false; SetDBLogonForReport(connectionInfo, rpt); reportViewer.ReportSource = rpt; } private void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument) { Tables tables = reportDocument.Database.Tables; foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables) { TableLogOnInfo tableLogonInfo = table.LogOnInfo; tableLogonInfo.ConnectionInfo = connectionInfo; table.ApplyLogOnInfo(tableLogonInfo); } }