summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOcke Janssen [oj] <Ocke.Janssen@oracle.com>2011-03-01 08:33:49 +0100
committerOcke Janssen [oj] <Ocke.Janssen@oracle.com>2011-03-01 08:33:49 +0100
commitb8ff7bee0fc0a65d9b9a4bffda9c5b286509331c (patch)
treebd6dc9af93e5be262bfe6ed5665e2bad4afcba46
parent68887243f9c02249a3eadc71ec21be1b1ea256c5 (diff)
parent5bd82464019cfc0f68acca4d20b29f073fef7922 (diff)
Automated merge with file:///cws/so-cwsserv03/dba34c/DEV300/ooo
-rwxr-xr-xreportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java24
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java8
2 files changed, 20 insertions, 12 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 773d49f..70f4304 100755
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java
@@ -143,7 +143,7 @@ public class FormatValueUtility
{
if ("date".equals(valueType))
{
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate(HSSFDateUtil.getJavaDate((BigDecimal)value, false, 0)));
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate(HSSFDateUtil.getJavaDate((BigDecimal) value, false, 0)));
}
else
{
@@ -156,13 +156,21 @@ public class FormatValueUtility
}
else if (value instanceof Boolean)
{
- if (Boolean.TRUE.equals(value))
+ if ("float".equals(valueType))
{
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.TRUE);
+ float fvalue = Boolean.TRUE.equals(value) ? 1 : 0;
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(fvalue));
}
else
{
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.FALSE);
+ if (Boolean.TRUE.equals(value))
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.TRUE);
+ }
+ else
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.FALSE);
+ }
}
}
else if (value != null)
@@ -178,12 +186,10 @@ public class FormatValueUtility
}
if (!"string".equals(valueType))
{
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(value));
- }
- else
- {
- variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, STRING_VALUE, String.valueOf(value));
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "string");
+ //variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(value));
}
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, STRING_VALUE, String.valueOf(value));
}
else
{
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java
index 3ce77c6..859d274 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java
@@ -69,12 +69,12 @@ public class TableCellLayoutController extends SectionLayoutController
{
final AttributeMap attributeMap = new AttributeMap(super.computeAttributes(fc, element, target));
final String definedStyle = (String) attributeMap.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
- final String valueType = (String) attributeMap.getAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE);
attributeMap.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, getDisplayStyleName((Section) element, definedStyle));
try
{
- final DataFlags value = computeValue();
+ final DataFlags value = computeValue(attributeMap);
+ final String valueType = (String) attributeMap.getAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE);
if (value != null)
{
FormatValueUtility.applyValueForCell(value.getValue(), attributeMap, valueType);
@@ -100,7 +100,7 @@ public class TableCellLayoutController extends SectionLayoutController
return attributeMap;
}
- private DataFlags computeValue() throws DataSourceException
+ private DataFlags computeValue(final AttributeMap attributeMap) throws DataSourceException
{
// Search for the first FormattedTextElement
final Section cell = (Section) getElement();
@@ -115,6 +115,8 @@ public class TableCellLayoutController extends SectionLayoutController
final Object o = LayoutControllerUtil.evaluateExpression(getFlowController(), element, dc);
if (Boolean.FALSE.equals(o))
{
+ attributeMap.setAttribute(OfficeNamespaces.OFFICE_NS,
+ FormatValueUtility.VALUE_TYPE, "string");
return null;
}
}