Problem: How to create a
report from SQL Server data using SSRS?
For Creating a report, we need
to know few things before we start using those inside the designer.
Data Source: It is
the connection that is used to connect with the SQL Server instance where your
database is located to pull the data or retrieve the data.
We also have shared data sources
which can be referenced in other reports so we don’t have to connect each time
or create a connection each time.
Data set: This is
the result set of a query or a procedure which you consider to feed inside the
report and represent in various formats like a table or matrix, etc.
Report Builder:
This is the design area of how to show the report when executed or exported to
a type of format.
You can configure header, footer
page number and add image in the report area.
Pre-requisites:
SQL Server
database engine for source dataset.
BIDS or SSDT
for SSRS designer.
Example:
In the example, I would like to show we can create a SSRS report
using SSDT and export the report to PDF.
I have created a new project for this Demo and called it Report Project, under this project i am going to add a new item as shown below to add a report.
After creating a report the next step is to configure a shared data source which we will be using in the later steps.
The next step is to create a data set from the report data tool box and define the query using the shared data source created in the steps before.
Now lets move on to the designer and add a table from tool box to the report area.
Now come back to the report data section and access the data set which was created earlier and drag the fields into the table in the report section.
After the selection of fields is done you can click on the report preview next to the designer which is similar to execute option,
Now use the export options to choose your format and i am going to use Pdf in this case
Final output: this report can be emailed to the required people via email or saved for analysis.
0 comments:
Post a Comment