Hello!<br />
<br />
Back using BIRT after a six month absence.. <br />
<br />
I need to change the grouping separator when formatting a number from "," to " ". After googling this I found the following solution <a class='bbc_url' href='
http://www.eclipse.org/forums/index.php/mv/msg/197585/'>here:</a><br />
<br />
You can always replace the grouping separator in script as well. Select<br />
the data item or aggregation element and create the following onRender<br />
Script:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var aggval = this.getValue();
importPackage(Packages.java.text);
unusualSymbols = new DecimalFormatSymbols(reportContext.getLocale());
unusualSymbols.setDecimalSeparator('.');
unusualSymbols.setGroupingSeparator(' ');
patt = "###,###";
myForm = new DecimalFormat(patt, unusualSymbols);
myForm.setGroupingSize(3);
mystr = myForm.format(aggval);
this.setDisplayValue(mystr);
</pre>
<br />
But when I try to implement this, the number is formatted but I also get the following error:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>Wrapped java.lang.IllegalArgumentException: Cannot format given Object as a Number</pre>
<br />
I have ensured that the cell is a number, I have tried integer, decimal and float. Obviously aggval is not a number, but I don't understand why it reports this.<br />
It worked for a guy in the post, but I don't know why it does not work. Any ideas?<br />
<br />
Thanks, Stephen