PDA

View Full Version : Spring jasper report unicode problem


raquib.mahmood
Aug 11th, 2007, 02:30 AM
Hi,
I am using jasper report with spring web mvc. I trying to view a report containing bangla unicode font.I am using html view.The report shows properly when i am viewing it iReport or generate html from iReport.I tried to pass the font in fontkey parameter in model object but it is not working.
It's urgent for me.

Thanks
Raquib Mahmood Shoeb

dr_pompeii
Aug 11th, 2007, 10:02 AM
if you can share importants part of your code configuration
and merge log4j/jasperreports

maybe appear some detail hidden thete

regards

raquib.mahmood
Aug 13th, 2007, 06:36 AM
my code for generating html view

FontKey key = new FontKey("JatiyoLipi", false, false);
Font f = new Font(baseFont);
model.put(key, f);

but if the font is already installed in the system then html should display the text.
When i am trying to display unicode font in desktop application i am passing jvm parameters to run the java file in utf-8.
Is this an issue in web application?
The same font is displaying properly in jsp pages of the application.
All the pages encoding is in UTF-8 including html reports.
I did compare the two files ireport generated html and spring generated html both are same in code except bangla texts.

Thanks
Raquib Mahmood Shoeb

dr_pompeii
Aug 13th, 2007, 09:34 AM
hello

i never tried to change into my projects the font, i use the default used by IReport

i send in this way some parameter for the jasper file


Map<String,Object> parameterMap = new HashMap<String,Object>();
parameterMap.put("fecha1", date1);
parameterMap.put("fecha2", date2);
parameterMap.put("datasource", jRBeanCollectionDataSource);
mav = new ModelAndView("historialpreciosarticulocompletofechasjasperreport",parameterMap);


now with you code

FontKey key = new FontKey("JatiyoLipi", false, false);
Font f = new Font(baseFont);
model.put(key, f);

i guess that your font is added to your "model and view" variable right?

i think that would be the problem, the font should be added to your jasper file

i had some weird problem in this way, in IReport works fine all, but when i use the same jasper with spring, instead the see in the jsp html-report option white spaces
i see missing photos that represent the white spaces :rolleyes:

HTH

regards