Jump to content

i18n problem--Pleazzzzzzzz help


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.

 

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 4
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

 

The question is: do you have text fields that sometimes display English and other times display Japanese?

Or can you say that English and Japanese text fields are separate and always display text in the same language?

 

If they are separate, then you can define special fonts for each of the two text fields types. Fonts to be used by English text fields and fonts to be used by Japanese text fields. Those fonts (or rather report styles as they are known lately) can have the appropriate pdfFontName, pdfEncoding and isPdfEmbedded attributes.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

Hi Teodord,

 

Thanks a lot for your reply.

I will explain my requirement a bit more.

I know I can set the pdffontname etc for a text field. In my application there are two locales. one is english & the other is japaneese. So, when the locale is english the reports come up fine with verdana as font.(I have downloaded verdana.ttf as my pdffont.) However, this font does not show japaneese characters when the locale is japan & report reads the japaneese property file. For that if I make my pdf font as MSMincho or MsGothic...the report displays in both english & japaneese(as per the locale). However, my client does not want the font to be MSMincho for english reports. He wants the font to be vardana if the locale is english & MSMnicho when the locale is Japan. Would u suggest me a way to solve this problem?

Please help Teodor.

 

Thanks & Regards,

MS.

Link to comment
Share on other sites

Hi,

 

As I mentioned on the other message post, you should map the fonts at export time using the FONT_MAP exporter parameter, like shown in the /demo/samples/fonts sample provided with the project.

With font maps you have the chance of changing the PDF related font settings depending on the locale.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

  • 1 year later...

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