Jump to content
We've recently updated our Privacy Statement, available here ×

eduablitas

Members
  • Posts

    6
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by eduablitas

  1. I have a template whereI am trying to format a number(parameter1) The output in Excel is not the same as the output in PDF. Why? In Pdf, for the number 1000.44 with Locale Spanish, I see 1.000,44. If I select the Locale English, I see 1,000.44. Nice! However, in Excel, for the same number, no matter where you change the Locale, I always see the same format: 1.000,44. Why does this happen? Does the behavior should not be the same?This is my jrxml template: <?xml version="1.0" encoding="UTF-8"?><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report1" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="49e04c48-28fc-48ae-b818-9663713d7419"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <parameter name="parameter1" class="java.lang.Double"/> <variable name="variable1" class="java.lang.Double"> <variableExpression><![CDATA[$P{parameter1}]]></variableExpression> </variable> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"/> </title> <pageHeader> <band height="35" splitType="Stretch"/> </pageHeader> <columnHeader> <band height="61" splitType="Stretch"/> </columnHeader> <detail> <band height="125" splitType="Stretch"> <textField pattern="#,##0.00"> <reportElement x="0" y="0" width="100" height="20" uuid="b22d81d3-ee6b-4ae8-ae5a-e31a101e35d4"/> <textFieldExpression><![CDATA[$V{variable1}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="45" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="54" splitType="Stretch"/> </pageFooter> <summary> <band height="42" splitType="Stretch"/> </summary></jasperReport>[/code] Please Help me! Thanks!
  2. Hi all! I am developing an application that combine 2 languages, spanish and english. The user can select english for texts and spanish to show dates and numbers in spanish format. So in my reports i have to implement that functionality. I send me one parameter called "LOCALE_NUMBER_DATES" that its a simple String like "ES" or "EN" My first solution was to apply a format in the "Text Field Expression" like this: $P{LOCALE_NUMBER_DATES}.equalsIgnoreCase( "EN" )? new java.text.DecimalFormat("###,##0.00", new java.text.DecimalFormatSymbols(java.util.Locale.ENGLISH)).format($F{certificationSummary}.getProductiveHoursTotal())+ " " + $P{CURRENCY} : new java.text.DecimalFormat("###,##0.00", new java.text.DecimalFormatSymbols(java.util.Locale.ITALIAN)).format($F{certificationSummary}.getProductiveHoursTotal())+ " " + $P{CURRENCY} :"" Its work! but Excel cells dont recognize number formats so i had to change the solution. To make sure that Excel recognizes Number (or dates) formats i had to delete my textfield expression and delegate to a "Pattern" on textfield and i thought that "Pattern expression" helps me but i do not get my purpose. In "Pattern expression" i use a variable called "LocaleNumbers" that expression is: $P{LOCALE_NUMBER_DATES}.equalsIgnoreCase("ES")? new DecimalFormat("###,##0.00", new java.text.DecimalFormatSymbols(java.util.Locale.ITALIAN)).toPattern():new DecimalFormat("###,##0.00", new java.text.DecimalFormatSymbols(java.util.Locale.ENGLISH)).toPattern() but its not work! I think because that expression returns always the same String and then Jasper get the "REPORT_LOCALE" global parameter and apply .format() function. Am i right? If yes... Does anyone know any other way to achieve this? Can someone write an example of use of "Pattern Expression" ?? I not see nothing in Jasper Sample Project. Thanks in advance
  3. Nothing? No way that the report working with multiple languages ​​simultaneously?. I try to do it with subreports but i have the same problem. I can't set REPORT_LOCALE to subreport without changing the main report "REPORT_LOCALE" parameter. Any way to do that? Please need help!!
  4. My question is: "REPORT_LOCALE" parameter of main report is different to the "REPORT_LOCALE" of a subdataset? If yes, how to change REPORT_LOCALE param of my subdataset
  5. Hi and thanks in advance. I wonder if its possible to have the main report in spanish HashMap<String,Object> params = new HashMap<String,Object>();[/code]params.put("REPORT_LOCALE", new java.util.Locale("ES");[/code]JasperPrint print = JasperFillManager.fillReport(report,params,ds);// ds is a JRBeanCollectionDataSource with list of one ReportBean[/code]The structure of ReportBean is: OtherBean attribute1List<OtherBean2>attribute2Then i design to show the attribute2 data with a table object in iReport with one subdataset This list i send to iReport like a parameter in main report like this: params.put("myDsTableParam", new BeanDataSource(listOfBeans);//where "BeanDataSource" is a implementation of JRDatasource and lisfOfBeans is the list to send the table in iReport[/code]So i wonder if its possible to send my 2nd locale (english) to my dataset and get that i want that its text in my report from a message resource file ( $R{message.someKey} ) in spanish and data in table details with english locale language to show number in english formats. Its possible?? Regards and sorry for me english :(
×
×
  • Create New...