From 3c6e87f564c12bcb7dfa7d09eb70dbbe064a8ce0 Mon Sep 17 00:00:00 2001 From: hieplq Date: Tue, 11 Aug 2015 03:21:48 +0800 Subject: [PATCH] IDEMPIERE-2479:Printformat, Surpress Repeats doesnt works for HTML and XLS include format override main format --- org.adempiere.base/src/org/compiere/print/ReportEngine.java | 6 +++--- .../src/org/compiere/print/layout/LayoutEngine.java | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/print/ReportEngine.java b/org.adempiere.base/src/org/compiere/print/ReportEngine.java index c8fc0a887d..bf36bd70ba 100644 --- a/org.adempiere.base/src/org/compiere/print/ReportEngine.java +++ b/org.adempiere.base/src/org/compiere/print/ReportEngine.java @@ -632,7 +632,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount) thead thead = new thead(); tbody tbody = new tbody(); - Boolean [] colSuppressRepeats = m_layout == null ? LayoutEngine.getColSuppressRepeats(m_printFormat):m_layout.colSuppressRepeats; + Boolean [] colSuppressRepeats = m_layout == null || m_layout.colSuppressRepeats == null? LayoutEngine.getColSuppressRepeats(m_printFormat):m_layout.colSuppressRepeats; Object [] preValues = new Object [colSuppressRepeats.length]; int printColIndex = -1; // for all rows (-1 = header row) @@ -902,7 +902,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount) delimiter = '\t'; try { - Boolean [] colSuppressRepeats = m_layout == null ? LayoutEngine.getColSuppressRepeats(m_printFormat):m_layout.colSuppressRepeats; + Boolean [] colSuppressRepeats = m_layout == null || m_layout.colSuppressRepeats == null? LayoutEngine.getColSuppressRepeats(m_printFormat):m_layout.colSuppressRepeats; Object [] preValues = new Object [colSuppressRepeats.length]; int printColIndex = -1; // for all rows (-1 = header row) @@ -1234,7 +1234,7 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount) public void createXLS(File outFile, Language language) throws Exception { - Boolean [] colSuppressRepeats = m_layout == null ? LayoutEngine.getColSuppressRepeats(m_printFormat):m_layout.colSuppressRepeats; + Boolean [] colSuppressRepeats = m_layout == null || m_layout.colSuppressRepeats == null? LayoutEngine.getColSuppressRepeats(m_printFormat):m_layout.colSuppressRepeats; PrintDataExcelExporter exp = new PrintDataExcelExporter(getPrintData(), getPrintFormat(), colSuppressRepeats); exp.export(outFile, language); } diff --git a/org.adempiere.base/src/org/compiere/print/layout/LayoutEngine.java b/org.adempiere.base/src/org/compiere/print/layout/LayoutEngine.java index 96f4611414..03f0b834d2 100644 --- a/org.adempiere.base/src/org/compiere/print/layout/LayoutEngine.java +++ b/org.adempiere.base/src/org/compiere/print/layout/LayoutEngine.java @@ -1606,7 +1606,7 @@ public class LayoutEngine implements Pageable, Printable, Doc int[] columnMaxWidth = new int[columnCount]; int[] columnMaxHeight = new int[columnCount]; boolean[] fixedWidth = new boolean [columnCount]; - colSuppressRepeats = new Boolean[columnCount]; + Boolean [] colSuppressRepeats = new Boolean[columnCount]; String[] columnJustification = new String[columnCount]; HashMap additionalLines = new HashMap(); @@ -1781,6 +1781,9 @@ public class LayoutEngine implements Pageable, Printable, Doc table.layout(0,0,false, MPrintFormatItem.FIELDALIGNMENTTYPE_LeadingLeft); if (m_tableElement == null) m_tableElement = table; + + if (format == m_format) + this.colSuppressRepeats = colSuppressRepeats; return table; } // layoutTable