| Author |
Message |
|
|
Post subject: Use arabic Language with JasperReport
Posted: Mar 02, 2005 - 06:06 AM
|
|
|
|
We use Jasper Report with WSAD 5.1.1,
We were integrate Jasper Report on WSAD, and we use Jasper Report without problems when we use French language, but when we use Arabic language, we can see on the preview report (development environment) but on the browser all the Arabic word appear in this format “????????”.
Can you help us to resolve this problem?
How to create a report in Arabic language with Jasper Report?
Thank you for your collaboration |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Mar 02, 2005 - 01:23 PM
|
|

Joined: Feb 12, 2004
Posts: 519
|
|
Hi,
It looks like a font problem or html page encoding issue. A possible
solution to this is unicode. When doing the export, you should set the
character encoding (JRExporterParameter.CHARACTER_ENCODING) to UTF-8 and
pass an OutputStream (not a writer) to the exporter.
I hope this helps,
Peter Severin
- JasperAssistant Team |
_________________ JasperAssistant Report Designer for JasperReports
http://www.JasperAssistant.com
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jul 05, 2005 - 05:46 AM
|
|

Joined: Jun 27, 2005
Posts: 2
|
|
how _? do you i must set encoding of html page to UTF-8 ; it is iso-8859-9 ; is it problem _? or where must i set utf-8 as encoding .
default font in jrxml is font1 ( font arial , pdf encoding helvetica )
all of text fields use this font1 ,
encoding of jrxml file is utf-8 ( i try it with iso-8859-9 but no changes )
my jsp-servlet application encoding is iso-8859-9
jrxml file's locale is tr ( or tr_TR , it doesnt matter ) ,
so where must i set as utf-8 _?
if you reply ; i will be very happy ... |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 27, 2005 - 05:40 AM
|
|
|
|
Try this Java code (it worked for Croatian letters):
ReportVO vro = forma.getReportVO();
JRHtmlExporter exporter = new JRHtmlExporter();
exporter.setParameter(JRExporterParameter.CHARACTER_ENCODING,"UTF-8");
makeResponse(response, JasperReportConstants.FORMAT_HTML);
JasperReport report = (JasperReport) JRLoader.loadObject(new ByteArrayInputStream vro.getJasperExecutable()));
JRQuery q = report.getQuery();
JasperPrint jasperPrint = JasperFillManager.fillReport(report,parameters, conn);
exporter.setParameter(JRExporterParameter.JASPER_PRINT,jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM,response.getOutputStream());
exporter.exportReport(); |
|
|
| |
|
|
|
 |
|
|
Post subject: i am not able to print arabic numerics but characters can be
Posted: Oct 07, 2005 - 05:23 AM
|
|
|
|
hi
i set chatacter encoding to utf-8 and fontName to arabic transperant but only characters are comming but not numerics is there is any changes should i make to change plz help me
thanx in advance |
|
|
| |
|
|
|
 |
