Create
a Page Header
Let's
create a header, complete with a company logo and title, for our new template
report.
1.
Select Report
from the main menu atop the Report Designer.
2.
Select Page
Header from the menu that appears, as depicted in Illustration 8.
Illustration 8: Selecting
Page --> Page Header from the Main Menu
We see
the new Page Header section atop the Layout area, as shown in Illustration
9.
The Page Header section is, unsurprisingly, where
we design our page heading for the report. As we find in most enterprise
reporting packages, as well as in Microsoft Office and other applications, we
can set various properties in the Page Header section that dictate the
behavior of the header, such as whether it appears on all pages of the report
(the default), the first page only, and so forth. As we have already
intimated, we can insert various objects into the header, although data regions
(lists, matrices, tables, and charts),
and some other objects that are typically associated with the report Body
section, cannot be placed here.
3.
Click the Image
item in the Toolbox.
4.
Click inside
the Header section of the Layout area to begin the process of
adding an image.
(Do
not be concerned with dragging the image into any specific position, sizing it,
etc., here. We will typically perform positioning and the like from the Properties
window, where we can do it more precisely.)
Illustration
10 depicts
graphically the steps above.
Illustration 10: Adding
an Image Item to the Header Section of the Layout Area
As
soon as we release the mouse after clicking in the Page Header section,
the Image Wizard appears, beginning with the Select the Image Source
dialog. We can select from several options here, but for purposes of our
practice exercise, we will select the default of Embedded.
5.
Ensure that
the radio button to the immediate left of Embedded is selected on the Image
Wizard - Select the Image Source dialog, as shown in Illustration 11.
Illustration 11: Adding
an Image Item to the Header Section of the Layout Area
As many
of us have already discovered, an image item in Reporting Services is an object
that contains a reference to an image file that is stored on the report server,
embedded within the report, or stored in a database. We will be working with an
embedded image in this exercise, to keep things simple, although we will
encounter and discuss the other image options in other articles throughout the MSSQL
Server 2000 Reporting Services series.
When we
embed the image, the Report Designer encodes the image and stores it as
text within the report definition (the .rdl file). The primary advantage for
using an embedded image is that the image is always available to the
report - that is, there is no possibility of it being moved from an external
storage location (such as the other types of location options that appear on
the Select Image Source dialog entail), and not being accessible by the
report at runtime. An unsurprising disadvantage in using this option is the
fact that it can bloat the report definition; embedding several images can
dramatically increase size, which might not be desirable in some instances.
The Choose
the Embedded Image dialog appears.
7.
Click the New
Image button.
The Import
Image dialog appears, affording us the opportunity to locate and select the
image file we wish to embed in the template report header.
8.
Navigate to
the following folder within the Program Files directory (or it's
equivalent, if your installation of Reporting Services is located somewhere
besides the default):
Microsoft SQL Server\MSSQL\Reporting Services\ReportManager\en\help
9.
Select the
following image file:
hlp_rswa_logo.gif
NOTE: I selected this image file, from several images that are
typically installed with Reporting Services, in an attempt to make the location
and selection of an image file easy. It might be possible that this image is
not in place on your machine, or that you cannot otherwise access it. In that
case, substitute an image of your choice that you can locate. The point here
is to simply walk through the steps of adding an image, such as a logo, to our
example template report header.
The Import Image dialog appears as depicted in Illustration
12.
Illustration 12: Selecting
an Image for Embedding
The Choose the Embedded Image dialog reappears, and
displays our selected image file as the default selection. The dialog appears
as depicted in Illustration 13.
Illustration 13: Choose the
Embedded Image Dialog, with our Selection as Default
The Completing the Image Wizard dialog appears, and
displays the details surrounding our image selection. At this stage, we can review our settings and back
up to make changes, should that be necessary. The dialog appears as shown in Illustration 14.
Illustration 14: The
Completing the Image Wizard Dialog