[英]Report RDLC not showing data
我已經創建了報告rdlc,並使用報告查看器來查看此報告。但是數據未顯示,僅顯示了表頭。 請幫助我解決此問題。
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()
這是顯示我通常如何配置報告的示例代碼。 您缺少的行是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"
對應於rdlc文件中的名稱。
<your data>
對應於您提供的數據。 它可以是DataTable,IEnumerable,BindingSource等。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.