|
-
Apr 12th, 2009, 11:38 PM
#1
Thread Starter
Hyperactive Member
avoid password while opening Crystal Report
Dear
I am calling crystal report on page load.while opening crystal report, it is asking database information.
I have used TableLogOnInfo object.
private TableLogOnInfo LogInfo = new TableLogOnInfo();
private void SetLogonInfo()
{
try
{
LogInfo.ConnectionInfo.ServerName = "servername";
LogInfo.ConnectionInfo.UserID="userid";
LogInfo.ConnectionInfo.Password = "pwd";
LogInfo.ConnectionInfo.DatabaseName="dbname";
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void SetReport()
{
ReportDocument rpt = new ReportDocument();
CrystalReport2 O_showList = new CrystalReport2();
O_showList.Database.Tables[0].ApplyLogOnInfo(LogInfo);
rpt.Load(@"D:\CrystalReport2.rpt");
rpt.Database.Tables[0].SetDataSource(dsEmployee);
crystalReportViewer1.ReportSource = rpt;
crystalReportViewer1.Zoom(1);
}
what is the problem.
help is hoghly apprciated
PPCC
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|