[ 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
This commit is contained in:
vpj-cd 2008-07-29 06:27:41 +00:00
parent 0122b11eb1
commit 730e60cf49
2 changed files with 33 additions and 9 deletions

View File

@ -51,6 +51,8 @@ import org.compiere.util.ValueNamePair;
* @author Teo Sarca, SC ARHIPAC SERVICE SRL * @author Teo Sarca, SC ARHIPAC SERVICE SRL
* <li>BF [ 1761891 ] Included print format with report view attached issue * <li>BF [ 1761891 ] Included print format with report view attached issue
* <li>BF [ 1807368 ] DataEngine does not close DB connection * <li>BF [ 1807368 ] DataEngine does not close DB connection
* @author victor.perez@e-evolution.com
* <li>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 public class DataEngine
{ {
@ -92,7 +94,8 @@ public class DataEngine
private String m_runningTotalString = null; private String m_runningTotalString = null;
/** TrxName String */ /** 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 */ /** Key Indicator in Report */
public static final String KEY = "*"; public static final String KEY = "*";
@ -107,6 +110,10 @@ public class DataEngine
*/ */
public PrintData getPrintData (Properties ctx, MPrintFormat format, MQuery query) 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) if (format == null)
throw new IllegalStateException ("No print format"); throw new IllegalStateException ("No print format");
String tableName = null; String tableName = null;
@ -793,6 +800,9 @@ public class DataEngine
// new row --------------------------------------------------- // new row ---------------------------------------------------
printRunningTotal(pd, levelNo, rowNo++); printRunningTotal(pd, levelNo, rowNo++);
/** Report Summary FR [ 2011569 ]**/
if(!m_summary)
pd.addRow(false, levelNo); pd.addRow(false, levelNo);
int counter = 1; int counter = 1;
// get columns // get columns
@ -909,6 +919,8 @@ public class DataEngine
} // Non-Key Column } // Non-Key Column
if (pde != null) if (pde != null)
{ {
/** Report Summary FR [ 2011569 ]**/
if(!m_summary)
pd.addNode(pde); pd.addNode(pde);
m_group.addValue(pde.getColumnName(), pde.getFunctionValue()); m_group.addValue(pde.getColumnName(), pde.getFunctionValue());
} }

View File

@ -48,7 +48,8 @@ import org.adempiere.pdf.*;
* <li>FR [ 1762466 ] Add "Window" menu to report viewer. * <li>FR [ 1762466 ] Add "Window" menu to report viewer.
* <li>FR [ 1894640 ] Report Engine: Excel Export support * <li>FR [ 1894640 ] Report Engine: Excel Export support
* @author victor.perez@e-evolution.com * @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 * <li>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
* <li>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 public class Viewer extends CFrame
@ -139,6 +140,8 @@ public class Viewer extends CFrame
private JSpinner spinner = new JSpinner(spinnerModel); private JSpinner spinner = new JSpinner(spinnerModel);
private CLabel labelDrill = new CLabel(); 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); // private CComboBox comboZoom = new CComboBox(View.ZOOM_OPTIONS);
@ -184,6 +187,9 @@ public class Viewer extends CFrame
toolBar.addSeparator(); toolBar.addSeparator();
toolBar.add(comboReport); 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); toolBar.add(bCustomize);
bCustomize.setToolTipText(Msg.getMsg(m_ctx, "PrintCustomize")); bCustomize.setToolTipText(Msg.getMsg(m_ctx, "PrintCustomize"));
toolBar.add(bFind); toolBar.add(bFind);
@ -218,7 +224,8 @@ public class Viewer extends CFrame
//pb comment this out so that scrolling works normally //pb comment this out so that scrolling works normally
//centerScrollPane.getViewport().addChangeListener(this); //centerScrollPane.getViewport().addChangeListener(this);
// end pb // end pb
//FR 201156
summary.addActionListener(this);
// Max Page // Max Page
m_pageMax = m_viewPanel.getPageCount(); m_pageMax = m_viewPanel.getPageCount();
spinnerModel.setMaximum(new Integer(m_pageMax)); spinnerModel.setMaximum(new Integer(m_pageMax));
@ -557,6 +564,11 @@ public class Viewer extends CFrame
cmd_report(); cmd_report();
else if (e.getSource() == comboDrill) 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")) else if (cmd.equals("First"))
setPage(1); setPage(1);
else if (cmd.equals("PreviousPage") || cmd.equals("Previous")) else if (cmd.equals("PreviousPage") || cmd.equals("Previous"))