Template Help Note - the Template Engine evaluates text between { and } as Javascript and substitutes the expression value. | |
---|---|
Value | Description |
Heading and Fields Variables | |
{h1} {h2} {h3} .... | Heading for field 1,2,3 ... |
{H1} {H2} {H3} .... | Heading for field 1,2,3 as upper case... |
{f1} {f2} {f3} .... | Field value 1,2,3 ... or you can use the name of the field in the heading |
{F1} {F2} {F3} .... | Field value 1,2,3 as upper case... |
{fieldname} | Alternative to {f1},{f2}... use the field name instead. i.e. {id},{amount}
NOTE - use the FUNCTIONS below, i.e. {name.toJson()} if you need to encode the data |
String Constants and Counters | |
{nf} | Number of fields in current row |
{nr} | Number of data rows in CSV before filtering |
{nh} | Number of fields in heading row |
{rn} | Current data row number |
{br} | Line break |
{lb} | Left bracket { |
{rb} | Right bracket } |
{seq} | Sequence 1,2,3,... |
{tab} | Tab |
Functions | |
{f1.function()} | Where function is a valid Javascript string method or built-in function.
Multiple functions are supported via appending to the end (i.e. f1.trim().toUpperCase()). Partial list of functions below. |
{f1.toUpperCase()} | Field value to upper case letters |
{f1.toLowerCase()} | Field value to lower case letters |
{f1.toCsv()} | convert field to a CSV field by enclosing in double-quotes. |
{f1.toDollar()} | Format field value as dollar amount |
{f1.toFixed(n)} | Field value to numeric value with n decimal places |
{f1.toHtml()} | Make field suitable for viewing as HTML |
{f1.toInteger()} | Field value to integer value |
{f1.toJson()} | Make field suitable for JSON value |
{f1.toNumber()} | Field value to numeric value |
{f1.rpad(n)} | Right pad field value with spaces until n characters long |
{f1.lpad(n)} | Left pad field value with spaces until n characters long |
{f1.ltrim()} | Trim spaces from left side of field |
{f1.rtrim()} | Trim spaces from right side of field |
{f1.rjust(n)} | Right justify text to size n. i.e. {f1.rjust(20)} |
{f1.ljust(n)} | Trim and Left justify text to size n. i.e. {f1.ljust(20)} |
{f1.rjust(n)} | Trim and Right justify text to size n. i.e. {f1.rjust(20)} |
{f1.enclose(ch)} | Enclose field by character ch |
{f1.cjust(n)} | Trim and Center justify text to size n. i.e. {f1.cjust(20)} |
{f1.left(n)} | Return n characters from left side of field |
{f1.right(n)} | Return n characters from right side of field |
{f1.trim()} | Trim spaces from both sides of field |
{f1.toSql()} | Make field suitable for SQL string value |
{f1.toXml()} | Make field suitable for viewing as XML |
{f1.startsWith(s)} | Field starts with string s, i.e. f2.startsWith('Jo'). Returns true or false. |
{f1.endsWith(s)} | Field end with string s, i.e. f2.endsWith('son'). Returns true or false. |