Programming Samples

Click here to go to:



Excel VBA

Word VBA

MS Access

Python

T-SQL

SSIS

SSRS

Power BI

Crystal Reports

SSAS

SQL Replication

C# Code

ASP .NET Code

Oracle PL/SQL

Database Diagramming


Back to Home Page


SSRS Report Header

Creating a Report Header and Report Footer in SQL Server Reporting Services Report Document

SQL Server Reporting Services lacks the Report Header and Footer sections that Crystal Reports has always had in the Section Expert, however, there is a way to place an item in the beginning of a report next to the Page Header and place an item at the very end of the report next to the Page Footer to create the appearance of a Report Header and Footer.

Creating the Report Header

I have a report of customers and their orders in SSRS, previously created in SSRS Using a Subreport. If I want to add a Summary at the beginning of the report only on Page 1, what do I need to do?

Subreports RDL

I will create a separate report for the header and call it CustomerSummaryReport.rdl and then create the Dataset in the Query Designer as shown in the image below. It is just a UNION query summing the Tax Amount, Subtotal, Freight Amount, and the Total Due into a single column to display the Totals for all of the customers orders in our report.

DataSet for Customer Summary

I can then add a Table to the report and drag and drop one of the fields from the Dataset to link it to the data and perform sum minor formatting to the amount by right clicking it going to TextBox Properties, select Number and format it to Currency with the Thousands (,) separator. Click Save and your are done with the Summary Report.

Customer Summary Table

I then move the contents of the report downwards in the report design view to allow some space to put a Subreport at the top of the body section next to the Page Header. I right click on the subreport and set the report to use as my CustomerSummaryReport. I do not need to set any Parameters for this report as it does not need any. Click OK to finish.

Insert Subreport and Set

Creating the SSRS Report Footer

To create a simple Footer, I add a TextBox in the Body of the report right next to the top of the Page Footer and then I set the Expression to "End Report". I will add some formatting to make the Text display as Bold and in a Red Font.

Report Footer Textbox

Now my report is ready to Preview. My Report Footer is below the Customer Data and my Report Header is above it.

SSRS Report Header and Footer

I run the report and I Exported it to PDF to prove that it only shows on Page 1 at the top.

Page 1 of Report

Here is an image of what Page 2 looks like - just a continuation of customer data.

Page 2 of Report

Finally, the last page of the report showing my Report Footer appearing only on Page 10 of 10.

Last Page with Report Footer

If you need the Report Header to appear on Page 1 by itself, just add a Rectangle to the report and drop the subreport into it and set the Page Break on the Rectangle to "End". This will force a Page Break after the Subreport and leaves the Summary on Page 1 with no other data.

Report Header on Page 1

Creating Report Headers and Footers is easily accomplished by putting the a Subreport or TextBox with the information next to the Page Header or Footer.