Embedding a Local Report
In my previous post we discussed how to install the MVCReportViewer package via Nuget into your application to avail of the helpers to embed SSRS reports into your MVC views.
In this article we will discuss using the MVCReportViewer package and helpers to embed local reports.
Most often people want to embed SSRS reports from the server into thier views, but sometimes we just want to create a simple local report in Visual Studio and display that in our view. This is the scenario we will discuss below.
Creating reports in Visual Studio 2012/2013
Visual Studio 2012/2013 comes with reporting capibilites out of the box. Simply right click in your solution explorer in Visual Studio and Add Item/ Reporting and you can see you have the option to add a Report or use the Report Wizard.
This provides you with good basic reports, it's like a pared down version of the tools and controls you get with real SSRS. If this suits your needs you need go no further. However if you need more capilibilites than whats on offer here you will need to install the SQL Server Data Tools – Business Intelligence tools for Visual Studio 2012/2013.
SQL Server Data Tools – Business Intelligence for Visual Studio
Currently the URL to download Microsoft Visual Studio Tools for Applications component for Visual Studio 2012 can be found here:
http://www.microsoft.com/en-ca/download/details.aspx?id=38807
Once you have install it, you will be able to create and work with SSRS reports within Visual Studio. Here are the basic steps for setting up a new SSRS report project:
Open up Visual Studio
Regardless of whether your requirements necessitate the use of the Business Intelligence tools or the standard out of the box reporting tools in Visual Studio, lets now disucss adding a basic report to your project so you can embed it in your MVC view.
DataSets
Before creating your report, you need to define your dataset. Lets create a Report folder in our project. It is a good idea to organise your folder structure within your application in a logical manner , so we will use this folder for all our Datasets and reports.
Using the standard out of the box reporting functionality in Visual Studio 2012/2013, right-click in your Report folder and Add New item.
Go to Data-> and select Dataset. Call it
In this article we will discuss using the MVCReportViewer package and helpers to embed local reports.
Most often people want to embed SSRS reports from the server into thier views, but sometimes we just want to create a simple local report in Visual Studio and display that in our view. This is the scenario we will discuss below.
Creating reports in Visual Studio 2012/2013
Visual Studio 2012/2013 comes with reporting capibilites out of the box. Simply right click in your solution explorer in Visual Studio and Add Item/ Reporting and you can see you have the option to add a Report or use the Report Wizard.
This provides you with good basic reports, it's like a pared down version of the tools and controls you get with real SSRS. If this suits your needs you need go no further. However if you need more capilibilites than whats on offer here you will need to install the SQL Server Data Tools – Business Intelligence tools for Visual Studio 2012/2013.
SQL Server Data Tools – Business Intelligence for Visual Studio
Currently the URL to download Microsoft Visual Studio Tools for Applications component for Visual Studio 2012 can be found here:
http://www.microsoft.com/en-ca/download/details.aspx?id=38807
Once you have install it, you will be able to create and work with SSRS reports within Visual Studio. Here are the basic steps for setting up a new SSRS report project:
Open up Visual Studio
- Select File –> New –> Project
- You will now see a new project template option called Business Intelligence
- Expand this project template and select the Reporting Services option.
- You can now either choose to use the setup wizard or just a plain project template.
Regardless of whether your requirements necessitate the use of the Business Intelligence tools or the standard out of the box reporting tools in Visual Studio, lets now disucss adding a basic report to your project so you can embed it in your MVC view.
DataSets
Before creating your report, you need to define your dataset. Lets create a Report folder in our project. It is a good idea to organise your folder structure within your application in a logical manner , so we will use this folder for all our Datasets and reports.
Using the standard out of the box reporting functionality in Visual Studio 2012/2013, right-click in your Report folder and Add New item.
Go to Data-> and select Dataset. Call it