TableLogOnInfo oTblLogOnInfo = new TableLogOnInfo();
ConnectionInfo oConInfo = new ConnectionInfo();
oConInfo.ServerName = ConfigurationManager.AppSettings[sReportDataSource];
oConInfo.UserID = ConfigurationManager.AppSettings[sReportUserId ];
oConInfo.Password = ConfigurationManager.AppSettings[sReportPwd ];
oTblLogOnInfo.ConnectionInfo = oConInfo;
oTblLogOnInfos.Add(oTblLogOnInfo);
// end of the login code..
this.GLTxnReportViewer.LogOnInfo = oTblLogOnInfos;
So as shown in the above code, i will be getting the d/b datasource, userid and pwd from the config file, construct the tableloginInfos and set it to the crystal report viewer logoninfo.
My ultimate purpose is, i should be able to change the logon info dynamically when i change it in config file. i should not go to the cmc and modify the d/b parameters for that report.
The report works when the d/b info which i used while publishing the report matches with the config d/b info. If the d/b info differs, then it is throwing the logon screen for the report. Which i dont want.
So, I am thinking the setting the logon info to the viewer is not working..
I have gone thru the forums, where they will instantiate the report document object, loop thru the tables and set the logon for each of them. but in my case, i dont load the report, but i get the infoobject from the query....