具有登录参数的水晶报告中的数据集 [英] dataset in crystal report with logon parameters

查看:81
本文介绍了具有登录参数的水晶报告中的数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在的代码:

My Present Code:

cryRpt.Load(Application.StartupPath + "\\VideoBill.rpt");
crconnection.ServerName = Common.DefaultDatabasePath;//(server name coming from a common class)
crconnection.DatabaseName = DatabaseName;//(database name defined in the top of the page)
crconnection.UserID = "Admin";
crconnection.Password = "Password";
crtables = cryRpt.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table Crtable in crtables)

                        {
                            crtableinfo = Crtable.LogOnInfo;
                            crtableinfo.ConnectionInfo = crconnection;
                            Crtable.ApplyLogOnInfo(crtableinfo);
                        }
crystalReportViewer1.ReportSource = cryRpt;
crystalReportViewer1.Refresh();





以前的工作代码:



Previously working code :

cryRpt.Load(Application.StartupPath + "\\VideoBill.rpt");
cryRpt.SetDatabaseLogon("Admin", "Password");
cryRpt.SetDataSource(dsreport.Tables[0]);
crystalReportViewer1.ReportSource = cryRpt;





dsreport正在填充表单初始化期间调用的不同数据集中的值。 />


我的查询是:在我以前的代码中,我在水晶报表中只得到一个值,而我添加了当前代码和登录参数...我得到的值水晶报告中的整个表格,即所有条目都在水晶报告中,我希望只有我的dsreport数据集值应该填写在水晶报告中...所以我应该在当前编码中做什么更改,因为之前的编码是我没有在客户端系统上工作,所以我在这个表单中添加了登录参数代码,以避免客户端系统中的登录错误。



dsreport is filling the value from different dataset called during initialization of the form.

My query is : in my previous code i was getting only one value inside the crystal report while i added the current code with logon parameters... i am getting the value of the entire table in the crystal report i.e. all the entries are coming in crystal report and i want that only my dsreport dataset value should be filled in the crystal report... so what changes should i do in my current coding as the previous coding is not working on the client system so i added the logon parameters code in this form to avoid the logon error in the client system.????

推荐答案

AFAIK没有您的代码问题,您做得正确。这里有一些建议

0)您是否能够使用相同的登录详细信息连接数据库?打开数据库&使用相同的登录deatils连接。

如果不工作?然后更改代码中的登录详细信息

如果有效?如果是,请转到下一步。

1)打开报告,执行验证数据库&保存报告。确保数据库和数据库中的表(&字段)相同。报告。

现在执行此代码。

等待

2)为什么以下行在你的代码中?

AFAIK there's no issue with your code, you did correctly. Here few suggestions
0) Are you able to connect the database with the same login details? Open database & connect using the same login deatils.
If not working? then change the login details in your code
If working? If yes goto next step.
1) Open your report, do "Verify Database" & save the report. Make sure tables(& fields) are identical on both database & report.
Now execute this code.
Wait
2) Why the following line in your code?
cryRpt.SetDataSource(dsreport.Tables[0]);



你正在使用 PULL方法那你为什么要把数据集带到这里?查看本教程页面。

C#Crystal Reports动态登录参数 [ ^ ]

3)如果要过滤记录,请使用参数字段

C#Crystal Reports字符串参数 [ ^ ]

C#Crystal Reports整数参数 [ ^ ]


You're using PULL method so why you're bringing dataset here? Check this tutorial page.
C# Crystal Reports Dynamic Logon parameters[^]
3) If you want to filter the records then use parameter-fields.
C# Crystal Reports String parameter[^]
C# Crystal Reports Integer parameter[^]


这篇关于具有登录参数的水晶报告中的数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