Jump to content
We've recently updated our Privacy Statement, available here ×

Changing number formats


sgarciaf

Recommended Posts

Hi,

I'm doing a report with some lists of numbers and they are showing with the format: 1,000.00

 & I want to show the numbers like 1.000,00

I tried to use as custom format in the pattern this:

##.#00,00

but it doesnt work, the report is not compiling after doing only this change.

 

Anyone can help me?

Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

uhm...

the char:
represents a grouping separator

.  represents a decimal separator...

so you can't exchange their position...

you must set a pattern like "##,#00.00" an the change the LOCALE according to the format you expect:

change the LOCALE from

- build-->setReportLocale-->choose one (from ireport 2 and similar)
- Tool-->Option-->Compilation and Execution-->Execution Option -->Select Report Locale (for ireprt 3.7 and siimilar)

 

(i prefer OLD VERSION of IReport...! )

 

 

 

_________________________________________

if it works... give me KARMA points please!    : ) 
_________________________________________

listening: MUSICA NUDA - Sacrifice

 

Link to comment
Share on other sites

Thanks Slow.

 

This solves the problem if I compile with iReports, but I'm compiling the report with a java application in a server...

I have the same problem with dates and the numbers in the charts...

I tried to put in the expression something like:

NumberFormat.getNumberInstance(Locale.GERMAN).format($V{numAyuMeasure})

But this only solves the numbers format and not the numbers in the chart and dates.

 

There's a way to set the Report Locale options in Java?

 

Well, at least I know what's the problem now...

Link to comment
Share on other sites

sorry, I thought the problem was the interface of iReport...

try putting this in the data map you pass when you compile and run the report:

Locale locale = new Locale("en", "US")  <--- change this.
metadata
.put(JRParameter.REPORT_LOCALE, locale);

 

remember KARMA points :)

 

 

_________________________________________

if it works... give me KARMA points please!    : ) 
_________________________________________

listening: Placebo - Where is my mind


 

 

 

Link to comment
Share on other sites

Thanks slow,

 

I set the parameter:

parameters.put("REPORT_LOCALE", new java.util.Locale("es", "ES")); //SPANISH

 

& now the numbers in the lists and in the crosstabs are showing ok, but the numbers in the charts (in the axis) are stil showing like 1,000.00).

 

I passed the REPORT_LOCALE to all my subreports (its a paremeter) and the same for all my queries (& in the charts I set the parameter), but it didnt work in charts.

 

Thanks.

Link to comment
Share on other sites

  • 5 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...