From 6007d9f661a8bd65222862134a0055e04ab86ab6 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 7 May 2014 20:46:33 -0500 Subject: [PATCH] IDEMPIERE-1763 Reporting engine fixes / fix the fixed width problem for null values - backward compatible with existing formats --- .../src/org/compiere/print/layout/TableElement.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/print/layout/TableElement.java b/org.adempiere.base/src/org/compiere/print/layout/TableElement.java index 97e91d8ee2..a30b6fe5f4 100644 --- a/org.adempiere.base/src/org/compiere/print/layout/TableElement.java +++ b/org.adempiere.base/src/org/compiere/print/layout/TableElement.java @@ -314,6 +314,15 @@ public class TableElement extends PrintElement for (int row = 0; row < rows; row++) { m_data.setRowIndex(row); + // define if all the row is null + boolean isNullRow = true; + for (Serializable element : m_data.getRowData()) { + if (element != null) { + isNullRow = false; + break; + } + } + // if (dataSizes.getRowCount() <= row) { dataSizes.addRow(new ArrayList()); @@ -331,7 +340,9 @@ public class TableElement extends PrintElement if (dataItem == null) { //ensure fixed column width respected even when data is null - if (m_columnMaxWidth[col] != 0 && m_columnMaxWidth[col] != -1 && m_fixedWidth[col]) + if ( m_columnMaxWidth[dataCol] >= 0 // the data column is not suppress null + && m_fixedWidth[col] // the print column (below column) has fixed width + && !isNullRow) { dataItem = " "; }