|
SAP BI Java SDK | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sap.ip.bi.sdk.dac.result.model.BIDataSetTableModel
This class implements an output table according to a strategy that divides the table into four sections. The approach is pictured in the diagram below:
The table represented by this model is divided into the following four sections:
I : captions II : column headers III: row headers IV : cells
When a client requests a cell using getValueAt(int rowIndex,
int colIndex)
, we ascertain to which of the four sections this
cell belongs. If it belongs to "IV: cells," the supplied
rowIndex
and colIndex
are transformed
into the actual coordinates of the data set actualCol
and actualRow
.
For headerRows
and headerCols
, there are a
few additional considerations. If properties have been selected for
the dimensions, these should be displayed (regardless of the axis;
on rows and columns alike). In addition, hierarchy on a dimension
may be displayed to an extent that multiple levels need to be taken
into account.
To account for the dimension properties, we get the number of attributes from each dimension on an axis, and accumulate the number of properties that are selected. In this way, we calculate the number of header rows and columns. The total number of columns and rows of the output grid is then described as:
nTotalRows = nHeaderRows + nDataSetRows and nTotalColumns = nHeaderColumns + nDataSetColumns
For the calculation of the number of headerPositions
on
an axis, see the following example:
Row# Dimension Property 1 Customer caption Mayer 2 Customer Zip Code 94025 3 Measures caption Sales Count
In this case, we have two dimensions on the columns axis: customers and measures. Customers has the property zip code selected. There are no properties selected for measures. The resulting number of header rows in this case is 3.
Now, one additional complexity comes into play because of the hierarchies. First, we describe the type of graphical representation we choose to display hierarchies in the output table and how this influences our table model.
A Hierarchy on the rows axis should be displayed in the following way:
#1: Caption | #2: property 1 | .... All Customers | |-------------- | | USA | | Canada | | |------------| | | Vancouver | 94025 | | Montreal | | France |
Note that the separation of the different levels is done exclusively using indentation and vertical and horizontal lines in the cell UI. What's key here is that for each dimension on the rows axis we use a single column, plus the columns needed for the properties.
A Hierarchy on the columns should be displayed in the following way:
| All Products________________________________________________| #1: Caption lvl 1 | | Food | Office | Outdoor | #2: Caption lvl 2 | | Guido | Uwe | Jenny | #3: property 1 ---------------------------------------------------------------
Using this representation, we would need one header row per visible level. The different levels are separated using a horizontal line, which is part of the cell UI.
To make the display more flexible, this model provides the option to
handle the hierarchy in a different way, in which you can switch
the hierarchical display completely off. In this case, one
dimension on the columns axis is displayed on a single row, and one
dimension on the rows axis is displayed using a single column. The
variable that indicates whether the hierarchy is on or off is the
boolean isDisplayHierarchy
.
Field Summary | |
static int |
SECTION_CELLS
Constant used to identify the CELLS section of the
output table. |
static int |
SECTION_COLUMN_HEADERS
Constant used to identify the COLUMN_HEADERS
section of the output table. |
static int |
SECTION_LABELS
Constant used to identify the LABELS section of the
output table. |
static int |
SECTION_ROW_HEADERS
Constant used to identify the ROW_HEADERS section
of the output table. |
Constructor Summary | |
BIDataSetTableModel(IBIDataSet dataset,
boolean isDisplayingHierarchy)
Constructs the output table model. |
Method Summary | |
int |
getColumnCount()
Gets the total number of columns. |
int |
getRowCount()
Gets the total number of rows. |
BITableItem |
getValueAt(int rowIndex,
int colIndex)
Gets the value at a specific cell. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SECTION_CELLS
CELLS
section of the
output table.public static final int SECTION_COLUMN_HEADERS
COLUMN_HEADERS
section of the output table.public static final int SECTION_ROW_HEADERS
ROW_HEADERS
section
of the output table.public static final int SECTION_LABELS
LABELS
section of the
output table.Constructor Detail |
public BIDataSetTableModel(IBIDataSet dataset, boolean isDisplayingHierarchy) throws BISQLException
dataset
- the data setisDisplayingHierarchy
- boolean value determining whether
hierarchy is displayedBISQLException
- when dataset
contains error in column
or row axisMethod Detail |
public int getColumnCount()
public int getRowCount()
public BITableItem getValueAt(int rowIndex, int colIndex) throws BISQLException
rowIndex
- the row indexcolIndex
- the column indexBISQLException
- when rowIndex
or colIndex
is invalid value for TableModel
|
SAP BI Java SDK | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |