Editing a Template


To edit a template, select it in the list of templates in the Template Editor. You can change the name of the template or its comments in the controls at the right. To edit the layout of the template, click the Edit button in the toolbar. This brings up the Advanced Report Designer, which you can use to change the layout of the template.

Use the Advanced Report Designer to edit a template the same way you use it to modify a normal report. You can add rectangles, lines, pictures (such as a company logo), and so forth. The objects in the template appear on every report using that template. You can also specify the paper size and source tray or bin. However, due to its nature, there are a few differences between a template and a normal report:

You control both of these issues on the Other page of the Properties dialog for an object. For a field object, you can specify whether it's a template, or placeholder, object and how its size and position are adjusted.

The choices for the Template type setting are:

Even objects that aren't placeholders can have their size and/or position adjusted as necessary. The choices for the Size/position adjustments setting are:

If you want different group header and footer bands to be formatted differently, create as many data groups for the template as necessary. For example, suppose you want objects in the first group header to be formatted differently than any other group header. In that case, create two data groups using the Data Grouping page of the Report Properties dialog. The expression to use for the group isn't important; you can enter something like GROUPTEMPLATE1 for the first group and GROUPTEMPLATE2 for the second to keep them separate, but that isn't required. Then add the desired objects to each group header band and format them as desired. When you run a report using this template, objects in first group header are formatted as specified in the first group header of the template and objects in all other group headers are formatted the same as the template objects in the second group header of the template. If a report has more grouping than the template does, the last group in the template is used for that grouping level and all higher ones. See the Elegant template as an example of how to use this technique.

To specify that a particular paper size or source is used for all reports using the template, choose Report Properties from the Report menu, click the Page Setup button and select the desired paper size and source in the Page Setup dialog, then click OK. Be sure to turn on the Save printer environment setting before clicking OK to close the Report Properties dialog or these settings aren't saved.

One thing that's specific for cross-tab reports is an indicator of when a subtotal or total is being output: in that case, _SUBTOTAL or _TOTAL are True. You can use these in Print When expressions for an object to display something only when in a subtotal or total. For example, in the Cross-Tab Gradient template, the rectangle in the Details band has a Print When expression using both _SUBTOTAL and _TOTAL so this rectangle appears only for subtotal and total lines.

You can use the Dynamics tab of the properties dialogs for the various objects in a template to specify how to format the object. For example, in a cross-tab report, you can use a dynamic condition of _TOTAL to format the grand totals line in bold text.

Once you've finished making changes in the Advanced Report Designer, save the changes using the Save function in the File menu and close the Advanced Report Designer.