diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2011-03-21 17:02:20 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2011-03-21 17:02:20 +0100 |
commit | ea06b726332419c28cc5e4d7895eb54ceb6cf8c6 (patch) | |
tree | 00de6c66e6e77deb28ac741fa1590864f7ea66b8 | |
parent | dff4613b22cf811fdeb732ed527e0b113c2259aa (diff) | |
parent | 3a8d9b1c77ecee0ddfac0a32acbabd6576e43993 (diff) |
CWS-TOOLING: integrate CWS dba34cooo/DEV300_m104
-rwxr-xr-x | reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java index 57e8585..773d49f 100755 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java @@ -29,6 +29,7 @@ package com.sun.star.report.pentaho.layoutprocessor; import com.sun.star.report.OfficeToken; import com.sun.star.report.pentaho.OfficeNamespaces; import com.sun.star.report.pentaho.model.FormattedTextElement; +import java.math.BigDecimal; import java.sql.Time; @@ -46,7 +47,6 @@ import org.jfree.report.flow.layoutprocessor.LayoutControllerUtil; import org.pentaho.reporting.libraries.formula.util.HSSFDateUtil; - /** * Creation-Date: 06.06.2007, 17:03:30 * @@ -125,18 +125,31 @@ public class FormatValueUtility } else if (value instanceof java.sql.Date) { - if ( "float".equals(valueType))//@see http://qa.openoffice.org/issues/show_bug.cgi?id=108954 + if ("float".equals(valueType))//@see http://qa.openoffice.org/issues/show_bug.cgi?id=108954 { variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, HSSFDateUtil.getExcelDate((Date) value, false, 2).toString()); } else + { variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value)); + } } else if (value instanceof Date) { variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "float"); variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, HSSFDateUtil.getExcelDate((Date) value, false, 2).toString()); } + else if (value instanceof BigDecimal) + { + if ("date".equals(valueType)) + { + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate(HSSFDateUtil.getJavaDate((BigDecimal)value, false, 0))); + } + else + { + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(value)); + } + } else if (value instanceof Number) { variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(value)); |