Create RDLC Reports in ASP.Net Web Application

In this article, we will learn how to create a RDLC Report in ASP.Net using Visual Studio Report Designer. For demonstration purposes, I have created a database (named Sample) and created a table tbl_Employee in it. The following is the table design for creating tbl_Employee.
 

Add some records to tbl_Employee. I have attached the script of the database along with the source code for download.
 
Let's Begin.
 
1. Create an Empty ASP.NET Website and Add a Web Form(Default.aspx) to it.

2.
Drop ScriptManager and ReportViewer controls from the Toolbox onto the Default.aspx Web form.
 
 

3. Click on ReportViewer Tasks and then click on Design a new report. 
 
 
 
You will then then see the Data Source Configuration Wizard.
 
4. Click on New Connection.
 
 
Then select Microsoft SQL Server as the Data Source then click on "Continue".
 
 
 
5. Provide the Server Name and select your database from the drop-down list.
 
 

Then click on "OK".
 
6. Provide a name to your connection String and click on "Next".
 
 

7. Select the database object you want in your dataset and provide a meaningful name for the DataSet. Click on "Finish".
 
 

8. Now the Report Wizard opens. Select the DataSource as Dataset (in other words EmployeeDS) that you created in the previous step then click on "Next".
 
 

9. Drag and drop the required fields from the Available fields into the Values section.
 
 

Click on "Next" because we didn't want to display a subtotal in our report.
 
 

10.
Choose a style for your report then click on "Finish". I have selected Slate as the style for my report.
 
 

You will then see the report named Report1.rdlc created.

 

11.
Now go to Default.aspx (where you have dropped the ReportViewer control) and than click on ReportViewer Tasks and select Report1.rdlc.
 
 

12.
Build and run the application. 
 
 

Click on the Save Button in the report and save the entire report in PDF/Excel/Word format.

I hope you like it. Thanks.


Similar Articles