[ 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:
parent
0122b11eb1
commit
730e60cf49
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -91,8 +93,9 @@ public class DataEngine
|
||||||
/** Print String */
|
/** Print String */
|
||||||
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
|
||||||
|
@ -908,7 +918,9 @@ public class DataEngine
|
||||||
} // Value only
|
} // Value only
|
||||||
} // 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());
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
@ -138,7 +139,9 @@ public class Viewer extends CFrame
|
||||||
private SpinnerNumberModel spinnerModel = new SpinnerNumberModel(1,1,100,1);
|
private SpinnerNumberModel spinnerModel = new SpinnerNumberModel(1,1,100,1);
|
||||||
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);
|
||||||
|
|
||||||
|
|
||||||
|
@ -183,7 +186,10 @@ public class Viewer extends CFrame
|
||||||
// Format, Customize, Find
|
// Format, Customize, Find
|
||||||
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);
|
||||||
|
@ -217,8 +223,9 @@ public class Viewer extends CFrame
|
||||||
// Change Listener to set Page no
|
// Change Listener to set Page no
|
||||||
//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));
|
||||||
|
@ -556,7 +563,12 @@ public class Viewer extends CFrame
|
||||||
if (e.getSource() == comboReport)
|
if (e.getSource() == comboReport)
|
||||||
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"))
|
||||||
|
|
Loading…
Reference in New Issue