summaryrefslogtreecommitdiff
path: root/reportbuilder
diff options
context:
space:
mode:
Diffstat (limited to 'reportbuilder')
-rw-r--r--reportbuilder/java/libformula.properties4
-rw-r--r--reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java53
-rw-r--r--reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/TableCellLayoutController.java4
-rw-r--r--reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java2
4 files changed, 20 insertions, 43 deletions
diff --git a/reportbuilder/java/libformula.properties b/reportbuilder/java/libformula.properties
index f903736de043..79022b607c5f 100644
--- a/reportbuilder/java/libformula.properties
+++ b/reportbuilder/java/libformula.properties
@@ -19,8 +19,8 @@
##
# Any configuration will happen here.
-org.pentaho.reporting.libraries.formula.datesystem.StartYear=1930
-org.pentaho.reporting.libraries.formula.datesystem.ExcelHack=false
+org.pentaho.reporting.libraries.formula.ZeroDate=1899
+org.pentaho.reporting.libraries.formula.ExcelDateBugAware=false
#
# A list of all known functions.
diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
index 4c1b8ddcd160..d4c86c6317fe 100644
--- a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
+++ b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/FormatValueUtility.java
@@ -85,7 +85,7 @@ public class FormatValueUtility
else if (value instanceof Date)
{
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "float");
- ret = HSSFDateUtil.getExcelDate((Date) value, false, 2).toString();
+ ret = HSSFDateUtil.getExcelDate((Date) value).toString();
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, ret);
}
else if (value instanceof Number)
@@ -112,8 +112,7 @@ public class FormatValueUtility
}
else
{
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "string");
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, STRING_VALUE, "");
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "void");
}
return ret;
}
@@ -122,61 +121,39 @@ public class FormatValueUtility
{
if (value instanceof Time)
{
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "time");
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "time-value", formatTime((Time) value));
}
else if (value instanceof java.sql.Date)
{
- if ("float".equals(valueType) || valueType == null)
- {
- // This is to work around fdo#63478
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, HSSFDateUtil.getExcelDate((Date) value, false, 0).toString());
- }
- else
- {
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value));
- }
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "date");
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value));
}
else if (value instanceof Date)
{
- // This is what we *should* do, but see fdo#63478
- // variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "date");
- // variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value));
- // so we do that instead to work around:
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "float");
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, HSSFDateUtil.getExcelDate((Date) value, false, 0).toString());
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "date");
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value));
}
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));
- }
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "float");
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(value));
}
else if (value instanceof Number)
{
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "float");
variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(value));
}
else if (value instanceof Boolean)
{
- if ("float".equals(valueType))
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "boolean");
+ if (Boolean.TRUE.equals(value))
{
- float fvalue = Boolean.TRUE.equals(value) ? 1 : 0;
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(fvalue));
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.TRUE);
}
else
{
- if (Boolean.TRUE.equals(value))
- {
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.TRUE);
- }
- else
- {
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.FALSE);
- }
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.FALSE);
}
}
else if (value != null)
@@ -198,7 +175,7 @@ public class FormatValueUtility
}
else
{
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, STRING_VALUE, "");
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "void");
}
}
diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/TableCellLayoutController.java b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/TableCellLayoutController.java
index 79b5be615073..6883482a8c12 100644
--- a/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/TableCellLayoutController.java
+++ b/reportbuilder/java/org/libreoffice/report/pentaho/layoutprocessor/TableCellLayoutController.java
@@ -78,7 +78,7 @@ public class TableCellLayoutController extends SectionLayoutController
else if (!"string".equals(valueType))
{
attributeMap.setAttribute(OfficeNamespaces.OFFICE_NS,
- FormatValueUtility.VALUE_TYPE, "string");
+ FormatValueUtility.VALUE_TYPE, "void");
}
}
catch (Exception e)
@@ -101,7 +101,7 @@ public class TableCellLayoutController extends SectionLayoutController
if (!FormatValueUtility.shouldPrint(this, element))
{
attributeMap.setAttribute(OfficeNamespaces.OFFICE_NS,
- FormatValueUtility.VALUE_TYPE, "string");
+ FormatValueUtility.VALUE_TYPE, "void");
return null;
}
return FormatValueUtility.computeDataFlag(element, getFlowController());
diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java b/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java
index 8d34a5d6cfb2..4e731466c49e 100644
--- a/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java
+++ b/reportbuilder/java/org/libreoffice/report/pentaho/output/OfficeDocumentReportTarget.java
@@ -1715,7 +1715,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget
final XmlWriter xmlWriter = getXmlWriter();
xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, "calculation-settings", null, XmlWriterSupport.OPEN);
final AttributeMap nullDateAttributes = new AttributeMap();
- nullDateAttributes.setAttribute(OfficeNamespaces.TABLE_NS, "date-value", "1900-01-01");
+ nullDateAttributes.setAttribute(OfficeNamespaces.TABLE_NS, "date-value", "1899-12-30");
xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, "null-date", buildAttributeList(nullDateAttributes), XmlWriterSupport.CLOSE);
xmlWriter.writeCloseTag();
}