vs2005内置的水晶报表访问时出现密码提示框
个人感觉是数据源的问题,因为我也找了网上的例子,写了数据库连接登陆的类,不过就是跳那个提示框,让我添密码。用户名是有的,数据源中的密码没有,哪位高手给指导一下,一般这些问题数据源都如何来弄。
------解决方案--------------------參考這個公用打印函數
//Common Print Dialog Information Set
public static void PrintRpt(ReportClass rptView)
{
Common.FrmPrint printDlg = new FrmPrint();
TableLogOnInfo logonInfo = new TableLogOnInfo();
logonInfo.ConnectionInfo.ServerName = "server ";
logonInfo.ConnectionInfo.DatabaseName = "db ";
logonInfo.ConnectionInfo.UserID = "sa ";
logonInfo.ConnectionInfo.Password = "123 ";
rptView.Database.Tables[0].ApplyLogOnInfo(logonInfo);
printDlg.rptView.ReportSource = rptView;
printDlg.Show();
}