Page 1 of 1

Conditional content issue

PostPosted: Wed Sep 23, 2015 1:27 am
by justauser
Hi,
I am trying to create a docx with conditional content using MERGEFIELD. When I specify : { IF { MERGEFIELD total } < 0 "NEGATIVE" "POSITIVE" } , the dox4j does not evaluate the expression nor recognizes the MERGEFIELD field.
What is wrong with the above expression?
Can someone give an example/docx-file with similar content like above?

Thanks in advance!

Re: Conditional content issue

PostPosted: Wed Sep 23, 2015 7:49 am
by jason
docx4j can process MERGEFIELD, see package https://github.com/plutext/docx4j/tree/ ... del/fields

but there is no stuff there to handle IF fields for you.

If you can use content controls instead of fields, an OpenDoPE conditional content control will do what you want.

I guess that's why nobody has bothered to write/contrib IF field functionality.