javainternationalizationjasper-reportsreportviewerarabic

Jasper Report arabic query problem


I'm trying to make a report in jasper the report query contains this where statement

where payment='شيك'

when I try to run the report using the JRViewer300 I got the following exception

net.sf.jasperreports.engine.fill.JRExpresssionEvalException : Error evaluating expression...

When I change the where statement to

where payment='cheque'

the report runs without any problem. So what is all this about?

Thanks


Solution

  • I assume that the database is set to work with UNICODE encoding, In Java you need to escape the input string (treat special chars) and turn the encoding to UTF-8 ( or 16) Check this out.

    ...and also try this:

    exporter.setParameter(JRExporterParameter.CHARACTER_ENCODING, "UTF-8");