开发者

how to customize the pattern of a field in iReport?

Hi StackOverflow experts, I've darag n' droped a field into the iReport. This field holds the java.lang.BigDecimal expression class data returned by Query of the Report. In the MSSQL DataBase table this field has开发者_运维百科 been defined as money. I've defined the pattern of this field as #,###0.00 separate the digits by comma from Right to Left order at each 3 digits(eg. 12,332,324.20).But I want the digits to be separated by comma in same order but at 3 digit interval for first time and at 2 digit interval for remaining digits(For eg.1,23,32,324.20). Please, suggest me.


You can use any java expression as the value. For instance, you can use this as the value:

"Report between " + new SimpleDateFormat("dd.MM.yyyy").format($P{startDate}) + " and " + new SimpleDateFormat("dd.MM.yyyy").format($P{endDate})

but be careful of null pointer exceptions.

$P{xxx} is a parameter to the report. $F{yyy} is the field/column in the report.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