Monday, January 21, 2019

How to Add and Design Report Viewer (RDLC) in ASP.Net

How to Add and Design Report Viewer (RDLC) in ASP.Net

In ASP project, if you want to view report, then you have to use ReportViewer or Crystal Report. In this post, SKOTechLearn will explain the steps to Add and Design a ReportViewer (RDLC) in ASP Dot Net.

Reading to this tutorial, there is short UI process to understand about report in ASP.
RDLC ReportViewer Process in ASP.Net
RDLC ReportViewer Quick Process
Here we will understand Report process in Two ways.
 Add Report Viewer on Existing Form.
 Add Report Viewer on other Web Form.

Now, we start step by step procedure for understand.

Step1. Add Web Form and RDLC:
First add a web Form in Project then add Report in your application like following steps.
  • Right Click on Project from Solution Explorer
  • Find “Add” option and move cursor on it
  • Next to reach “New Item…” and click on it.
  • “Add New Items” Screen will appear
  • In this screen, left side Pane contain "Installed Templates”.
  • Find “Reporting” Option and select on it.
  • In “Reporting”, select “Report” option
  • Then Click on “Add” button.
The process is described in bellow given figure.
ReportViewer Control Adding Process
Report (RDLC)Adding Process
When you complete the process of adding report on project.  “Report1.rdlc” will be add on project. It will seen inside Solution Explorer screen.

Learn How to Add Bullet List in ASP.Net with Easy Tips?

This is the way to add RDLC. There are another process and some more steps to view the report.

Note: Report1.rdlc” need the platform where it display the designed template. So, you have to use “ReportViewer” control.

Step2. Add ReportViewer with Settings:
After that open “WebForm”. In your Form choose location wherever you want to add “ReportViewer” control. For adding this control on Form, follow the process given bellow:

  • Move cursor on “Toolbox” screen to the left side of project.
  • Find “Reporting” header and click on it.
  • It will show two options (“Pointer” and “ReportViewer”) control options.
  • Select “ReportViewer” option and drag on the Form’s Location.
  • Increase or Decrease this control size according to need.

ReportViewer with Setting
Control with Settings
After that, click on “Tasks” option to this control as describe in above image. It will show ‘Choose Report’ combo, select report RDLC which you have create in previous step. Now this control will call that particular RDLC.

Add Menu with Sub-Menu in ASP.Net.

Step3. Design RDLC:
Now, let’s design RDLC. For designing process when you right click there will be an option present, with name "Insert". Insert some control in RDLC like TextBox, Rectangle etc. And design it according to requirement.
Insert control on RDLC form
Insert control on RDLC Form
After this process run your application. But, when you debug application, there is error appearing on Web browser.

Report Viewer Web.UI.ScriptManager Error in ASP.Net (Solution)

 Error during run application:
Error during application run
Error during application run

Why this error occur?

Lets read error. It says about missing UI.ScriptManager. So, we have to add “ScriptManager” in webform.

Where to find and How to add ScriptManager in ASP Form?

There is way to solve above question.

Step4. Add ScriptManager:
  • Find “AJAX Extensions” header  from “Toolbox” screen.
  • In this header find “ScriptManager”.
  • Drag and drop “ScriptManager” on Form.

Add ScriptManager in ASP.Net
Add ScriptManager
After inserting this web control, it will reduce the error, which appear during run-time.

How to Design Header, Footer and Sidebar in ASP.Net?

Step5. Run Web Form:
Now run Web Form. You will find that there is no error and the output will looks like bellow.
Report Output in ASP.Net
Report Output
So, this post final conclusion is that you have to remember about add “RDLC”, “ReportViewer” web control, “ScriptManager” web control and Inset controls into RDLC for creating or designing of Report in ASP dot Net by SKOTechLearn Tips.

Also Learn:

What is Master Page and How to Implement in ASP.Net?