Jump to content
Changes to the Jaspersoft community edition download ×

Database charset problem


danutzzza

Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Afaik, iso-8859-1 doesn't contain Romanian letters (except â and î, which are also used in French and other european languages). Are you sure your database properly stores Romanian strings?

 

Regarding the HTML output, you should check that the content charset (http-equiv="Content-Type") matches the actual page output encoding.

 

Regards,

Lucian

Link to comment
Share on other sites

The database is Oracle. I am sure that it stores the romanian caracters corectly beacause they are displayed correcty by my web application that reads them from the database.

 

I have created a jrxml report that hase an sql that selects data from the database. I have set the report encoding to iso-8859-2:

 

<property name="ireport.encoding" value="ISO-8859-2" />

 

 

I fill the report like this:

 

parameters.put(JRParameter.REPORT_LOCALE, new Locale("ro", "RO","") );

jasperPrint = JasperFillManager.fillReport( jasperReport, parameters, conn);

 

And then I export the report to html like this:

 

JasperExportManager.exportReportToHtmlFile(jasperPrint, htmlReportsPath + reportName + ".htm");

 

When I look at the html source the romanian caracters are all replaced by question marks (?)

 

What can I do to display them correctly?

 

Thank you,

 

Dana

Link to comment
Share on other sites

Hello,

 

I also tried to modify the Jasper source JRHtmlExporter, and I added the following line to the exportReportToHtmlFile method:

 

exporter.setParameter(JRExporterParameter.CHARACTER_ENCODING, "ISO-8859-2");

 

but the result was the same: a lot of question marks in the output.

 

Dana

Link to comment
Share on other sites

If you preview the report using JasperViewer, does the text display properly?

 

You could use a binary text editor to investigate the HTML file contains and decide whether the Romanian characters are encoded according to the encoding you specified (ISO-8859-2). And, again, check that the HTML content charset matches this encoding.

 

Regards,

Lucian

Link to comment
Share on other sites

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...