I am generating a report, but the problem is even though I've supplied credentials, when the form containing the CrystalReport opens up, it still asks me for them, and the worst part is, I don't enter any thing in there, and just click finish, and it loads the report. So, if there is no need for credentials (or whatever) why is it asking me?
Here's the code
private void MainReport_Load(object sender, EventArgs e)
{
var constr = string.Empty;
constr = Application.StartupPath;
if (Generate.bForProjects)
constr = Path.Combine(constr, @"ReportsProjects.rpt");
else
constr = Path.Combine(constr, @"ReportsOther.rpt");
var myConInfo = new CrystalDecisions.Shared.TableLogOnInfo();
reportDocument1.Load(constr);
myConInfo.ConnectionInfo.DatabaseName = "ProjectData.mdb";
myConInfo.ConnectionInfo.ServerName = Application.StartupPath + @"DataProjectData.mdb";
myConInfo.ConnectionInfo.Password = "";
myConInfo.ConnectionInfo.UserID = "";
reportDocument1.Database.Tables[0].ApplyLogOnInfo(myConInfo);
reportDocument1.Refresh();
crystalReportViewer1.ReportSource = reportDocument1;
crystalReportViewer1.Width = this.Width - 50;
crystalReportViewer1.Height = this.Height - 100;
}
When the form loads, this screen pop ups
And, when this comes up, I don't enter anything! That's right! I just click finish and it loads the report perfectly! So, if it doesn't needs anything, why the hel* is it asking me for a login?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…