I have developed c# desktop app with Ms Access database. I want to use Report Viewer but I have not information how to use it?
Loading
I have developed c# desktop app with Ms Access database. I want to use Report Viewer but I have not information how to use it?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajkiran SwainRank #165 · 14.4K reputationPosted Mar 31, 2023, 11:08 AM EDT
Here are the steps to use the Report Viewer in C# with MS Access database:
Here is an example code snippet:
private void Form1_Load(object sender, EventArgs e) { // Load the data into the DataSet myDataSet1.EnforceConstraints = false; myTableAdapter1.Fill(myDataSet1.myTable); // Set the ReportViewer control's properties reportViewer1.ProcessingMode = ProcessingMode.Local; reportViewer1.LocalReport.ReportPath = "MyReport.rdlc"; reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("MyDataSet_myTable", myDataSet1.Tables["myTable"])); // Refresh the report reportViewer1.RefreshReport(); }Note that in this example, "myDataSet1" is the name of the DataSet, "myTableAdapter1" is the name of the table adapter, and "myTable" is the name of the table in the DataSet that contains the data to display in the report. Replace these names with the appropriate names for your own project.