Crystal报告丢失其数据库凭据要求数据库登录 [英] Crystal report loses its database credentials asks for Database Login
本文介绍了Crystal报告丢失其数据库凭据要求数据库登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
自从我学会使用水晶报表以来,我一直面临的问题是(在客户机上部署之后),Crystal报告要求数据库登录...特别是它显示一个褪色的空白代替数据库:文本框。即使我在调用水晶报告之前提供数据库信息..使用这样的功能......但仍然给我同样的麻烦。请帮忙...
HI everyone,
Ever since I learnt to use crystal reports, I have been facing the problem that (after deployment on client machine), Crystal report asks for Database Login... specially it shows a faded blank in place of Database: textbox. Even I supply the database information before calling the crystal report.. using a function like this... but still It is giving me the same trouble. Please help...
private void SetLogon(ReportDocument rptDocumentObject, string strReportPathtoLoad)
{
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
Tables CrTables;
rptDocumentObject.Load(strReportPathtoLoad);
crConnectionInfo.ServerName = ConnectionModule.IP; // giving Servername
crConnectionInfo.DatabaseName = ConnectionModule.DBName; //Giving Databasename
crConnectionInfo.UserID = ConnectionModule.Uid; //Giving Login ID
crConnectionInfo.Password = ConnectionModule.Pwd; //Giving Password
CrTables = rptDocumentObject.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
crtableLogoninfo = CrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = crConnectionInfo;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
}
}
推荐答案
为EnableDatabaseLogonPrompt属性 [ ^ ]
移动你的代码从Page_Load()
到Page_Init()
过去的回答 [ ^ ]
同时检查 this one [ ^ ]以便进行额外的练习。
Set False for EnableDatabaseLogonPrompt Property[^]
Move your code fromPage_Load()
toPage_Init()
Past answer[^]
Also check this one[^] for additional work out.
这篇关于Crystal报告丢失其数据库凭据要求数据库登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文