隐藏Crystal Report数据库登录页面 [英] Hide Crystal Report Database login page
本文介绍了隐藏Crystal Report数据库登录页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
即使在代码中提供了凭据后,Crystal Report数据库登录页面仍然会弹出.我的代码如下
Hi All,
The crystal report database login page still popup even after providing the credentials in the code.My code is as below
OpenFileDialog file = new OpenFileDialog();
file.Filter = "Report Files (*.rpt)|*.rpt";
if (file.ShowDialog() == DialogResult.OK)
{
report_file = (string)file.FileName;
}
//setDatabaseSettings();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
Tables CrTables;
ReportDoc.Load(report_file);
crConnectionInfo.ServerName = "XYZPC\\XYZ";
crConnectionInfo.DatabaseName = "RME01";
crConnectionInfo.UserID = "sa";
object pwd = "123";
crConnectionInfo.Password.Equals(pwd);
CrTables = ReportDoc.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
crtableLogoninfo = CrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = crConnectionInfo;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
}
crystalReportViewer1.ReportSource = ReportDoc;
crystalReportViewer1.Refresh();
请帮助
Please help
推荐答案
这是一个常见的问题伴侣……你去了
C#Crystal Reports动态登录参数 [了解Crystal Reports中的登录失败错误 [ ^ ]
使用具有.NET的Crystal Reports对数据库登录错误进行故障排除 [ ^ ]
It''s a frequent question mate......Here you go
C# Crystal Reports Dynamic Logon parameters[^]
Free attachment
Understanding the Login Failed Error in Crystal Reports[^]
Troubleshooting Database Login Errors using Crystal Reports with .NET[^]
这篇关于隐藏Crystal Report数据库登录页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文