danutzzza Posted November 30, 2006 Share Posted November 30, 2006 Hello, A have a report with a database datasource. The database charset is iso-8859-1. The html result of the report does not show correctly the romanian characters (like ş, ţ, etc). What can I do? Thank you, Dana Link to comment Share on other sites More sharing options...
lucianc Posted December 4, 2006 Share Posted December 4, 2006 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 More sharing options...
danutzzza Posted December 7, 2006 Author Share Posted December 7, 2006 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 More sharing options...
danutzzza Posted December 7, 2006 Author Share Posted December 7, 2006 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 More sharing options...
lucianc Posted December 8, 2006 Share Posted December 8, 2006 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now