This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# REPORT TEMPLATE EDITOR
|
||||
|
||||
[Incomplete - under construction]
|
||||
|
||||
AyaNova report templates are html based template documents that are used with the [Handlebars](https://handlebarsjs.com/) templating language to generate html documents that are rendered to .PDF [Portable document format](https://en.wikipedia.org/wiki/PDF) files.
|
||||
|
||||
HTML and Javascript along with Handlebars templates are used to customize the existing reports in AyaNova and make new ones.
|
||||
@@ -36,15 +38,55 @@ These are the properties of the report outside of the actual report template its
|
||||
* `Roles` this sets which User Roles are allowed to access the report. (*Security note*: no matter what is set here, the server will still not provide data to a report if that data is outside of the Roles of the current user so reporting is not a way to get access to information that is not permitted for a User)
|
||||
* `Notes` about the template, only displayed in the designer UI, usually reference notes for the people involved in designing the reports.
|
||||
|
||||
### Template
|
||||
### PDF Options
|
||||
|
||||
#### overview
|
||||
|
||||
Report generation consists of two distinct and separate processes: Processing the the report html template to generate an HTML web page and secondly rendering the generated HTML page to a PDF document for the final report. The PDF Options tab of the report designer controls settings related to the rendering and appearance of the output PDF document which contains the report.
|
||||
|
||||
#### PDF settings
|
||||
|
||||
* `Display header & footer` if checkmarked then the header and footer templates will be inserted into the output pdf document
|
||||
* `Header template` HTML template for the pdf header. Use HTML markup with following classes used to inject special values into them
|
||||
* `date` formatted print date
|
||||
* `title` document title
|
||||
* `url` document location
|
||||
* `pageNumber` current page number
|
||||
* `totalPages` total pages in the document
|
||||
* `Footer template` HTML footer template, uses same properties as header template
|
||||
* `Paper format` Standard paper size format, choose from list of supported formats
|
||||
* `Landscape` Output in Landscape vs Portrait format
|
||||
* `Botttom / Left / Top / Right Margin` Margin values formatted as a number and unit. Valid units are `px` - pixel, `cm` - centimeter, `in` - inch, `mm` - millimeters e.g. "11 mm"
|
||||
* `Prefer CSS page size` Prioritizes any CSS @page size declared in the page over what is declared in width and height or format options. Defaults is false, which will scale the content to fit the paper size
|
||||
* `Print background` print background graphics, default is false. *Must* be checkmarked for CSS attributes such as alternating table rows to work.
|
||||
* `Scale` scales the report rendering, must be a value between 0.1 and 2, the default is 1
|
||||
|
||||
|
||||
##### PDF header / footer template notes
|
||||
|
||||
The CSS section of the Report template is separate from the header footer templates and not connected at all. 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.
|
||||
|
||||
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>
|
||||
```
|
||||
Footer
|
||||
```html
|
||||
<span style="font-size:6pt;width: 94%; text-align: right; ">Page <span class="pageNumber"></span> of <span class="totalPages"></span> </span>
|
||||
```
|
||||
|
||||
|
||||
|
||||
### 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.
|
||||
|
||||
In order to get up to speed quickly with report design we recommend looking over the stock reports provided as well as referring to the [Handlebars documentation](https://handlebarsjs.com/guide/#what-is-handlebars)
|
||||
|
||||
|
||||
|
||||
|
||||
### CSS
|
||||
|
||||
This section is provided to define the HTML Cascading Style Sheet for the report document. This section is optional.
|
||||
|
||||
Reference in New Issue
Block a user