In XDocReport, how to handle null value? -


is there way handle null value field in xdocreport? or need manipulate on own? example:

if (thisvar == null)   context.put("sampletext", ""); else   context.put("sampletext", thisvar); 

or there option in docx quick parts?

i found line in error message of xdocreport. not understand apply this, in template or in code.

tip: if failing expression known legally refer that's null or missing, either specify default value myoptionalvar!mydefault, or use [#if myoptionalvar??]when-present[#else]when-missing[/#if]. (these cover last step of expression; cover whole expression, use parenthesis: (myoptionalvar.foo)!mydefault, (myoptionalvar.foo)??

in docx, append ?if_exists field name

«${tx.amount?if_exists}»

you may append !

«${tx.amount!}»

please refer link uses freemarker. how check if variable exists in freemarker template?


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -