Document Generation Engine – Updates

2 February 2016

In December we updated the core Docmosis document generation engine.

The core engine update means that the new features are available across all three products: Docmosis-Java, Tornado and our Cloud service.

Lets have a closer look at what’s new…

Firstly, the new features are available from the versions shown below or later…

Docmosis-Java : Version 4.0.0
Tornado : Version 2.0
Docmosis-Cloud : Version 1.5

The update adds new and improved syntax that you can use in your templates to perform math and logic processing, string operations, number formatting and more.

To instruct Docmosis that a field contains an expression that needs to be evaluated you just wrap the expression in curly brackets, so the when combined with the field you get: <<{ …expression… }>>.

Here are a couple of practical examples…

Expressions – Math

The latest update allows you to easily perform math functions from within your templates.

Example 1:

<<{1+2+3}>> will result in the sum: 1+2+3, being evaluated and the result of “6” being displayed in the document.

Example 2:

If you are creating an invoice and the input data only has values for Price and Quantity.

You can calculate the total price in the template like this: <<{Price*Quantity}>>.

Expressions – Strings

Data may not come exactly as you want to display it. The latest update includes a number of String functions for formatting your data.

Example 3:

The data contains names and some are lower cases: “name”=”bob mathews”.

To be sure it always displays with Capitals you can use: <<{titleCase(name)}>>

Which will result in displaying: Bob Mathews.

Formatting Numbers

Numbers may need to be formatted for display.

Example 4:

The data contains a price as a raw number: “price”=”1632.5”.

Using the numFormat function you can change this to: $1,632.50

Like this: <<{numFormat(price,’$#,###.00)}>>

Example 5:

The data contains numbers with many decimal places: “area”=”1.1828284793985”.

Using the numFormat function you can restrict this to four decimal places: 1.1828

Like this: <<{numFormat(area,’#.0000′)}>>

We hope you like the new features.