From 730e60cf49cd8622c29c09923e654e93c96bc61f Mon Sep 17 00:00:00 2001 From: vpj-cd Date: Tue, 29 Jul 2008 06:27:41 +0000 Subject: [PATCH] [ 2011569 ] Implementing new Summary flag in Report View http://sourceforge.net/tracker/index.php?func=detail&aid=2011569&group_id=176962&atid=879335 Implementing from trunk revision 5581,5582 --- base/src/org/compiere/print/DataEngine.java | 18 +++++++++++++--- client/src/org/compiere/print/Viewer.java | 24 +++++++++++++++------ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/base/src/org/compiere/print/DataEngine.java b/base/src/org/compiere/print/DataEngine.java index dbbabbbdf6..974016be45 100644 --- a/base/src/org/compiere/print/DataEngine.java +++ b/base/src/org/compiere/print/DataEngine.java @@ -51,6 +51,8 @@ import org.compiere.util.ValueNamePair; * @author Teo Sarca, SC ARHIPAC SERVICE SRL *
  • BF [ 1761891 ] Included print format with report view attached issue *
  • BF [ 1807368 ] DataEngine does not close DB connection + * @author victor.perez@e-evolution.com + *
  • FR [ 2011569 ] Implementing new Summary flag in Report View http://sourceforge.net/tracker/index.php?func=detail&aid=2011569&group_id=176962&atid=879335 */ public class DataEngine { @@ -91,8 +93,9 @@ public class DataEngine /** Print String */ private String m_runningTotalString = null; /** TrxName String */ - private String m_trxName = null; - + private String m_trxName = null; + /** Report Summary FR [ 2011569 ]**/ + private boolean m_summary = false; /** Key Indicator in Report */ public static final String KEY = "*"; @@ -107,6 +110,10 @@ public class DataEngine */ public PrintData getPrintData (Properties ctx, MPrintFormat format, MQuery query) { + + /** Report Summary FR [ 2011569 ]**/ + m_summary = "Y".equals(Env.getContext(Env.getCtx(),0, "IsReportSummary")); + if (format == null) throw new IllegalStateException ("No print format"); String tableName = null; @@ -793,6 +800,9 @@ public class DataEngine // new row --------------------------------------------------- printRunningTotal(pd, levelNo, rowNo++); + + /** Report Summary FR [ 2011569 ]**/ + if(!m_summary) pd.addRow(false, levelNo); int counter = 1; // get columns @@ -908,7 +918,9 @@ public class DataEngine } // Value only } // Non-Key Column if (pde != null) - { + { + /** Report Summary FR [ 2011569 ]**/ + if(!m_summary) pd.addNode(pde); m_group.addValue(pde.getColumnName(), pde.getFunctionValue()); } diff --git a/client/src/org/compiere/print/Viewer.java b/client/src/org/compiere/print/Viewer.java index 6dc04ff8e1..6d8e796bc6 100644 --- a/client/src/org/compiere/print/Viewer.java +++ b/client/src/org/compiere/print/Viewer.java @@ -48,7 +48,8 @@ import org.adempiere.pdf.*; *
  • FR [ 1762466 ] Add "Window" menu to report viewer. *
  • FR [ 1894640 ] Report Engine: Excel Export support * @author victor.perez@e-evolution.com - * @see FR [ 1966328 ] New Window Info to MRP and CRP into View http://sourceforge.net/tracker/index.php?func=detail&aid=1966328&group_id=176962&atid=879335 + *
  • FR [ 1966328 ] New Window Info to MRP and CRP into View http://sourceforge.net/tracker/index.php?func=detail&aid=1966328&group_id=176962&atid=879335 + *
  • FR [ 2011569 ] Implementing new Summary flag in Report View http://sourceforge.net/tracker/index.php?func=detail&aid=2011569&group_id=176962&atid=879335 * */ public class Viewer extends CFrame @@ -138,7 +139,9 @@ public class Viewer extends CFrame private SpinnerNumberModel spinnerModel = new SpinnerNumberModel(1,1,100,1); private JSpinner spinner = new JSpinner(spinnerModel); private CLabel labelDrill = new CLabel(); - private CComboBox comboDrill = new CComboBox(); + private CComboBox comboDrill = new CComboBox(); + //FR 201156 + private CCheckBox summary = new CCheckBox(); // private CComboBox comboZoom = new CComboBox(View.ZOOM_OPTIONS); @@ -183,7 +186,10 @@ public class Viewer extends CFrame // Format, Customize, Find toolBar.addSeparator(); toolBar.add(comboReport); - comboReport.setToolTipText(Msg.translate(m_ctx, "AD_PrintFormat_ID")); + comboReport.setToolTipText(Msg.translate(m_ctx, "AD_PrintFormat_ID")); + //FR 201156 + toolBar.add(summary); + summary.setText(Msg.getMsg(m_ctx, "Summary")); toolBar.add(bCustomize); bCustomize.setToolTipText(Msg.getMsg(m_ctx, "PrintCustomize")); toolBar.add(bFind); @@ -217,8 +223,9 @@ public class Viewer extends CFrame // Change Listener to set Page no //pb comment this out so that scrolling works normally //centerScrollPane.getViewport().addChangeListener(this); - // end pb - + // end pb + //FR 201156 + summary.addActionListener(this); // Max Page m_pageMax = m_viewPanel.getPageCount(); spinnerModel.setMaximum(new Integer(m_pageMax)); @@ -556,7 +563,12 @@ public class Viewer extends CFrame if (e.getSource() == comboReport) cmd_report(); else if (e.getSource() == comboDrill) - cmd_drill(); + cmd_drill(); + else if (e.getSource() == summary) //FR 201156 + { + Env.setContext(Env.getCtx(), 0, "IsReportSummary", (Boolean)summary.getValue() ? "Y" : "N" ); + cmd_report(); + } else if (cmd.equals("First")) setPage(1); else if (cmd.equals("PreviousPage") || cmd.equals("Previous"))