Set locale in Aspose.Words for Java/JasperReports

Hi again,

I’ve noticed that all documents created by the libraries in object are set to be English language/locale, while I want them to be in Italian by default. How can I achieve this, if it is possible?

Hi,

If you specify that in your report, it is surely possible. I will this feature right now.

Thanks.

So is there a way to do it using Aspose.Words for JasperReports? Or is it a parameter to be set in the template itself?

I’ve searched in the documentation but found nothing. I think that this would be quite a useful feature because our customers surely wouldn’t like to see all their documents underlined in red because Word “thinks” that they are written in English, while they’re in Italian.

The easiest way I found (when doing that programmatically) is setting the locale right on the JasperPrint object before passing it to the exporter. Like the following:

JasperReport report = JasperCompileManager.compileReport(fullReportFileName);
JasperPrint print = fillReport(report, parameters, connectToDB);
print.setLocaleCode("it-IT");

When exporting reports via the JasperServer, you can set this parameter using a dropdown right below the login form.

BTW, please wait for a correct handling of locale in the next intermediate build I'm going to attach in the other thread (where you have provided new reports to test) very soon. I've discovered JasperReports replaces "-" to "_" in the locale string, I also took care of its case insensitivity.

Thanks.

Ok, for the time being, I’ll try your suggested code :slight_smile:


If that works, I’d call the issue solved, at least for me, but if you’re going to add it as a feature in your library, it’d be welcome!