使用WPF的ReportDataSource名称和值 [英] ReportDataSource name and value using WPF
问题描述
我在WPF窗口中尝试使用WindowsFormsHost打开RDLC报告时遇到以下问题.打开报告时,将出现一个没有数据的报告标题.该查询没有参数,并且我已经多次预览了数据集中的数据.
我已经看到了很多尝试来解释ReportDataSource.Name和ReportDataSource.value的含义的尝试,但是对于我来说,尚不清楚它们分别是什么意思.除了下面列出的内容以外,我什么都无法执行.
谢谢-
I have the following in a WPF window trying to open an RDLC report using a WindowsFormsHost. When the report opens there is a report header with no data. The query has no parameters and I have previewed the data in the data set many times.
I have seen many attempts to explain the meanings of ReportDataSource.Name and ReportDataSource.value but it is not yet clear to me what each is supposed to mean. I have not been able to implement anything but that which is listed below.
Thanks -
string reportPath = "C:\\Dev\\2010\\2010_BoxingAdmin\\BoxingAdmin\\BoxingAdmin\\Report1.rdlc";
string ds = "DEVELOPMENT;Initial Catalog=Boxing;Integrated Security=True";
ReportDataSource rds = new ReportDataSource("DataSet1", ds);
ReportViewer reportViewer = new ReportViewer();
reportViewer.ProcessingMode = ProcessingMode.Local;
reportViewer.LocalReport.ReportPath = reportPath;
reportViewer.LocalReport.DataSources.Add(rds);
windowsFormsHost1.Child = reportViewer;
reportViewer.RefreshReport();
Reply
Reply
推荐答案
我也犯了同样的错误,就是您在这里所做的.
这里的第二个参数只是您的连接字符串.它实际上不是数据源.但是我不知道第一个参数.现在我仍然找到那个.
http://www.codeproject.com/Questions/178783/Error- On-Microsoft-Report-in-wpf.aspx [ ^ ]
I also do the same mistake, what you made here.
The second parameter here is just your connection string. It''s not actually a data source. But I don''t know about first parameter. Now i am still finding that.
http://www.codeproject.com/Questions/178783/Error-On-Microsoft-Report-in-wpf.aspx[^]
这篇关于使用WPF的ReportDataSource名称和值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!