You can reuse the content from your report by using that report as a basis for a new
report template.
You have an existing report, and you want to use it as the basis for a new report
template. When you have finished, you must add the new templates to the Designer
Wizard.
Before you begin:
- Have a new directory on your disk (e.g: My Report Templates) where you will
store the report template files that you create in the following procedure. If you have not set up a
template directory, see Set the report template directory.
- Have an existing report.
-
Create a copy of your report design (.4rp) and save it in your report
templates folder.
-
Rename the copy to a different name, and with a .4rt extension.
It is recommended that you not have a .4rp and .4rt sharing the same name in a template
folder. If your report is names SalesList.4rp, you would not simply name it as
SalesList.4rt. You would modify the name in some manner; for example, you can
add the word Template to the name and save it as SalesListTemplate.4rt.
-
Open the .4rt file in Report Designer and examine the report. In the next step, you must
identify which fields are variable placeholders and which parts are template fields.
-
Create a report schema template definition (.rsd).
Rather than starting with an empty file, it is recommended that you take an existing report
data schema (.rsd) file from the templates provided during the installation and
modify it to meet your report needs. You can find report schema template definitions
(.rsd) in $GREDIR/gre/templates.
-
Return to your .4rt file, to the Data View tab, and change the schema to the schema you created
in the previous step.
You are not going to use the actual data fields anymore, you are going to use the fields
from your template schema. In the Design View, the places where you had data fields (from the
original report) are now marked as errors.
-
For the variable placeholders, double-click on each error to display the Edit
Expression dialog. Replace the value with one of the names from the template schema
file.
-
For the row of fields, such as those contained within a Table Row container, you must replace
the fields with a Template Field placeholder.
-
Delete the existing fields.
-
Go to Tool Box.
-
Drop the Template Field onto the Table Row (or similar container).
-
In the Template Field section in the Properties view, the Name, Type, Size, Title and Role
properties should be preset.
When you drag something from the Data View into the Document View, it creates an object based
on the context of where it is being placed. These five properties provide the information needed to
create the correct object. This field is repeated as many times as needed.
-
Replace any column headers with a Template Field.
-
In the Report Structure, organize the TemplateField objects to sit under
the fields triggers.
Right-click on a TemplateField, select , then select the template fields trigger.
Tthe template is now finished.
-
Create a copy of a
.prop
file, and modify the contents of the file for your
new template. Give the copy the same name as the template file.
-
Create a template image (.4rt.png) to serve as the image displayed in the Report From Template
selection list. Save it with the same name as the template file.
-
Create a empty image directory for the new template, with the same name as the template
file.
Eventually, you will provide an image for each of the placeholders. This can be done at a
later time.
-
Select .
The new template is available for use.