As mentioned previously, the templates are written in Latex with additional custom functions to assist getting dynamic content into the documents. The dynamic content is pulled from the JSON data payload using the functions described on this page.
The JSON data payload contains data which is dynamic in the document. There are no JSON schemas that your data has to pass, the only requirement is that is it a valid JSON. To test your template and compile with a sample JSON data payload, you can access it underneath the 'JSON Dataload Test' heading.
Clicking on the data.json will open your JSON data payload for editing.
To include dynamic data into the document we use the following set of functions. We break down the functions by the type of data which they output. Currently, the output of such functions can be in a form of text, number, date, complete table and base64 encoding images.
To include dynamic data into the document we use the following set of functions. We break down the functions by the type of data which they output. Currently, the output of such functions can be in a form of text, number, date, complete table and base64 encoding images.
key - a key which corresponds to the location of the text located in the JSON Data Payload, e.g 'clientDetails.Name'
format - describes the format into which the string should be changed into. The following options exist: 'none', 'uppercase', 'lowercase', 'sentence' (sentence case) and 'titlecase'.
The following example shows how to use the advGetStrValue function:
key - a key which corresponds to the location of the text located in the JSON Data Payload, e.g 'clientDetails.Age'
decimalPlaces - a numeric parameter which determines the number of decimal places to show for numeric values, e.g. '4'
decimalSeparator - a string parameter which determines how to show a decimal separator in numbers. Possible values are 'fullstop', 'comma' and 'dash'.
thousandsSeparator - a string parameter which determines how to separate thousands in numbers. Possible values are 'none', 'space', 'fullstop', 'comma' and 'dash'.
The following example shows how to use the advGetNumValue function:
key - a key which corresponds to the location of the text located in the JSON Data Payload, e.g 'clientDetails.Name'
formatIn - describes the format of the date in the data JSON.
formatOut - describes the output of the date required in the document.
The following example shows how to use the advGetDateValue function:
key - a key which corresponds to the location of the table data located in the JSON Data Payload, e.g 'table.data'.
columnNames - an array of column names in order which you want it to appear in your tablem, e.g '{Currency, Amount, Description}'
horizonalLines - a string value descibing type of horizonal lines for the table. The options are: 'none', 'solid', 'dash'.
rowWidth - a value to describe the height for the row in the table, e.g '0.5cm'.
includeEmptyLastColumn - a boolean parameter whether to include an empty column at the end of each row, e.g. 'TRUE'.
columnStyle - an array which indicates the style of each column, e.g. '{bold, emph, underline, italics}'.
prefix - an array of string characters which need to be added to each column at the start, e.g. {,,R}
suffix - an array of string characters which need to be added to each column to the end, e.g. {,,c}
decimalPlaces - a numeric parameter which determines the number of decimal places to show for numeric values, e.g. '4'
decimalSeparator - a string parameter which determines how to show a decimal separator in numbers. Possible values are 'fullstop', 'comma' and 'dash'.
thousandsSeparator - a string parameter which determines how to separate thousands in numbers. Possible values are 'none', 'space', 'fullstop', 'comma' and 'dash'.
The following example shows how to use the advGetTableData function:
Although the web is full of good resources here is a list of our favourites: