Package org.compiere.report.core
Class RModel
java.lang.Object
org.compiere.report.core.RModel
- All Implemented Interfaces:
Serializable
Report Model.
Data is maintained in
Data is maintained in
RModelData
.- Version:
- $Id: RModel.java,v 1.2 2006/07/30 00:51:06 jjanke Exp $
- Author:
- Jorg Janke, Teo Sarca, SC ARHIPAC SERVICE SRL
- BF [ 1778373 ] AcctViewer: data is not sorted proper
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add Column (RColumn) to RModelDatavoid
Add RColumn to RModelData at Indexvoid
addRow()
Add Rowvoid
addRow
(int index) Add new empty Row at Index to RModelDatavoid
Add new Row to RModelDatavoid
Add Row at Index to RModelDataClass<?>
getColumnClass
(int col) Get Column Classint
Get total number of columnsint
getColumnIndex
(String columnName) Find index for ColumnNamegetColumnName
(int col) Get Column Display Name (Column Header)getRColumn
(int col) Get RColumn modelgetRColumn
(String columnName) Get RColumn by column nameint
Return Total number of rowsgetRows()
Returns the ArrayList of ArrayLists that contains the table's data values.getValueAt
(int row, int col) Get Value Atboolean
isCellEditable
(int rowIndex, int columnIndex) Is Cell Editableboolean
isGroupRow
(int row) Is Row a Group Rowvoid
moveRow
(int from, int to) Move Rowvoid
query
(Properties ctx, String whereClause, String orderClause) Execute Queryvoid
setFunction
(int col, String function) Set Group Function -
for the column, set a function like FUNCTION_SUM, FUNCTION_COUNT, ...void
setFunction
(String columnName, String function) Set Group Functionvoid
setGroup
(int col) Set a group column -
If the group value changes, a new row is inserted for the calculations set in setGroupFunction().
If you set multiple groups, start with the highest level (e.g.void
Set a group columnvoid
setValueAt
(Object aValue, int row, int col) Set Value At
-
Field Details
-
TABLE_ALIAS
Table Alias for SQL- See Also:
-
FUNCTION_COUNT
Function: Count- See Also:
-
FUNCTION_SUM
Function: Sum- See Also:
-
-
Constructor Details
-
RModel
Constructor. Create RModelData.- Parameters:
TableName
-
-
-
Method Details
-
getRColumn
Get RColumn model- Parameters:
col
- column index- Returns:
- RColumn
-
getRColumn
Get RColumn by column name- Parameters:
columnName
-- Returns:
- column or null if not found author Teo Sarca, SC ARHIPAC SERVICE SRL
-
addColumn
Add Column (RColumn) to RModelData- Parameters:
rc
-
-
addColumn
Add RColumn to RModelData at Index- Parameters:
rc
-index
- column index
-
addRow
public void addRow()Add Row -
addRow
public void addRow(int index) Add new empty Row at Index to RModelData- Parameters:
index
- row index
-
addRow
Add new Row to RModelData- Parameters:
l
- column values for new row
-
addRow
Add Row at Index to RModelData- Parameters:
l
- column values of new rowindex
- row index
-
getColumnIndex
Find index for ColumnName- Parameters:
columnName
-- Returns:
- index or -1 if not found
-
query
Execute Query- Parameters:
ctx
-whereClause
-orderClause
-
-
setGroup
Set a group column- Parameters:
columnName
-
-
setGroup
public void setGroup(int col) Set a group column -
If the group value changes, a new row is inserted for the calculations set in setGroupFunction().
If you set multiple groups, start with the highest level (e.g. Country, Region, City).
The data is assumed to be sorted to result in meaningful groups.A AA 1 A AB 2 B BA 3 B BB 4 after setGroup (0) A AA 1 A AB 2 A B BA 3 B BB 4 B
- Parameters:
col
- The Group BY Column
-
isGroupRow
public boolean isGroupRow(int row) Is Row a Group Row- Parameters:
row
- index- Returns:
- true if row is a group row
-
setFunction
Set Group Function- Parameters:
columnName
-function
-
-
setFunction
Set Group Function -
for the column, set a function like FUNCTION_SUM, FUNCTION_COUNT, ...- Parameters:
col
- The column on which the function is performedfunction
- The function
-
getRowCount
public int getRowCount()Return Total number of rows- Returns:
- row count
-
getColumnCount
public int getColumnCount()Get total number of columns- Returns:
- column count
-
getColumnName
Get Column Display Name (Column Header)- Parameters:
col
- index- Returns:
- Column Display Name (Column Header)
-
getColumnClass
Get Column Class- Parameters:
col
- column index- Returns:
- Column Class
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex) Is Cell Editable- Parameters:
rowIndex
-columnIndex
-- Returns:
- true, if editable
-
getValueAt
Get Value At- Parameters:
row
-col
-- Returns:
- value
-
setValueAt
Set Value At- Parameters:
aValue
-row
-col
-- Throws:
IllegalArgumentException
- if row/column is invalid or cell is read only
-
moveRow
public void moveRow(int from, int to) Move Row- Parameters:
from
- indexto
- index
-
getRows
Returns the ArrayList of ArrayLists that contains the table's data values. The ArrayLists contained in the outer vector are each a single row of values.- Returns:
- the ArrayList of ArrayLists containing the tables data values author Teo Sarca [ 1734327 ]
-