diff --git a/org.adempiere.base/src/org/compiere/print/PrintData.java b/org.adempiere.base/src/org/compiere/print/PrintData.java index 63c95dcb93..a766c9cc33 100644 --- a/org.adempiere.base/src/org/compiere/print/PrintData.java +++ b/org.adempiere.base/src/org/compiere/print/PrintData.java @@ -283,9 +283,18 @@ public class PrintData implements Serializable */ public int getRowCount() { - return m_matrix.getRowCount(); + return getRowCount(true); } // getRowCount + /** + * Get row count + * @param includeFunctionRows + * @return row count + */ + public int getRowCount(boolean includeFunctionRows) { + return includeFunctionRows ? m_matrix.getRowCount() : m_matrix.getRowCount() - m_functionRows.size(); + } + /** * Get Current Row Index * @return row index diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java index 624d7343cf..5837a94492 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java @@ -1956,7 +1956,7 @@ public class DashboardController implements EventListener { public ReportData(AMedia content, ReportEngine reportEngine) { this.content = content; if(reportEngine.getPrintData() != null) - this.rowCount = reportEngine.getPrintData().getRowCount(); + this.rowCount = reportEngine.getPrintData().getRowCount(false); } /** @@ -1968,7 +1968,7 @@ public class DashboardController implements EventListener { } /** - * Get report row count + * Get report row count (function rows not included) * @return int row count */ public int getRowCount() { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java index 8b725ed09b..8bef649632 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java @@ -222,6 +222,8 @@ public class ZkReportViewer extends Window implements EventListener, IRep private ToolBarButton bCloudUpload = new ToolBarButton(); protected Map uploadServicesMap = new HashMap<>(); + /** Row count label */ + private Label rowCount; private final ExportFormat[] exportFormats = new ExportFormat[] { new ExportFormat(POSTSCRIPT_FILE_EXT + " - " + Msg.getMsg(Env.getCtx(), "FilePS"), POSTSCRIPT_FILE_EXT, POSTSCRIPT_MIME_TYPE), @@ -785,7 +787,7 @@ public class ZkReportViewer extends Window implements EventListener, IRep linkDiv.setStyle("width:100%; height: 40px; padding: 4px;"); linkDiv.appendChild(reportLink); - Label rowCount = new Label(Msg.getMsg(m_ctx, "RowCount", new Object[] {m_reportEngine.getPrintData().getRowCount()})); + rowCount = new Label(Msg.getMsg(m_ctx, "RowCount", new Object[] {m_reportEngine.getPrintData().getRowCount(false)})); rowCount.setStyle("float: right;"); linkDiv.appendChild(rowCount); @@ -1564,6 +1566,7 @@ public class ZkReportViewer extends Window implements EventListener, IRep showBusyDialog(); setLanguage(); Events.echoEvent(ON_RENDER_REPORT_EVENT, this, null); + updateRowCount(); } @@ -2066,4 +2069,12 @@ public class ZkReportViewer extends Window implements EventListener, IRep findWindow.setSizable(false); findWindow.setContentStyle("background-color: #fff; width: 99%; margin: auto;"); } + + /** + * Update Row Count label + */ + private void updateRowCount() { + if(rowCount != null) + rowCount.setValue(Msg.getMsg(Env.getCtx(), "RowCount", new Object[] {m_reportEngine.getPrintData().getRowCount(false)})); + } }