|
|
|
Post subject: Chinese Char in Reports
Posted: Jan 08, 2006 - 08:33 PM
|
|
Joined: Jan 06, 2006
Posts: 6
|
|
Hi,
My JAVA coding to generate a PDF report is like this.
JasperCompileManager.compileReportToFile(dirName+"invoiceReport.jrxml");
JRDataSource jrDataSource = new JRBeanCollectionDataSource(invList);
parameters.put("N","NAME");
parameters.put("D","DESIGN");
bytes = JasperRunManager.runReportToPdf(dirName+"invoiceReport.jasper",parameters,jrDataSource);
request.setAttribute("REQUEST_report", bytes);
And in my JSP coding
<HTML>
<BODY>
<%
byte[] bytes = (byte[])request.getAttribute("REQUEST_report");
response.setContentType("application/pdf");
response.setContentLength(bytes.length);
ServletOutputStream outStream = response.getOutputStream();
outStream.write(bytes,0,bytes.length);
outStream.flush();
outStream.close();
%>
</BODY>
</HTML>
like this.
In this way of reporting i cannot display CHINESE Char. Instead of that Unicode charecters are displaying.
Please guide me to solve this problem
Thanks&Regards,
Suresh |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: May 02, 2006 - 05:00 AM
|
|
|
|
hi, guys
I have the same problem to display Arabic in jdf format on the browser. It works fine if I use JasperViewer.
Anyone can help?
here is my code:
InputStream nputStream=JRLoader.getResourceInputStream("test2/TEST1.jasper");
jasperReport=(JasperReport)JRLoader.loadObject(inputStream
Map parameters = new HashMap();
Locale currentLocale = new java.util.Locale("ar", "SA");
ResourceBundle resourceBundle = ResourceBundle.getBundle("test2.TEST1", currentLocale);
parameters.put("REPORT_LOCALE",currentLocale);
parameters.put("REPORT_RESOURCE_BUNDLE",resourceBundle);
parameters.put("CASE_NO", "006731542");
DatabasePool databasepool=DatabasePool.getInstance();
Connection conn=databasepool.getConnection();
jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, conn);
pdfExporter=new JRPdfExporter();
pdfExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); pdfExporter.setParameter(JRExporterParameter.CHARACTER_ENCODING,"UTF-8");
pdfExporter.setParameter(JRPdfExporterParameter.CHARACTER_ENCODING, "UTF-8"); pdfExporter.setParameter(JRExporterParameter.OUTPUT_STREAM,outputstream);
pdfExporter.exportReport(); |
|
|
| |
|
|
|
 |
|
|
Post subject: hello
Posted: Jul 28, 2006 - 02:43 AM
|
|
|
|
phentermine pill xenical can buy phentermine home phentermine phentermine mg phentermine and guarantee buy a substitute for weight free prescription important phentermine diet and buy pill generic phentermine online online what are the online cheap phentermine without gt online prices cheap now 149 online shipping 112 cod online indexbuy no
<a href="http://phenik.info">Buy Phentermine</a>, http://phenik.info,Buy Phentermine
xanax diet pill
<a href="http://sys.forumup.org/">buy xanax</a>,http://sys.forumup.org/,buy xanax |
|
|
| |
|
|
|
 |
|
|
Post subject: hello
Posted: Jul 28, 2006 - 02:44 AM
|
|
|
|
phentermine pill xenical can buy phentermine home phentermine phentermine mg phentermine and guarantee buy a substitute for weight free prescription important phentermine diet and buy pill generic phentermine online online what are the online cheap phentermine without gt online prices cheap now 149 online shipping 112 cod online indexbuy no
<a href="http://phenik.info">Buy Phentermine</a>, http://phenik.info,Buy Phentermine
xanax diet pill
<a href="http://sys.forumup.org/">buy xanax</a>,http://sys.forumup.org/,buy xanax |
|
|
| |
|
|
|
 |
|
|
Post subject: a code that works (for met at least)
Posted: Jan 20, 2008 - 06:22 PM
|
|
Joined: Jan 20, 2008
Posts: 1
|
|
Just like you I faced the same problem, found some help here as well as other places, once I got it to work I thought I should save someone else's some time
here's a snippet that works on
WAS 5.0.2 using JR 0.6.1 (quite old, I K.N.O.W.)
| Code: |
try {
response.setContentType("text/html; charset=UTF-8"); //this what goes into the HTML code, depends on the browser to pick the default encoding between this value and that of the header, for IE6.0 header value was necessary
response.setLocale(new Locale("ar", "BH")); //"ar" is essential, "BH" is circumstantial, without this string translation will not occur and you would get the "???"
response.setHeader("content-type", "text/html; charset=UTF-8");//found this to be mandatory with IE 6.0
JRHtmlExporter exporter = new JRHtmlExporter();
exporter.setParameter(JRExporterParameter.CHARACTER_ENCODING, "UTF-8");//no brainer for all UTF-8 reports
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); //jasperPrint is a readily filled report object
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, response.getOutputStream());
exporter.exportReport(); //perform the export itself
} catch (Exception e) {
e.printStackTrace(); //Don't use in production, do something meaninful
}
|
Hope this helps someone
take care
Salam
ZizoV |
|
|
| |
|
|
|
 |
|
|