You are on page 1of 6

Crystal Reports 10 Templates

Using Template Reports for Increased Productivity

Reuse in Reporting
One of the most demanding and time-consuming parts of the report design process is formatting all of
your reports to have a consistent look-and-feel. In many companies, report designers are asked to
conform to a corporate standard such as a letterhead or even something as demanding as GAAP or
SEC specifications.

In a perfect world, less work would be required if the report designer were allowed to focus their efforts
on formatting one report and using it as a guide for all other reports that require visual, presentation-
quality features. After one report is completed with the appropriate formatting, why not apply its
contents and formatting to other reports? Applying an existing report’s layout to other reports is very
straightforward with Crystal Reports 10. This is made possible through the customizable Report
Templates functionality.

The purpose of this white paper is to help you further understand the Report Template functionality in
Crystal Reports 10 and how it can improve report design efficiency and productivity in your
organization.

Contents

REUSE IN REPORTING.............................................................................................................................................................. 1
UNDERSTANDING REPORT TEMPLATES ................................................................................................................................... 2
Using Report Templates................................................................................................................................................. 2
HOW ARE TEMPLATES BETTER THAN STYLES IN PREVIOUS VERSIONS? ................................................................................ 2
USING EXISTING CRYSTAL REPORTS AS TEMPLATES .............................................................................................................. 3
CREATING USEFUL REPORT TEMPLATES ................................................................................................................................ 4
Design Considerations for Effective Templates............................................................................................................. 4
USING TEMPLATE FIELD OBJECTS .......................................................................................................................................... 4
USING REPORT TEMPLATES TO REDUCE REPORT CREATION EFFORT ..................................................................................... 5
Applying Multiple Templates ......................................................................................................................................... 5
SUMMARY .............................................................................................................................................................................. 6

1/21/2004 Copyright  2003 Business Objects, SA All Rights Reserved. Page 1


Crystal Reports 10 Templates Using Template Reports for Increased Productivity

Understanding Report Templates


Report Templates can be thought of as a marriage between the data (in the original report) and the
layout (template report). The template contains the basic structure of how a report should be displayed
and formatted if the relevant fields have been added to a report.

A Report Template is actually a regular report (RPT) file. This means that you can use virtually any
RPT file as a Report Template. Templates are applied to other reports so that their formatting and
layout can be used as a basis for the other reports. What is useful about the application of templates to
other reports is that the formatting is applied to the report as well as the layout. An example of this
would be a report that has four fields in a detail section, where all sections are “squished” together
before applying a presentation-quality template. After the template is applied, the location of the fields
in the template forces the fields in the existing report to span out and apply fonts as well.

Using Report Templates

Templates can store many types of objects. These objects can be applied to a report after the data-
intensive portion of the report design process is complete. Applying an existing template to a report can
save hours, even days, of mundane formatting tasks.

Some types of tasks that can be accomplished by applying a template to a report are:

• Adding corporate logos and other images


• Formatting for consistent page numbering
• Applying font style/color/typeface for data fields
• Formatting field borders and background
• Sizing fields
• Formatting group headers and footers
• Formatting summary fields
• Adding watermarks
• Applying other complex formatting
• Inserting lines
• Inserting boxes
• Using repository objects
• Adding report titles
• Maintaining website links
• Formatting based on data-field type
The options for using templates are virtually limitless.

How Are Templates Better Than Styles in Previous Versions?


Prior to Crystal Reports 9, customers were able to use the Styles feature in Crystal Reports. The Styles
feature allowed the designer to apply a set formatting style to their report. Report Styles were fairly
limited because they were not customizable. For example, you could not even change the group name
field color because there was no way to open up the styles to make changes.

1/21/2004 Copyright  2003 Business Objects, SA All Rights Reserved. Page 2


Crystal Reports 10 Templates Using Template Reports for Increased Productivity

Report styles were also limited to data and group fields. No images or static text objects were included.
The Styles were hard-coded into the Crystal Reports designer so that no external RPT files could be
used.

With Report Templates in Crystal Reports 10, you can use virtually any report object or format as an
applicable style at a report object level. In this way, a template takes the style feature from previous
versions and enhances it to make it useful to many more object types as well as applications.

Using Existing Crystal Reports as Templates


A lot of report formatting tasks can be accomplished by applying a template. Many of these tasks would
take a report designer many hours to complete if they had to be done by hand. For example, let's apply
the sample “Confidential” template from the Templates subfolder of Crystal Reports 10.

Before: After:

By applying a Custom Template, the following tasks were completed automatically:

• Adding the Powered by Crystal logo to the report (along with its ToolTip and hyperlink) from the
Crystal Repository
• Adding an image that displays “Confidential” as an underlay to each page of the report
• Modifying the fonts and positions of all the database fields
• Showing the Record Selection Formula on the report
• Adding dashed lines between all items in the Details Section
• Adding a rounded box around the Record Selection Formula
• Using a rounded box to show where groups start and end
• Moving the Field Headings for each data field into the Group Header and formatting them with
double lines

1/21/2004 Copyright  2003 Business Objects, SA All Rights Reserved. Page 3


Crystal Reports 10 Templates Using Template Reports for Increased Productivity

