java - JasperReports localization -


I am using JasperReports and want to create reports in different languages, but a problem happened .

And this is my code

  public void initQueryReport () throws JRException, ParseException {try {Map param = New HashMap (); Param.put ("DATE", date2); Fill1 = JasperFillManager.fillReport ("E: \ jasper reports \\ employees.jasper", ultimate, connection); } Hold (exception e) {System.out.println (); }} ServletResponse respnce; HTTP servlet liability; Public Zero PDF (ActionAvant Event) throws the xeroxation, IOexception, Pars Exception (try {initQueryReport ()}; Response = (ServletResponse) FacesContext.getCurrentInstance (). GetResponse (). GetResponse (); Resp = (HTTPSvote Response) Fessonteksktatntinstens (). GetExternalContext (). GetResponse (); respons.setContentType ( "application / pdf"); Respons.setHeader ( "content-displacement", "inline"); respons.setContentType ( "application / pdf") ; ServletOutputStream Out = response.getOutputStream (); JRPDF Exporter PDF = New H Earpeedif exporter (); Pdf.setParameter (JRExporterParameter.JASPER_PRINT, fill1); Pdf.setParameter (JRExporterParameter.OUTPUT_STREAM, out); pdf.exportReport ();} catch (Exception e) {e.printStackTrace ();}}   

I have created a property file with the name localizationdemo.prperties , which I want to use in the language and I will call this file src in the folder.

When I run the application and click on the link which gives an exception to the report:

  net.sf.jasperreports.engine.JRException: Exporter  the  

No input has not been the source when I run the application in debugging mode me the following exception Description:

  java.util.missingresourceexception base name locale Can not find bundle for en_us   

Please help me to solve this problem. And much more Thx

Are you sure that you set the resource bundle property to .jrxml file Is it seem like you have not set it in your java file?

If you are using Jasprsfoft studio in Jassprsft studio click on settings report name, then Property view menu to "report" Select and verify that property for the resource bundle (localization dome) under submenu 'dataset' is set in the appropriate properties file.

You can also see it in the source view, where it should be like this:

     

Further information:

Comments