This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# REPORT TEMPLATE EDITOR
|
||||
s# REPORT TEMPLATE EDITOR
|
||||
|
||||
[UNDER CONSTRUCTION PRE-RELEASE]
|
||||
|
||||
@@ -61,20 +61,53 @@ Report generation consists of two distinct and separate processes: Processing th
|
||||
|
||||
#### PDF header / footer template details
|
||||
|
||||
The CSS section of the Report template is completely separate from the CSS Header & Footer templates. CSS Headers and footers require their own complete inline css to be specified as they are part of the PDF generating system, not the Report generating system.
|
||||
The PDF header and footer templates are a completely unique system separate from the regular report template and require their own special templates to be used. The way the underlying report rendering system works means that the header and footer section can not "see" any other part of the report template so it is not possible to script them or insert data from the report data source into them.
|
||||
|
||||
##### Styling the header / footer
|
||||
|
||||
Headers and footers require their own self-contained *inline* CSS to be specified as they are part of the PDF generating system, not the Report generating system. The header and footer can not use styles defined for the overall report itself in the CSS tab of the report designer. This will become more clear with the examples below.
|
||||
|
||||
##### Date time tokens
|
||||
|
||||
The AyaNova server will substitute the current date and time in the Header or Footer anywhere it finds the matching (case sensitive) token text `PDFDate` or `PDFTime`.
|
||||
|
||||
For example:
|
||||
```html
|
||||
<span>date is: PDFDate, time is: PDFTime</span>
|
||||
```
|
||||
|
||||
The date and time will be displayed in exactly the same format as dates and times are displayed in the AyaNova user interface by using the browser default language settings (or the overriden language set in User settings).
|
||||
|
||||
##### Page number tokens
|
||||
|
||||
Unlike the date and time tokens the page number tokens are not set by the AyaNova server but rather they are set by the report generator itself and are specified by setting a class on an empty span in the footer or header template.
|
||||
|
||||
The current page number is specified as a class set on a span, for example:
|
||||
```html
|
||||
<span class='pageNumber'></span>
|
||||
```
|
||||
|
||||
Total pages is also specified as a class set on a span, for example:
|
||||
```html
|
||||
<span class='totalPages'></span>
|
||||
```
|
||||
|
||||
Example:
|
||||
Show todays date in the header, and Page x of XX - note also total pages refers to TOTAL pages, NOT pages per object (i.e. if printing from a list of workorders, the total pages will be ALL workorders pages, not pages per workorder.
|
||||
|
||||
Header
|
||||
```html
|
||||
<span style="font-size:6pt;width: 94%; text-align:left; "> Todays date: <span class="date"></span></span>
|
||||
<span style="font-size:6pt;width: 94%; text-align:left; "> Report rendered on: <span>PDFDate</span> at: <span>PDFTime</span></span>
|
||||
```
|
||||
Footer
|
||||
```html
|
||||
<span style="font-size:6pt;width: 94%; text-align: right; ">Page <span class="pageNumber"></span> of <span class="totalPages"></span> </span>
|
||||
```
|
||||
|
||||
##### Headers and footers require margins
|
||||
|
||||
If you specify a header or footer without setting a top or bottom margin you will likely not see your header or footer on the report as space needs to be reserved for them. See the [PDF Settings](#pdf-settings) above. A good starting point to experiment with is `1cm` margin.
|
||||
|
||||
### Report Template
|
||||
|
||||
The main HTML / Handlebars template. This is where the report is defined and is required to render a report. A template is a mixture of both source HTML and Handlebars templates combined with data to generate the final report HTML.
|
||||
|
||||
Reference in New Issue
Block a user