Jump to content

Recommended Posts

Posted

Hello everybody.

How can I use brazilian portuguese number formatting on when i output PDF by java ? Java source is here.

public void JReportToPdf(java.lang.String pdfdir, java.lang.String japdir,

                     java.lang.String xmldir, String xmlnode) {

                   //Locale a = new Locale("POR");

                   Locale myLocale =new Locale("pt","BR"); //Portuguese

                   Map parameters = new HashMap();

                   parameters.put(JRParameter.REPORT_LOCALE, myLocale);

                   FileOutputStream os = null;

                   FileInputStream reportStream = null;

                   try {

                            os = new FileOutputStream(pdfdir);

                            reportStream = new FileInputStream(new File(japdir));

                            try {

                                     JRXmlDataSource xmlDataSource = new JRXmlDataSource(

                                                        new FileInputStream(new File(xmldir)));

                                     JasperRunManager.runReportToPdfStream(reportStream, os,

                                                        parameters, xmlDataSource);

                                     os.flush();

                                     os.close();

                            } catch (Exception e) {

                                     e.printStackTrace();

                            }

                   } catch (FileNotFoundException e) {

                            e.printStackTrace();

                   }

         }

 

Any help is appreciated.

Thanks in advance

 

GuoXC

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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