Monday, April 30, 2012


Simple steps for developing SSRS Report
Steps to build Simple SSRS Report:
1) Create New Project with choosing Business Intelligence Projects\ReportServerProject.

2) By opening this Simple Report Project, click on Solution Explorer View. You are able to see following screen.

3) Now Right click on Shared Data Sources folder and choose Add New Data Source tab to add the Data Source for report.Write the appropriate connection string like following:

You can choose the database connection string from Edit Button displayed on above screen. Pressing Edit Button will redirect you on the following screen.

Choose the appropriate data base name and server name and if Test Connection is Succeed
then Press OK button. This will reflect to Shared Data Source connection string. It will be
automatically changed as per you selected in Connection Tab.
5)
Now turns to add report to our Report Server Project. Let’s create a sample report, which can display the Employee Details like First Name, Last Name, Address, City, Region, Country, etc.
For all this we need to add a report first, so for this right click on “Report” Folder in The Simple Report Project and choose “Add” Then “Add New Item” you can see the following screen:
Choose “Report” and give appropriate report name and click on ADD button.

6) After adding a new report into project, you will be able to see tree tabs.
a. Data – You have to provide the dataset for the report into this option. You can specify the SQL script into that.
b. Layout – This tab handle the layout of the report. You can specify the report layout in design mode. This works same as Report designers like Crystal report etc…
c. Preview – You can see the Preview of the report in this tab.
In Data tab User will need to create dataset for the report. The Dataset dropdown will have option by using this User will be able to create the dataset.
For this in DATA Region of the Report, click on Item of the Data Set Drop Down List Box. By clicking this you are redirected in following screen.
Here you have two options:
  1. Write SQL Queries directly by selecting Command Type=”TEXT”
  2. You can give Stored Procedure Name also by selecting the Command Type=” StoredProcedure”.

Press ok after applying proper queries or stored procedure depends as per requirements.

Following diagram shows the Data tab of the Report.

7)
Now turns to design the Actual Report as per our needs.
We want to display the Employee Details in our report. For this we are required to put
Labels, Text Boxes that shows the actual details of the Employees from the Employee table
as we applied into the Data Region.
Following image is showing the Layout view of the report in this we are using Table
object,which have the facilities of Header and Footer of the Rows. So we are displaying the
Column Title in Header and the actual record in Rows section of the Table.
8)The stored procedure will returns the dataset. The dataset’s column names will be displayed in Report Data Explorer. You can use datasource as dataset or stored procedure.  If you used dataset,the datasets column name would be listed. Here the stored procedure passed with parameters.



Sunday, April 29, 2012

SSRS Introduction

SQL Server Reporting Services (SSRS) is a server-based report generation software system from Microsoft. It can be used to prepare and deliver a variety of interactive and printed reports. It is administered via a web interface. Reporting services features a web services interface to support the development of custom reporting applications. SSRS competes with Crystal Reports and other business intelligence tools, and is included in Developer, Standard, and Enterprise editions of Microsoft SQL Server as an install option. Reporting Services was first released in 2004 as an add-on to SQL Server 2000. The second version was released as a part of SQL Server 2005 in November 2005. The latest version was released as part of SQL Server 2008 in August 2008.
Reports are defined in Report Definition Language (RDL), an XML markup language. Reports can be designed using recent versions of Microsoft Visual Studio, with the included Business Intelligence Projects plug-in installed or with the included Report Builder, a simplified tool that does not offer all the functionality of Visual Studio. Reports defined by RDL can be generated in a variety of formats[1] including Excel, PDF, CSV, XML, TIFF (and other image formats[2]), and HTML Web Archive. SQL Server 2008 SSRS can also prepare reports in Microsoft Word (DOC) format.
Third-party report generators offer additional output formats.
Users can interact with the Report Server web service directly, or instead use Report Manager, a web-based application that interfaces with the Report Server web service. With Report Manager, users can view, subscribe to, and manage reports as well as manage and maintain data sources and security settings. Reports can be delivered via e-mail or placed on a file system. Security is role-based and can be assigned on an individual item, such as a report or data source, a folder of items, or site wide. Security roles and rights are inherited and can be overloaded.
In addition to using the standalone Report Server that comes with SQL Server, RDL reports can also be viewed using the ASP.NET ReportViewer web control or the ReportViewer Windows Forms control. This allows reports to be embedded directly into web pages or .NET Windows applications. The ReportViewer control processes reports in one of two ways: (a) server processing, where the report is rendered by and obtained from the Report Server; and (b) local processing, where the control renders the RDL file itself.
SQL Server Reporting Services also support ad hoc reports: the designer develops a report schema and deploys it on the reporting server, where the user can choose relevant fields/data and generate reports. Users can then download the reports locally.