[英]Report RDLC not showing data
I have create a report rdlc and use report viewer to view this report .But data not showing,just table header shown. 我已经创建了报告rdlc,并使用报告查看器来查看此报告。但是数据未显示,仅显示了表头。 please help me to resolve this issue.
请帮助我解决此问题。
ReportViewer1.LocalReport.ReportPath = "C:\Users\Dell\Documents\Visual Studio 2012\HRMS\NewHRMS\AllEmpProfiles.rdlc"
Dim params(0) As Microsoft.Reporting.WinForms.ReportParameter
params(0) = New Microsoft.Reporting.WinForms.ReportParameter("deptName", "Finance")
Me.ReportViewer1.LocalReport.SetParameters(params)
Me.ReportViewer1.RefreshReport()
Here is sample code showing how I usually configure a report. 这是显示我通常如何配置报告的示例代码。 The line you are missing is the
DataSources.Add
: 您缺少的行是
DataSources.Add
:
ReportViewer1.LocalReport.ReportPath = "<your rdlc>"
ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DataSet1", <your data>))
ReportViewer1.LocalReport.SetParameters(New ReportParameter("deptName", "Finance"))
ReportViewer1.RefreshReport()
"DataSet1"
corresponds to a name inside your rdlc file. "DataSet1"
对应于rdlc文件中的名称。
<your data>
corresponds to data that you provide. <your data>
对应于您提供的数据。 It can be a DataTable, IEnumerable, BindingSource, etc. 它可以是DataTable,IEnumerable,BindingSource等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.