Friday, November 28, 2014

Can someone give me a Template please?

Can someone give me a Template please?

In this post I’m going to explain how to create a custom template that you can add to your Report Server and it will then appear in the Visual Studio installed templates list when you add a new report to your project.

Introduction - Why use a Template?

As consultant we create reports at enterprise level and this means that we need to ensure that there is consistency in the look and feel of the reports throughout the organisation. For example, let’s say the header of all reports should have the company logo and the footer should have the page numbers and execution time. The problem with this is, there might be several developers creating reports and working on reports. And this is why templates are a good idea to ensure report layout consistency.
Luckily, SQL Server Reporting Services (SSRS) allows us to create custom report templates with the desired report layout.

Creating a custom report template

To create a custom report template is actually very easy and no different from creating a normal report. You start by adding a new report to your report server project. Using the Report Designer, place all the common report items in the report that you would like to be on the template.

After you’ve designed your template, give the report a name such as ReportTemplate to indicate it's a template and save the Report Definition Language (RDL) file to the following folder:
For Visual Studio 2008: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies ProjectItems\ReportProject
For SSDT (or VS 2010):  C:\ Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject

Your template file will now appear in the Visual Studio installed templates list when you add a new report to your project, and the new report will contain all the common items defined in your template.

Important Note: For this to work in VS 2010 you need to download Microsoft SQL Server Data Tools - Business Intelligence for Visual Studio 2012.

No comments:

Post a Comment