One of the more advantageous features of templates is that even if more fields are in the target report's
Details section than the template has, it duplicates the data field formatting for those extra fields. It puts
them into a separate Detail Section (usually titled “Details B”) so that they will all appear together but
they won't overwrite each other. The fields can then be moved around without having to worry about
applying the same formatting by hand.

Creating Useful Report Templates


Because any report can be used as the basis for a template, the report designer may just need to refine
a few functional or formatting characteristics to make the existing report more robust for use as a formal
template.

Design Considerations for Effective Templates

As previously mentioned, templates can be used to accomplish formatting tasks at a much more rapid
pace after data collection is done. Because any report can be used as a template, a report designer
might already have a library full of ideas.

Applying one report layout as a template to another may cause some problems if the databases that
are connected to each report are completely different in terms of schema, structure, or content.
However, with proper design, the template report can overcome this.

Formulas, for instance, can be problematic. Because most formulas require database fields to function,
they are closely tied to the actual database and structure of the data that is coming in to the report.
However, some tools are available that can minimize this effect. Using Custom Functions instead of
pre-written formulas can alleviate some of the data dependencies, as can using the CurrentFieldValue
evaluator for formatting formulas.

Sometimes simply focusing on the page headers or footers can go a long way in effective Report
Template design. By reducing the repetitive nature of general page formatting, you will increase your
report design productivity.

Using Template Field Objects


During the process of designing a Report Template, a need might arise to provide some specific
formatting for a field, not based on its position in the report, but instead, based on the type of field it is.
For example, a company might require that all date/time values be displayed in military time regardless
of operating system defaults. For example, "6:02 p.m. on March 31, 2004" must be displayed as
"03/31/04 18:02".

These requirements could easily be corporate or industry standard requirements, such as the ISO 9000
standard. At the time the template is created, it's unknown where these fields will be located in the
report or how many of them there will be. A report designer can use Template Field Objects to help in
this endeavor.

When designing a report specifically as a template, Template Field Objects take the place of regular
database fields in a report and can be placed anywhere. They even can be used as grouping fields.

1/21/2004 Copyright  2003 Business Objects, SA All Rights Reserved. Page 4


Crystal Reports 10 Templates Using Template Reports for Increased Productivity

Template Field Objects are a special type of formula field that contain no data but allow formatting to be
applied to them as if they were of any data type. Template Field Objects have a special dialog
associated with them that exposes all the Formatting tabs of the Format Editor regardless of type. This
provides a one-stop shop for all of your formatting needs regardless of the data type for a given position
of a field in a report.

TIP Undoing a template is a useful option provided in Crystal Reports. If you do not like the
look that the applied template has given to your report, simply return to the Template
Expert and choose the Undo command at the bottom of the dialog box. By selecting this
option and then clicking OK, Crystal Reports revert back to the original report before the
template was applied. Crystal Reports accomplishes this by opening up the temporary
backup RPT that it saved before applying the template file.

Using Report Templates to Reduce Report Creation Effort


Templates can accomplish many of the more intense design-related tasks, including:

• Conditional formatting
• Field highlighting
• Page headers/footers
• Charting standards
• Lines/boxes/borders
• Color standards
• Logos and images
• Web sites/hyperlinks/email addresses
• Standard custom functions
• Repository objects
• Locking size or position of any object
• Special fields
These are just some of the typical tasks that can be automatically done by applying a template.

Applying Multiple Templates

Because any report could be used as a template, you can apply multiple templates to a single report.

This can prove quite useful if the templates are doing different things. For example, one template might
be applying the standard page headers and footers to all reports within a company, whereas another
template could be used to apply department-based colors to the details section. Because both
templates are encapsulated separately, they can be applied separately and will not affect each other;
they add to the value of the report. The resulting report will then have the corporate style (headers and
footers) as well as the specific department's colors (in the Details section).

TIP A single template can be applied multiple times to the same report, even if new fields are
added to the report after the initial template was applied. Simply choose Reapply
Template in the Template Expert to have the template address any new fields.

1/21/2004 Copyright  2003 Business Objects, SA All Rights Reserved. Page 5


Crystal Reports 10 Templates Using Template Reports for Increased Productivity

Summary
Report Templates can be used to improve productivity in the report design process by allowing
designers to handle formatting once and apply those changes to many reports with the click of a button.

No special knowledge is required to create templates because they are simply report files. However,
Template Fields Objects can be used to take template creation to the next level.

Applying templates to existing reports is a straightforward step using the Template Expert. The Expert
also gives a preview of what the end result of the report will look like – taking the guess work out of
formatting. By using customizable templates, report designers can now focus their efforts on getting the
right information out of the data instead of spending countless hours formatting and reformatting their
reports.

**************************************************
The information contained in this document represents the best current view of Business Objects on the issues discussed as of the date of
publication, but should not be interpreted to be a commitment on the part of Business Objects or a guarantee as to the accuracy of any information
presented.

This document is for informational purposes only and is not intended as a guarantee or warranty of any kind. The information is provided AS IS.
BUSINESS OBJECTS MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. Business Objects
will not be liable for any damages (direct, indirect or consequential) to you for your consumption, use or reliance on the information provided herein.

© Copyright 2003 Business Objects, SA. All rights reserved. Specifications and product offerings subject to change without notice.

1/21/2004 Copyright  2003 Business Objects, SA All Rights Reserved. Page 6

You might also like