Jasper reports not showing labels in Arabic

0

Hello All,

I have a problem with jasper reports when generating PDF reports in arabic. In English the report is generated fine but in arabic the labels that come from a property file are coming up as empty. The problem started coming when we tried to build the ear file and the whole application through maven. previously we were doing builds through eclipse but we needed to automate it so we used maven. this is only happening in reports. the rest of the arabic site is working fine i am sure it is only in the PDF reports that this is happening. the excel report is coming as it should be. 

All the labels are coming from a property file which is the same when the site is swtched to arabic and arabic site is working fine as well. The data in the arabic reports is coming fine as it is in English but the labels that should come from a properties file is not coming at all like headings or the title they are just empty.

Appreciate any help or pointers on what might be causing this. 

 

Thanks in advance.

Syed.

 

 

sarmahdi's picture
Joined: Apr 21 2013 - 12:20am
Last seen: 6 years 11 months ago

2 Answers:

1
jasper support only one font for arabic text(DejaVu Sans)
omarntfs's picture
Joined: Jul 11 2012 - 6:25am
Last seen: 2 years 10 months ago
0

After all workarounds, i am able to fix this issue in Jasper ireport as follows

In Text Properties of jrxml:

Font Name : Arial

Pdf Font Name : ../arial.ttf

Pdf Embedded : true

Pdf Encoding : Identity-H

-------------------------------------------------------

In your Project META-INF folder

Create and Add reports folder containing arial.ttf files and font.xml

Outside META-INF folder, add jasper-extensions.properties file

So finally,  

jasper-extensions.properties --- Uses --- fonts.xml --- Uses --- true type font files   

jasper-extensions.properties file --> fonts.xml ---> arial.ttf 

The syntactical contents of

Font.xml:

<?xml version="1.0" encoding="UTF-8"?>
   <fontFamilies>
<fontFamily name="Arial">
       <normal><![CDATA[META-INF/reports/fonts/arial.ttf]]></normal>
       <bold><![CDATA[META-INF/reports/fonts/arialbd.ttf]]></bold>
       <italic><![CDATA[META-INF/reports/fonts/ariali.ttf]]></italic>
       <boldItalic><![CDATA[META-INF/reports/fonts/arialbi.ttf]]></boldItalic>
       <pdfEmbedded><![CDATA[true]]></pdfEmbedded>
   </fontFamily>
</fontFamilies>

jasper-extensions.properties :

net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
net.sf.jasperreports.extension.simple.font.families.myfamily=META-INF/fonts.xml

 

Regards,

Satish M Hiremath

satishmhiremath's picture
Joined: Sep 29 2016 - 7:06am
Last seen: 2 years 6 months ago
Feedback