Render Script / Template

The section layout options provide quite a lot of flexibility in how the section should be rendered in the report, however sometimes you want even greater control of the layout. To assist in this, you can provide what's called a Render Script.

The Render Script overrides the rendering of a part, or all, of the report. It can be provided for an individual section or for the whole report.

A Render Script is a regular DbfScript script that will be passed the data that was queried in the report, in #input. The script must then return a list of strings. The list of strings will constitute the HTML-snippet of the section. The HTML would normally be table commands, and doesn't need to include the HTML tag, body tag or any other meta tags.

Render Script is located in the drilldown menu in either the Quick Report or the sub-section. In Quick Report, the Render Script located in the drilldown menu will look like this:

In the sub-section, it's located in the drilldown menu under Custom Render and will look like this:
 
 

In addition, you can also provide an HTML template to use. Alternatively an HTML template that can be used to render this part of the report. Use tilde (~) to surround field names, and dollar sign ($) to surround field names of repeating blocks (eg. nested lists), which must be terminated by $end$. The repeating blocks can also use DbfScript if prefixed with an equals sign, eg.

$=load(&root/StandingData)$
....reference fields in the Configuration tab...
$end$

They can also contain multiple lines, ending with a return statement to indicate what is used for the block:

$=
var #sd = load(&root/StandingData)
return #sd
$
....reference fields in the Configuration tab...
$end$


Next Topic:
v4.2.0.956 (beta)
Up Since 10/31/2024 12:42:36 PM