How to Create RDLC Report Step by Step Example in using C# and

Now a days for reporting purposes we have a lots of choice. RDLC report is one of the most popular reporting engine for developers. Using RDLC report you can easily represent data to the end user. You can also export the report in Excel, PDF & MS Word format. Print functionality also in built in this ReportViewer control. This a very basic RDLC report tutorial for beginners. In my next articles I will also provide more example on RDLC report. Here I am providing “Creating RDLC report Step by Step in Asp.Net C# & VB.Net“. Hope it will help you.

In this example I am using below SQL Server Table:
Create RDLC Report Wizard 12

Steps to Create RDLC Report:
1. Add your connection string in Web.Config file like below:

    <add name="DBConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=TESTDB;Trusted_Connection=yes;" providerName="System.Data.SqlClient"/>
    <!--<add name="BONConnection" connectionString="Data;Initial Catalog=DBNAME;User Id=UserName;Password=YourPassword;" providerName="System.Data.SqlClient" />-->

Note: If you use windows authentication then use the first key. Otherwise use second key line. Update server name, Database name, User name, Password as per your settings. I will describe the necessity later.

2. Add a ReportViewer from Reporting Tab under Toolbox:
Create RDLC Report Wizard 1

3. Now go to the Design View of your page. Select the ReportViewer control. Click on smart menu and click on “Design a new report”:
Create RDLC Report Wizard 2

4. Now choose your Data Connection:
Create RDLC Report Wizard 3
Note: The wizard automatically fetch the connection string from your Web.Config file.

5. Now click on Next and select the “Student” table:
Create RDLC Report Wizard 4

6. Click Finish, Click Next. An “Arrange Fields” page will popup. Move all columns from “Available Fields” to “Values” Field. Click on “Roll” column and uncheck the column:
Create RDLC Report Wizard 5

7. Now the “Values” Field will look like below:
Create RDLC Report Wizard 6

8. Now click Next, click Next. Now choose your report style from left pane:
Create RDLC Report Wizard 7

9. Now click “Finish”.

10. Now open your page in design view. Click on ReportViewer control. Click on smart menu. Select “Report1.rdlc” from “Choose Report” DropDown List:
Create RDLC Report Wizard 8

11. Now run the project. Oops you will get the error “The Report Viewer Web Control requires a System.Web.UI.ScriptManager on the web form”:
Create RDLC Report Wizard 9

12. To resolve the error add a “ScriptManager” in your page:
Create RDLC Report Wizard 10

13. Now run the project. Hope you will get a report like below:
Create RDLC Report Wizard 11

Start RDLC report. It’s simply amazing.

Download Code Example C#        Download Code Example VB.Net

Posted in .Net,, C#, Database, RDLC Report, SQL Server, VB.Net

Leave a Reply

Your email address will not be published. Required fields are marked *