Search code examples
docxxdocreport

XDocReport number formatting in table


I have a template, where I have a table with column which I want to format as currency (2 decimal places). I'm using Velocity and NumberTool, which is putted in context.

I tried to use <<$number.format("currency", $My_data)>> in template, but as result I got empty column.

Is there some possibility to format list field in table without writing e.g. new foreach? Is some function which can be use in tempate to format field in one column?

Regards


Solution

  • I resolve it by myself.

    I must just override VelocityTemplateEngine and Formatter to recognize phrases like <<$numberTool.format($My_data)>>, becouse default formatter was looking for field name after first '$'.