details:   https://code.openbravo.com/erp/devel/pi/rev/46c71bc865ae
changeset: 26619:46c71bc865ae
user:      Jorge Garcia <jorge.garcia <at> openbravo.com>
date:      Tue May 12 17:14:50 2015 +0200
summary:   Fixed issue 29847: Applied bad format number when running Payment 
Report in PDF

Decimal and Grouping separators defined in Format.xml are not applied when
running Payment Report in PDF.

The solution is to fix the Payment Report number format in the jrxml file.
Also, a new parameter must be added to the Report.

Now, all the number fields of the report are formatted as the Format.xml
definition.

diffstat:

 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml
 |  15 ++++++----
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (62 lines):

diff -r e8bebe16d4bf -r 46c71bc865ae 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml
--- 
a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml
       Tue May 12 14:03:06 2015 +0530
+++ 
b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportPDF.jrxml
       Tue May 12 17:14:50 2015 +0200
@@ -62,6 +62,9 @@
        <parameter name="PAYDATETO_SHOW" class="java.lang.String"/>
        <parameter name="EXPECTEDDATEFROM_SHOW" class="java.lang.String"/>
        <parameter name="EXPECTEDDATETO_SHOW" class="java.lang.String"/>
+       <parameter name="NUMBERFORMAT" class="java.text.DecimalFormat">
+               <defaultValueExpression><![CDATA[new 
DecimalFormat()]]></defaultValueExpression>
+       </parameter>
        <queryString>
                <![CDATA[SELECT 'hello' AS BP_GROUP, 'hello' AS BPARTNER, 
'hello' AS PROJECT, 'hello' AS PAYMENT, 'hello' AS SALES_PERSON, 1234 AS 
INVOICE_NUMBER, to_Date('01/01/2010') AS INVOICE_DATE,
        to_Date('01/03/2010') AS DUE_DATE, 1234 AS PLANNED_DSO, 1234 AS 
CURRENT_DSO, 1234 AS OVERDUE, 1234 AS DAYS_OVERDUE, 1234 AS AMOUNT,
@@ -364,18 +367,18 @@
                                        <text><![CDATA[Balance:]]></text>
                                </staticText>
                                <textField isBlankWhenNull="true">
-                                       <reportElement key="textField-19" 
style="Detail_Header" x="459" y="0" width="33" height="20"/>
+                                       <reportElement key="textField-19" 
style="Detail_Header" x="479" y="0" width="37" height="20"/>
                                        <textElement textAlignment="Justified">
                                                <font fontName="DejaVu Sans" 
size="10"/>
                                        </textElement>
                                        <textFieldExpression 
class="java.lang.String"><![CDATA[$F{BASE_CURRENCY}]]></textFieldExpression>
                                </textField>
                                <textField evaluationTime="Group" 
evaluationGroup="GroupingCriteria" isBlankWhenNull="true">
-                                       <reportElement key="textField-19" 
style="Detail_Header" x="407" y="0" width="52" height="20"/>
+                                       <reportElement key="textField-19" 
style="Detail_Header" x="407" y="0" width="72" height="20"/>
                                        <textElement textAlignment="Right">
                                                <font fontName="DejaVu Sans" 
size="10"/>
                                        </textElement>
-                                       <textFieldExpression 
class="java.lang.String"><![CDATA[($V{SUMBALANCE}!=null)?$V{SUMBALANCE}.toString():new
 String(" ")]]></textFieldExpression>
+                                       <textFieldExpression 
class="java.lang.String"><![CDATA[($V{SUMBALANCE}!=null)?$P{NUMBERFORMAT}.format($V{SUMBALANCE}).toString():new
 String(" ")]]></textFieldExpression>
                                </textField>
                        </band>
                </groupHeader>
@@ -576,7 +579,7 @@
                                        <textElement textAlignment="Right">
                                                <font fontName="DejaVu Sans" 
size="10"/>
                                        </textElement>
-                                       <textFieldExpression 
class="java.lang.String"><![CDATA[($V{SUMSUBTOTALSTATUS}!=null)?$V{SUMSUBTOTALSTATUS}.toString():new
 String(" ")]]></textFieldExpression>
+                                       <textFieldExpression 
class="java.lang.String"><![CDATA[($V{SUMSUBTOTALSTATUS}!=null)?$P{NUMBERFORMAT}.format($V{SUMSUBTOTALSTATUS}).toString():new
 String(" ")]]></textFieldExpression>
                                </textField>
                        </band>
                </groupFooter>
@@ -828,7 +831,7 @@
                                <textElement textAlignment="Right">
                                        <font fontName="DejaVu Sans" size="8"/>
                                </textElement>
-                               <textFieldExpression 
class="java.lang.String"><![CDATA[($F{BASE_AMOUNT}== null ? " " : 
$F{BASE_AMOUNT}.toString())]]></textFieldExpression>
+                               <textFieldExpression 
class="java.lang.String"><![CDATA[($F{BASE_AMOUNT}== null ? " " : 
$P{NUMBERFORMAT}.format($F{BASE_AMOUNT}).toString())]]></textFieldExpression>
                        </textField>
                        <textField isBlankWhenNull="false">
                                <reportElement key="textField-14" 
style="Report_Footer" x="730" y="0" width="50" height="25"/>
@@ -843,7 +846,7 @@
                                <textElement textAlignment="Right">
                                        <font fontName="DejaVu Sans" size="8"/>
                                </textElement>
-                               <textFieldExpression 
class="java.lang.String"><![CDATA[$F{TRANS_AMOUNT}.toString() + " 
"]]></textFieldExpression>
+                               <textFieldExpression 
class="java.lang.String"><![CDATA[$P{NUMBERFORMAT}.format($F{TRANS_AMOUNT}).toString()
 + " "]]></textFieldExpression>
                        </textField>
                        <textField isBlankWhenNull="false">
                                <reportElement key="textField-16" 
style="Report_Footer" x="593" y="0" width="60" height="25"/>

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to