Introduction
In this article we will generate a report from SQL Server database using Report wizard and display it in ASP.NET using MicrosoftReportViewer control.
Step 1:
Image may be NSFW.
Clik here to view.
Create a new ASP.NET Web Application
Step 2:
Image may be NSFW.
Clik here to view.
Add a new Report Wizard using Right Click on project and Add -> New Item. Click on Add button. Click Next on Report Wizard welcome screen
Step 3:
Image may be NSFW.
Clik here to view.
Choose your Data Connection and click on Next.
Click Next which will save connection string on the Web.config file
Step 4:
Image may be NSFW.
Clik here to view.
Select tables and columns to display on report. Then click on Finish
Step 5:
Image may be NSFW.
Clik here to view.
Select the Data Source(authors in this case) and click on Next
Step 6:
Image may be NSFW.
Clik here to view.
Select the Report Type, Tabular or Matrix and click on Next
Click Next on “Design the Table” wizard
Step 7:
Image may be NSFW.
Clik here to view.
Choose the table layout, Stepped or Block and click on Next
Step 8:
Image may be NSFW.
Clik here to view.
Choose a table style from the left and click on Next and then Finish
Step 9:
We have generated our report and added in the project. Our next step is to display this report in a web form. To display report we will use MicrosoftReportViewer control.
Drag a MicrosoftReportViewer control to the Default.aspx from the Toolbox. It is found under Reporting tab. Select ReportViewer Tasks button (Little arrow in Top-Right of the ReportViewer) and select “Report1.rdls” from the “Choose Report” dropdown.
Image may be NSFW.
Clik here to view.
Final Output:
Image may be NSFW.
Clik here to view.
Filed under: .Net, ASP.NET Image may be NSFW.
Clik here to view.
