Style Intelligence v12.0

inetsoft.report
Class RunningTotal

java.lang.Object
  extended by inetsoft.report.RunningTotal
All Implemented Interfaces:
Serializable, Cloneable

public class RunningTotal
extends Object
implements Serializable, Cloneable

A running total is a special field that calculate a value based on a table or section. The running total can be placed on any page. The total value would change according to the contents on each page.

See Also:
Serialized Form

Field Summary
protected  Formula formula
           
static String ON_PAGEBREAK
          Constant used to define a reset on pagebreak condition.
 
Constructor Summary
RunningTotal()
          Create a running total field.
 
Method Summary
 Object clone()
          Make a copy of the running total.
 boolean equalsContent(Object obj)
          Compare if the running total object describes the same obj.
 void evaluate(TableLens table, int row)
          Evaluate a table row.
 void evaluateReset(TableLens table, int row)
          Evaluate the reset condition and reset running total if met.
 String getDataElement()
          Get the associated data element id.
 String getEvaluateOnChange()
          Get the evaluate-on-change-of column name.
 Formula getFormula(TableLens table)
          Get the formula to use for summarization.
 String getName()
          Get the running total field name.
 String getResetOnChange()
          Get the reset-on-change-of column name.
 String getSummaryColumn()
          Get the summary column to be used for calculation.
 Formula getSummaryFormula()
          Get the summarization formula.
 Object getValue()
          Get the current value of the running total.
 void redoEvaluation()
          Redo last evaluation for next style page to use.
 void reset()
          Explicitly reset the total.
 void setDataElement(String id)
          Set the associated data element.
 void setEvaluateOnChange(String column)
          Set the evaluate-on-change-of column name.
 void setName(String name)
          Set the name of the running total field.
 void setResetOnChange(String column)
          Set the reset-on-change-of column name.
 void setSummaryColumn(String column)
          Set the summary column for running total.
 void setSummaryFormula(Formula formula)
          Set the summarization formula.
 void undoEvaluation()
          Undo last evaluation for current style page to use.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ON_PAGEBREAK

public static final String ON_PAGEBREAK
Constant used to define a reset on pagebreak condition.

See Also:
Constant Field Values

formula

protected Formula formula
Constructor Detail

RunningTotal

public RunningTotal()
Create a running total field.

Method Detail

setName

public void setName(String name)
Set the name of the running total field. The name must be unique across a report. It is used to identify a running total field from other elements.


getName

public String getName()
Get the running total field name.


setDataElement

public void setDataElement(String id)
Set the associated data element. The ID must refer to a table or section element in the report. This field must be set.

Parameters:
id - element id.

getDataElement

public String getDataElement()
Get the associated data element id.


setSummaryColumn

public void setSummaryColumn(String column)
Set the summary column for running total. The column must be a column name in the data bound to the data element.

Parameters:
column - table column name.

getSummaryColumn

public String getSummaryColumn()
Get the summary column to be used for calculation.


setSummaryFormula

public void setSummaryFormula(Formula formula)
Set the summarization formula.


getSummaryFormula

public Formula getSummaryFormula()
Get the summarization formula.


getFormula

public Formula getFormula(TableLens table)
Get the formula to use for summarization. This may be different from the getSummaryFormula() if it is overriden by the subclass.


setEvaluateOnChange

public void setEvaluateOnChange(String column)
Set the evaluate-on-change-of column name. If this is set, the running total is only performed when the value changes on the specified column. Otherwise, the totaling is done for all rows.

Parameters:
column - table column name.

getEvaluateOnChange

public String getEvaluateOnChange()
Get the evaluate-on-change-of column name.


setResetOnChange

public void setResetOnChange(String column)
Set the reset-on-change-of column name. If this is set, the running total is reset when the value changes on the specified column. Otherwise, the running total continues for the entire report.

Parameters:
column - table column name.

getResetOnChange

public String getResetOnChange()
Get the reset-on-change-of column name.


getValue

public Object getValue()
Get the current value of the running total.


reset

public void reset()
Explicitly reset the total.


evaluateReset

public void evaluateReset(TableLens table,
                          int row)
Evaluate the reset condition and reset running total if met.


evaluate

public void evaluate(TableLens table,
                     int row)
Evaluate a table row.


redoEvaluation

public void redoEvaluation()
Redo last evaluation for next style page to use.


undoEvaluation

public void undoEvaluation()
Undo last evaluation for current style page to use.


clone

public Object clone()
Make a copy of the running total.

Overrides:
clone in class Object

equalsContent

public boolean equalsContent(Object obj)
Compare if the running total object describes the same obj.

Returns:
true if the two running total are equivalent.

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.