Printing Forms - SSRS

Overview

SSRS (SQL Server Reporting Services) does not permit placing field values in the Page Header and Page Footer sections of a report, at least not with the Field!FieldName.Value syntax. This makes printing forms with SSRS a challenge when header data is desired at the top and/or bottom of each page, a common requirement for purchase and sales orders, bills of lading, and invoices, and others. This article outlines several design patterns to address this requirement in SSRS 2005.

As of SSRS 2008 R2, you can use the solution posted here. Of course, with that solution, the "page header" and "page footer" are actually created in a group header of a table.

Techniques

1 - Using Group Headers and Footers

This technique doesn’t work because we want footer data on every page. Data in a group footer is displayed only after all detail items have printed. The only way this would work is to consolidate the datasets into one and calculate the page numbers.

2 - Consolidated SQL

Summary

All data is consolidated into a single SQL statement. Based on the number of lines that can fit on a physical page, page numbers are calculated in the SQL statement. Go here for a walkthrough.

Advantages


Disadvantages


3 - Caching Header Data in a Shared Dictionary Variable

Summary

Custom code is written to instantiate a shared Dictionary variable, which is then filled will data from the header dataset via function calls in cells of a hidden table in the Report Body. Go here for a walkthrough.

Advantages


Disadvantages


4 - Caching Header Data in Hidden Report Parameters

Summary

A hidden report parameter is created for every field value in the header dataset that is required in the Page Header or Page Footer. Go here for a walkthrough.

Advantages


Disadvantages


5 - Caching Header Data in ReportItems

Summary

(TODO)

Advantages


Disadvantages