0

I am trying to show JasperReports report from web application which content some marathi (indian regional language) text.

When I run preview in iReport it looks perfect but when I try it from web application to view report as in pdf format then text not shown.

Here is what I try to do.

ServletContext context = getServletContext();
InputStream is = context.getResourceAsStream("report/name.jasper");

Map param = new HashMap();
param.put("para", "1");

byte[] bytes = JasperRunManager.runReportToPdf(is, param, con);
response.setContentType("application/pdf");
response.setContentLength(bytes.length);
ServletOutputStream outStream = response.getOutputStream();
outStream.write(bytes, 0, bytes.length);
outStream.flush();
outStream.close();

I also suggested that to add jasperreports.properties are as follows

net.sf.jasperreports.default.pdf.encoding=Cp1250

but when I use this property text shows like "?????"

This is the preview from iReport: This is the preview from jasper ireport

This is the preview when I shown report as pdf from my web application: This is the preview when I shown report as pdf from my web application

This is preview when I use net.sf.jasperreports.default.pdf.encoding=Cp1250 This is preview when I use net.sf.jasperreports.default.pdf.encoding=Cp1250

Cœur
  • 37,241
  • 25
  • 195
  • 267
Nilesh12
  • 99
  • 1
  • 2
  • 15
  • 2
    Did you use the [Font Extensions](http://jasperreports.sourceforge.net/sample.reference/fonts/index.html#fontextensions)? – Alex K Jan 15 '14 at 09:36
  • no.. i retrived field from database – Nilesh12 Jan 15 '14 at 10:32
  • I did not ask you about using datasource (database)... – Alex K Jan 15 '14 at 11:47
  • no i didn't use font extensions..is it necessory??? i dnt know how to use it in jasper report – Nilesh12 Jan 15 '14 at 11:51
  • You can find some information in [Use custom fonts when creating pdf using iReport](http://stackoverflow.com/q/8985497/876298) post – Alex K Jan 15 '14 at 12:08
  • k bro i have tried many font but it didn't work for me. may be it happen because i have make use of google input languge to store regional language field in database. – Nilesh12 Jan 16 '14 at 04:19
  • **Please Give Some Reply To Solve This Problem. I am retriving unicode string from database ex. in database feild it stored like this मराठी and when i try to retrive in jasper report as pdf it shows none** – Nilesh12 Jan 16 '14 at 09:23

0 Answers0