I have create a report rdlc and use report viewer to view this report .But data not showing,just table header shown. 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
:
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.
<your data>
corresponds to data that you provide. It can be a DataTable, IEnumerable, BindingSource, etc.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.