Jump to content
Changes to the Jaspersoft community edition download ×

???????HELPPPPPPPP NEEDED


mana_singh01

Recommended Posts

Hi all,

 

I have a requirement for i18n.

My reports have to be in english & japaneese both & they are exported in pdf

& xls.

For a text field I want to have a different font for the different locale.

 

I am trying to do something like this in text field expression:

 

($P{REPORT_LOCALE}.toString().equals(Locale.JAPANESE.toString())?($R{part.la

bel}.setPdfFontName("msmincho.ttc"))$R{part.label}.setPdfFontName("Verdana

.ttf")))

 

However, This thing does not work as partlabel string does not have a method

like setpdffontname.

 

I have also tried doing this in my pdf servlet:

on the condition of checking locale. if locale is english then use the below style with font as verdana else if the locale is japan then use the font as msmincho.ttc.

 

JRStyle style = jasperReport.getStyles()[0];

style.setPdfFontName("Verdana.ttf");

style.setPdfEncoding("IDENTITY_H");

style.setPdfEmbedded(false);

style.setFontSize(10);

jasperPrint.setDefaultStyle(style);

 

However, it only changes the font properties for the font which is specified in jrxml & does not do anything with regard to the Font. does not change the font depending upon locale. what do i do now?

:(:(

Please help me, it's very urgent.

 

I have been trying for long for this to happen.

 

Thanks & Regards,

MS.

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

 

You should change the PDF font attributes at export time using the FONT_MAP exporter parameter, like shown in the /demo/samples/fonts sample provided with the project.

 

I hope this helps.

Teodor

 

P.S. Please do not post the same question over and over again on the forums. Posting it once should be enough.

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