Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0004683Openbravo ERPF. Localizationpublic2008-08-22 14:392009-04-21 11:06
gorka_gil 
Dowid 
normalmajoralways
closedfixed 
5
pi 
 
Core
No
0004683: In some jasper reports date format is hardcoded
In some jasper reports date format is hardcoded:

  <textField...pattern="dd/MM/yyyy"...>

The files are:

ad_reports/ReportAnnualCertification.jrxml
ad_reports/ReportGuaranteeDateJR.jrxml
ad_reports/ReportInvoiceCustomerJR.jrxml
ad_reports/ReportInvoicesEditJR.jrxml
ad_reports/ReportOrderNotInvoiceJR.jrxml
ad_reports/ReportPurchaseOrder.jrxml
ad_reports/ReportSalesOrderJR.jrxml
ad_reports/ReportShipmentEdition.jrxml
ad_reports/ReportTaxInvoicePurchase.jrxml
ad_reports/ReportTaxInvoicePurchaseForeign.jrxml
ad_reports/ReportTaxInvoiceSale.jrxml
ad_reports/ReportTaxInvoiceSaleForeign.jrxml
erpReports/C_OrderJR.jrxml
erpReports/ReportRegisterByVatJR.jrxml
erpReports/ReportRegisterLineJR.jrxml
erpReports/RptC_Invoice.jrxml
erpReports/RptC_OrderPO.jrxml
erpReports/RptC_Remittance.jrxml
erpReports/RptC_Remittance_Lines.jrxml
erpReports/RptM_Requisition.jrxml
Now, this reports has some parameters defined as date type, and in the jrxml is hardcoded the pattern that defines the format of the date.

A solution can be change the type of the parameters to string, and apply the date format in java and send the parameter as string to jasper.
No tags attached.
related to defect 0004668 closed gorka_gil Hardcoded date formats in manual src files 
depends on backport 0004813 closed Dowid In some jasper reports date format is hardcoded 
has duplicate defect 0005130 closed cromero Can't Print Invoice 
Issue History
2008-08-22 14:39gorka_gilNew Issue
2008-08-22 14:39gorka_gilAssigned To => cromero
2008-08-22 14:39gorka_gilsf_bug_id0 => 2067410
2008-08-22 14:39gorka_gilRegression testing => No
2008-08-25 16:34gorka_gilRelationship addedrelated to 0004668
2008-09-01 11:55psarobeStatusnew => scheduled
2008-09-01 11:55psarobefix_in_branch => trunk
2008-09-01 12:36gorka_gilfix_in_branchtrunk =>
2008-09-01 12:36gorka_gilSteps to Reproduce Updated
2008-09-04 10:02cromeroStatusscheduled => feedback
2008-09-04 10:02cromeroAssigned Tocromero => gorka_gil
2008-09-04 10:02cromeroSeverityminor => major
2008-09-04 10:03cromeroStatusfeedback => scheduled
2008-09-04 10:03cromerofix_in_branch => trunk
2008-09-05 17:30cromeroStatusscheduled => feedback
2008-09-05 17:31cromeroStatusfeedback => scheduled
2008-09-10 09:57cromeroStatusscheduled => feedback
2008-09-10 09:57cromeroStatusfeedback => scheduled
2008-09-29 12:31psarobeRelationship addedhas duplicate 0005130
2008-11-13 22:53rafarodaAssigned Togorka_gil => Hennadzi
2008-11-14 13:56gorka_gilNote Added: 0010282
2008-11-26 10:26PavelPonomarevAssigned ToHennadzi => Dowid
2008-12-02 13:27DowidNote Added: 0010885
2008-12-02 17:06svnbotCheckin
2008-12-02 17:06svnbotNote Added: 0010910
2008-12-02 17:06svnbotStatusscheduled => resolved
2008-12-02 17:06svnbotResolutionopen => fixed
2008-12-02 17:06svnbotsvn_revision => 10878
2009-04-21 11:06psarobeStatusresolved => closed

Notes
(0010282)
gorka_gil   
2008-11-14 13:56   
In some reports is enough to remove the pattern attribute, because the specified date format in "dateFormat.java" variable in Openbravo.properties is applied .

For example in ReportSalesOrderJR.jrxml in line 425 only removing:
  pattern="dd-MM-yyy"
is enough.
(0010885)
Dowid   
2008-12-02 13:27   
It's sufficient enough to remove pattern="dd-MM-yyy" in all reports, except for
ReportAnnualCertification.jrxml

For report ReportAnnualCertification.jrxml I propose to convert the java.util.Date into java.lang.String using the following code:

<parameter name="DateFormatter" class="java.text.DateFormat" isForPrompting="false">
    <defaultValueExpression>$P{REPORT_FORMAT_FACTORY}.createDateFormat("", $P{REPORT_LOCALE}, $P{REPORT_TIME_ZONE})</defaultValueExpression>
</parameter>


<textFieldExpression class="java.lang.String"><![CDATA[$P{DATEFORMATTER}.format(new Date())]]></textFieldExpression>


This code can be used in jasper reports to convert Date into String without "hardcoding" the date format.
(0010910)
svnbot   
2008-12-02 17:06   
Repository: openbravo
Revision: 10878
Author: dowid
Date: 2008-12-02 17:06:07 +0100 (Tue, 02 Dec 2008)

Bug fixed 0004683: In some jasper reports date format is hardcoded

---
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportAnnualCertification.jrxml
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportGuaranteeDateJR.jrxml
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerJR.jrxml
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportInvoicesEditJR.jrxml
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportOrderNotInvoiceJR.jrxml
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportPurchaseOrder.jrxml
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderJR.jrxml
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportShipmentEdition.jrxml
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoicePurchase.jrxml
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoicePurchaseForeign.jrxml
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoiceSale.jrxml
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoiceSaleForeign.jrxml
U trunk/src/org/openbravo/erpReports/C_OrderJR.jrxml
U trunk/src/org/openbravo/erpReports/RptC_Invoice.jrxml
U trunk/src/org/openbravo/erpReports/RptC_OrderPO.jrxml
U trunk/src/org/openbravo/erpReports/RptC_Remittance.jrxml
U trunk/src/org/openbravo/erpReports/RptC_Remittance_Lines.jrxml
U trunk/src/org/openbravo/erpReports/RptM_Requisition.jrxml
---

https://dev.openbravo.com/websvn/openbravo/?rev=10878&sc=1 [^]