Templates

Parent Previous Next

Templates

Create a Template

To create a new report template, ensure you have run a search in order to have a data subset to test your template. Go to Report View and from the Report menu, click the New button.

Enter a suitable template name at the prompt. The Template Editor screen displays:

Use this screen to define your report template using HTML and the Smarty syntax (see Smarty Syntax).

A basic example template is created by default, which you can then use as a starting point or remove and start from scratch. The basic template consists of:

Enter the report code in the Template pane. You can either:

Preview  Results

To preview the results of your template, click TEST. The report output is shown in the bottom pane (only a subset of the data is shown, for efficiency).

To further set the parameters of the Test output, use the two dropdowns in the Editor menu:

The test results are updated immediately.

When complete, click Save As to save your report structure. This will now be made available for selection when you choose to print or publish the report. Click Close Editor when finished.

Actions Pane

The Actions Pane provides a records/fields tree of your database structure that assists you in creating a simple template (with loops, fields & functions) to produce neatly formatted lists in text (e.g. CSV, and HTML formats, including images, video and so forth).

More complex formats can use all the power of the Smarty template language, including PHP functions (standard or user-defined) directly in the template.

To use the Actions pane, nsert the cursor in the code where you wish to insert the syntax. Press Enter to add extra lines if required. Select the appropriate record type. For each code string, first position the cursor in the appropriate location in the report, then select the appropriate function from the actions pane:

In the above example, the user has created an If statement wrapper, and can now enter variable code between the If statements as required.

Note. Untyped pointers do not appear on this list; instead a dialog will assist you.

To enter field variable details, click on the insert option for the relevant field. This displays the Insert dialog. The options available are dependent on whether the variable is selected for an IF Statement or Repeat Loop:

Note. You can output the leaf term alone or the leaf term with its hierarchy (where terms are hierarchical).

These have the following elements which you can insert into the code:

Insert Fields Value

Inserts the value of the selected field.

From the dropdown you can specify how the field information is displayed.

  • Field Only. Normally use Field only. This inserts the field specification to render the content of the field as-is.
  • Field + Function Wrapper. This inserts the field with the wrap function, which is useful for special types such as URLs, images and videos, as it inserts required html code, for example:
    • {wrap var=$r.recURL dt="url"} inserts a hyperlink.
    • {wrap var=$r.thumbnail_image_originalvalue dt="file" width="300" height="auto"} inserts an image.

Test Value (IF)

Click this button to insert a test value for the loop.

Insert Pattern

Click this button to insert a more complex pattern (e.g. a table)

Edit/Delete Template

To edit a template, Go to Report View. Select a report from the Select Template dropdown. Select the Edit button. The Template screen Displays. Edit the template as required (see above). When complete, click Save.

Note. To create a new report form an existing report, click Save As and give the report a new name.

Click Close Editor when finished.

To delete a template, Go to Report View. Select a report from the Select Template dropdown. Select Menu | Delete Template.

Warning. If you delete the report template at the next step you cannot retrieve the report again.

Click OK at the prompt to delete the report.

Created with the Personal Edition of HelpNDoc: Easily create PDF Help documents