每个水晶报告查看数据库登录promt [英] database login promt on every crystal report viewing
问题描述
我已经为VS 2010安装了SAPcrystal报告,我正在努力解决我面临的问题。每次我运行表单时都会出现数据库登录promt。用户名和密码。我不知道用户名和密码,因为我在Visual Studio菜单中使用了内置的基于服务的数据库。并成功创建了水晶报告,但在运行表格后,每次都会出现数据库登录。我怎么能避免这种情况。我是Visual Studio的新用户,我不知道如何登录,因为我没有指定用户名和密码我使用基于服务的数据库
您应该提供凭据,同时预览详细信息,这里是CR中动态登录的代码
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos(); // SAI-7F029C17AAA\SA
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
表格CrTables;
ConnectionInfo Cr = new ConnectionInfo();
Cr.ServerName = YASH-3B614EC33F; // 此处您应提供服务器名称
// < span class =code-comment> SAI-7F029C17AAA;
// YASH- 3B614EC33F
Cr.DatabaseName = Sai; // 这里你应该提供你的数据库名称
Cr.UserID = sa; // 在这里应提供您的用户名
Cr.Password = 12345; <跨度 class =code-comment> // 这里你应该提供你的密码
CrTables = Ip.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
crtableLogoninfo = CrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = Cr;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
}
crystalReportViewer1.ReportSource = Ip;
帮助链接: - http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-dynamic- login.htm [ ^ ]
I have installed the SAPcrystal reports for VS 2010 and I''m working on winform the problem I am facing is. every time I run the form a database login promt comes. For username and password. I don''t know the username and password as I''ve used inbuilt serviced based database from the Visual Studio menu. and created the crystal report successfully but here after running the form the database login appears each time. How can I avoid that. I''m a new user to Visual Studio and I don''t know how to log in as I didn''t specified the username and password I used the service based database
You should do provide the credentials while previewing the details here is the code for Dynamic login in CR
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();//SAI-7F029C17AAA\SA TableLogOnInfo crtableLogoninfo = new TableLogOnInfo(); Tables CrTables; ConnectionInfo Cr = new ConnectionInfo(); Cr.ServerName = "YASH-3B614EC33F";//here you should provide your Server Name //SAI-7F029C17AAA"; //YASH-3B614EC33F Cr.DatabaseName = "Sai";//here you should provide your Database Name Cr.UserID = "sa";//here you should provide your User Name Cr.Password = "12345";//here you should provide your Password CrTables = Ip.Database.Tables; foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables) { crtableLogoninfo = CrTable.LogOnInfo; crtableLogoninfo.ConnectionInfo = Cr; CrTable.ApplyLogOnInfo(crtableLogoninfo); } crystalReportViewer1.ReportSource = Ip;
Help Link:-http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-dynamic-login.htm[^]
这篇关于每个水晶报告查看数据库登录promt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!