SAP BI Java SDK

com.sap.ip.bi.sdk.dac.result.model
Class BIDataSetTableModel

java.lang.Object
  |
  +--com.sap.ip.bi.sdk.dac.result.model.BIDataSetTableModel

public class BIDataSetTableModel
extends Object

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:

helpers diagram

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.

Since:
3.50

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

SECTION_CELLS

public static final int SECTION_CELLS
Constant used to identify the CELLS section of the output table.

SECTION_COLUMN_HEADERS

public static final int SECTION_COLUMN_HEADERS
Constant used to identify the COLUMN_HEADERS section of the output table.

SECTION_ROW_HEADERS

public static final int SECTION_ROW_HEADERS
Constant used to identify the ROW_HEADERS section of the output table.

SECTION_LABELS

public static final int SECTION_LABELS
Constant used to identify the LABELS section of the output table.
Constructor Detail

BIDataSetTableModel

public BIDataSetTableModel(IBIDataSet dataset,
                           boolean isDisplayingHierarchy)
                    throws BISQLException
Constructs the output table model.
Parameters:
dataset - the data set
isDisplayingHierarchy - boolean value determining whether hierarchy is displayed
Throws:
BISQLException - when dataset contains error in column or row axis
Method Detail

getColumnCount

public int getColumnCount()
Gets the total number of columns.
Returns:
the number of columns

getRowCount

public int getRowCount()
Gets the total number of rows.
Returns:
the number of rows

getValueAt

public BITableItem getValueAt(int rowIndex,
                              int colIndex)
                       throws BISQLException
Gets the value at a specific cell.
Parameters:
rowIndex - the row index
colIndex - the column index
Returns:
the BITableItem object at the specific cell
Throws:
BISQLException - when rowIndex or colIndex is invalid value for TableModel

SAP BI Java SDK

Copyright © 2004-2006 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.
These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies (SAP Group) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.