Page 1 of 1

format content controls

PostPosted: Mon Dec 15, 2014 11:50 pm
by surfspider
In my docx4j application a word template with content controls is filled with content form an xml data file (like in our webapp under https://github.com/plutext/OpenDoPE-WAR).

My data file includes unformatted data (i.e. a double field 123456.78910). This data should be formatted in the resulting world document (i.e. 123'456.79). How can I do this with content controls? Is it possible to mix it with mergefields or are there other possibilities?

Thank you in advance for your answer.

Re: format content controls

PostPosted: Tue Dec 16, 2014 8:50 pm
by jason
There is nothing in Microsoft Word (up to 2013) to format numbers in bound content controls (compare date controls).

We have an unpublished extension to the OpenDoPE conventions to do this, but its not public yet.

In the meantime, the easiest is a low tech approach: pre-process your XML part before injecting it, so the data is formatted as you require when its bound.