Tallan's Technology Blog

Tallan's Top Technologists Share Their Thoughts on Today's Technology Challenges

Solution: Linked Reports in SSRS Print with Incorrect Size or Orientation

Overview

When deploying reports to an SSRS server, the server creates a record in the Catalog table.  this table holds the report location, the binary data for the report, as well as parameter and property information, among other things.  On deployment, various report properties are extracted and added to the Properties column of the Categories table in the ReportServer database.  A sample is displayed below:

   1: <Properties>

   2:   <Language>en-US</Language>

   3:   <HasUserProfileQueryDependencies>False</HasUserProfileQueryDependencies>

   4:   <HasUserProfileReportDependencies>False</HasUserProfileReportDependencies>

   5:   <PageHeight>215.9</PageHeight>

   6:   <PageWidth>355.6</PageWidth>

   7:   <TopMargin>0</TopMargin>

   8:   <BottomMargin>0</BottomMargin>

   9:   <LeftMargin>0</LeftMargin>

  10:   <RightMargin>0</RightMargin>

  11: </Properties>

SSRS appears to use the data stored in the Properties column to detect paper size and orientation when printing the report.

Linked Reports

When creating a linked report, a new row is created in the Categories table, with the LinkSourceId column set to the Id column of the original report you’re linking from.  The Properties column is initialized with the following:

   1: <Properties/>

For some unknown reason, SSRS does not copy over the Properties data.  When printing a linked report, SSRS uses the Properties data from the linked report.  Since there is no property data, it uses defaults, generally 8.5×11.

Solutions

Unfortunately, there is no facility in the Report Manager to directly set there properties, so one of the following needs to occur:

Solution 1: Setting Report Properties Through the ReportService.asmx Web Service

A post on Brian Weckler’s blog provides VB.NET code for connecting to the ReportService.asmx service and manually setting the properties:

http://blogs.msdn.com/b/bwelcker/archive/2005/09/07/461758.aspx

 

Solution 2: Updating the Linked Report Record in the Database

The property field can be directly updated in the catalog table.

 

   1: use ReportServer

   2:

   3: declare @property varchar(max)

   4: declare @id uniqueidentifier

   5: select

   6:     @id = ItemID,

   7:     @property = property

   8: from

   9:     [Catalog]

  10: where

  11:     Path = '/PathTo/MyReport'

  12:

  13: update [Catalog]

  14: set

  15:     property = @property

  16: where

  17:     LinkSourceId = @id

If anyone has any better solutions, please let me know!

No comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

\\\