From b7cacdac2e2c738e087bc0f58133f1016d916a46 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 23 Jan 2014 22:15:59 +0800 Subject: [PATCH] IDEMPIERE-1763 Table based layout - respect fixed column width even when data is null. --- .../org/compiere/print/layout/TableElement.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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 b50da77b82..97e91d8ee2 100644 --- a/org.adempiere.base/src/org/compiere/print/layout/TableElement.java +++ b/org.adempiere.base/src/org/compiere/print/layout/TableElement.java @@ -330,9 +330,17 @@ public class TableElement extends PrintElement Serializable dataItem = m_data.getRowData().get(dataCol); if (dataItem == null) { - dimensions.set(dataCol, new Dimension2DImpl()); - continue; - } + //ensure fixed column width respected even when data is null + if (m_columnMaxWidth[col] != 0 && m_columnMaxWidth[col] != -1 && m_fixedWidth[col]) + { + dataItem = " "; + } + else + { + dimensions.set(dataCol, new Dimension2DImpl()); + continue; + } + } String string = dataItem.toString(); if (string.length() == 0) {