The benefit of using template is that it allows separation of database queries from the presentation.
A template consists of a header, row and footer part. An optional header part is an HTML block which will be output before any report content is displayed. The row part is repeated for each row in result set. The footer part is displayed after the result set has been processed.
If your query returns only one row, a template can be defined fully in row-section. If your query returns multiple rows, separate header and footer elements can be defined.
See Commands / Templates for more info how to use templates.