// 4. Add the data source ReportDataSource rds = new ReportDataSource("SalesData", dt); reportViewer1.LocalReport.DataSources.Clear(); reportViewer1.LocalReport.DataSources.Add(rds);
Open the RDLC file. Go to View → Report Data. Right-click DataSets → Add Dataset. Set the DataSource to MyDataSet and the available dataset to SalesData . microsoft report viewer
// 1. Fetch your data (could be from SQL, JSON, or CSV) DataTable dt = GetSalesDataFromDatabase(); or CSV) DataTable dt = GetSalesDataFromDatabase()
Right-click project → Add → New Item → Report. Design your table using the drag-and-drop designer (Tablix, Textbox, Image). microsoft report viewer