Whenever I run the crystal report form.. it asks the Username and password..
How to avoid this one?...
Because, If I run my project in another system that time also it takes my SQL server name... So that kindly tell me the coding for me..
or
How to resolve this one instead of Crystal report?
Thanks in Advance...
Regards,
Jiteendra SampathiraoPosted Aug 2, 2011, 5:01 AM
you need to write the configureCRYSTALREPORTmethod in your Event: pageload or button click event or something else...
private void configureCRYSTALREPORT()
{
ConnectionInfo myConnectionInfo = new ConnectionInfo();
myConnectionInfo.DatabaseName = "DatabserName";
myConnectionInfo.UserID = "UID";
myConnectionInfo.Password = "PWD";
setDBLOGONforREPORT(myConnectionInfo);
}
private void setDBLOGONforREPORT(ConnectionInfo myconnectioninfo)
{
TableLogOnInfos mytableloginfos = new TableLogOnInfos();
mytableloginfos = CrystalReportViewer1.LogOnInfo;
foreach (TableLogOnInfo myTableLogOnInfo in mytableloginfos) {
myTableLogOnInfo.ConnectionInfo = myconnectioninfo;
}
}
i hope it help you..........