How bind a rdlc report to report viewer

xiao_ichi

Member
Joined
Mar 4, 2008
Messages
11
Programming Experience
1-3
Hi, can anyone tell me how to apply rdlc report to report viewer? (it's not crystall report)
 
Code hasn't been tested but it should be close enough to give you an idea
VB.NET:
Dim rptView As ReportViewer =  New ReportViewer()
rptView.ProcessingMode = ProcessingMode.Local
Dim report As LocalReport = rptView.LocalReport
report.ReportPath = "Report1.rdlc"

'Code to load your dataset
'...

Me.rptView.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("DataSourceName", ds.Tables(0)))

The alternative would be to choose the smart tag from the report viewer control and choose your rdlc file from the choose report ddl.
 
Back
Top