Sunday, December 23, 2012

Create and dpeloy SSRS Report

What is *.rdl and *.rdlc report?

*.rdlc files means client reports which we can create through the Visual Studio. But *.rdl files mean the reports that we can design using BIDS and published to reporting server. But *.rdlc files can not published to the reporting server directly. In this post I have have described how to create *.rdl report and access it from the ASP.net web application.

Create the Report

Create a table called Student and it's design should be like below. Enter some data to the table.
Open BIDS. Create Report Server Project like below.
In the solution go to Reports folder and Add New Report.
This will open a wizard which can create a report. We need to provide the data source connection for the report.By clicking on the edit button we can provide the connection.
In the next page, by using Query Builder we can create the relevant SQL statements and also we can run those SQL statements and test the correct data has retrieved. 
After add the query string, in the next few pages we can design the report like; a tabular report, the details that we are going to show, table style and report name. After finished the report wizard, the design view of the report will be displayed. We can do further designing works in there. Also we can have a preview of the report that we created. This will retrieve the actual data from the data base.
Now the report design is finalized.

Deploy *.rdl report in to Report Server

Open reporting services configuration manager and connect to the reporting server.
Go to Report Manager URL.

In there create a new folder and upload the report in to that folder. U can upload more reports to that folder and each one will be displayed. If you click on that particular report, then you can have a nice view of that report.

Access the report using ASP.net Web Application

Create ASP.Net web forms application. Add as aspx page called Reports. From the tool box , add Report Viewer and Script Manager to the page.
In the Reporting Services Configuration Manager go to Web Service URL.
In the code behind file of the Reports web form, add following code.
ServerReport.ReportPath is the path of the report that we can access through the Reports Web Service. If you go to the Reports Web Service you can see the reports that you have deployed to the reporting server, like below.
Now run the ASP.net web application and go to Reports page. Finally you can access the deployed report.

No comments:

Post a Comment