|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CrossTable
Warning: This interface is no longer functional from the SAP BusinessObjects 4.0 release onwards.
CrossTable
is a representation of a cross table. A block is a CrossTable
when
Representation.getType()
returns TableType.XTABLE
.
Method Summary | |
---|---|
CellMatrix |
getCellMatrix(VZoneType v,
HZoneType h)
Returns the cells in a specific zone of the crosstable. |
CellMatrix |
getCellMatrix(VZoneType v,
HZoneType h,
BreakElement vBreak,
BreakElement hBreak)
Returns cells for a specific zone in a crosstable, for a specific break. |
Decoration |
getExtraHeaderDecoration()
Returns the default graphics for the extra headers. |
boolean |
isExtraHeaderVisible()
Checks if the crosstables extra headers are visible. |
boolean |
isHeaderVisible()
For a cross table, this method checks if the extra headers are visible or not. |
boolean |
isLeftHeaderVisible()
Checks if the left header of the cross table is visible. |
boolean |
isShowEmptyColumns()
Checks if columns with empty measure values will be shown. |
boolean |
isShowEmptyDimensionCells()
Checks if cells with empty dimension values will be shown. |
boolean |
isShowEmptyRows()
Checks if rows with empty measure values will be shown or not. |
boolean |
isTopHeaderVisible()
Checks if the top header of the cross table is visible. |
void |
setExtraHeaderVisible(boolean b)
Shows or hides the extra headers. |
void |
setHeaderVisible(boolean b)
For a cross table, this method shows the extra headers. |
void |
setLeftHeaderVisible(boolean visible)
Shows or hides the left header of this cross table. |
void |
setShowEmptyColumns(boolean show)
Shows or hides columns with empty measure values. |
void |
setShowEmptyDimensionCells(boolean show)
Shows cells with empty dimension values. |
void |
setShowEmptyRows(boolean show)
Shows or hides rows with empty measure values. |
void |
setTopHeaderVisible(boolean visible)
Shows or hides the top header of this cross table. |
Methods inherited from interface com.businessobjects.rebean.wi.Table |
---|
getBodyDecoration, getFooterDecoration, getHBlockCalculation, getHeaderDecoration, getVBlockCalculation, isFooterOnEveryPage, isFooterVisible, isHeaderOnEveryPage, setFooterOnEveryPage, setFooterVisible, setHeaderOnEveryPage |
Methods inherited from interface com.businessobjects.rebean.wi.TableFormBase |
---|
getAlternateColor, getAlternateColorFrequency, getBodyTableDecoration, getCellPadding, getCellSpacing, getTableCell, setAlternateColor, setCellPadding, setCellSpacing |
Methods inherited from interface com.businessobjects.rebean.wi.Representation |
---|
getBlock, getType, setType |
Methods inherited from interface com.businessobjects.rebean.wi.Unit |
---|
getUnit, setUnit |
Method Detail |
---|
CellMatrix getCellMatrix(VZoneType v, HZoneType h)
Returns the cells in a specific zone of the crosstable. Any crosstable can be represented as a matrix of 9 zones:
empty(TOP, LEFT) |
top headers(TOP, BODY) |
top right footers(TOP, RIGHT) |
left headers(BODY, LEFT) |
body(BODY, BODY) |
right footers(BODY, RIGHT) |
bottom left footers(BOTTOM, LEFT) |
bottom footers(BOTTOM, BODY) |
bottom right footers(BOTTOM, RIGHT) |
How many cells each zone contains depends on the number of expressions on each axis. All
TableAxis.HORIZONTAL
expressions will be added vertically (they are the top headers),
all TableAxis.VERTICAL
expressions will be added horizontally (they are the left
headers) and all TableAxis.CONTENT
expressions will be added vertically
(they are the body).
All the different zones are identified by two zone type parameters, in the table above, their values for each zone are given in parentheses.
v
- the vertical zone.h
- the hozizontal zone.
java.lang.NullPointerException
- when v
and/or h
are null
.CellMatrix getCellMatrix(VZoneType v, HZoneType h, BreakElement vBreak, BreakElement hBreak)
Returns cells for a specific zone in a crosstable, for a specific
break. For this function, the same zones apply as described for CrossTable.getCellMatrix(VZoneType, HZoneType)
. Apart from those, this function
also looks at the break level. In fact, getCellMatrix(VZoneType,
HZoneType)
has the same result as getCellMatrix(VZoneType,
HZoneType, null, null)
; the first function never returns a
CellMatrix
for a break.
Each break on an expression in the left header (TableAxis.VERTICAL
) has a vertical header and footer. Each break on a
top header (TableAxis.HORIZONTAL
) expression has a horizontal
header and footer. Graphically, this comes down to:
VHeader0 | ||||||||
VHeader1 | ||||||||
VHeaderm | ||||||||
HHeader0 | HHeader1 | (...) | HHeadern | Body | HFootern (...) | (...) | HFooter1 | HFooter0 |
VFooterm | ||||||||
VFooter1 | ||||||||
VFooter0 |
Where VHeaderi stands for vertical header
i. This table represents a crosstable with m - 1
vertical breaks and n - 1 horizontal breaks. Each vertical or
horizontal header or footer i stands for the break at index
i - 1 (index as in BlockBreak.getBreakElement(int)
) and
when i == 0, the header or footer belongs to the table itself
and not to any break.
Each break has a header and a footer. These might be hidden (BreakElement.setHeaderVisible(boolean)
and BreakElement.setFooterVisible(boolean)
). When a user has deleted all
rows or columns of a break header or footer (using the applet - this
cannot be done using ReBean at this moment), they can be reset to their
default value by calling BreakElement.setHeaderVisible(true)
or BreakElement.setFooterVisible(true)
.
Each break's header and footer are repeated for each different break value (if they are visible of course). By default, the first break's footer has a transparent row or column at the end to give a visual seperation between the two values (in fact, the result will look like there are several tables).
As an example of break and table headers and footers, look at this table:
(1) | (6)=Year | (11) |
(2)=Country | (7)=Revenue | (12)=Sum(Revenue) |
(3)=Country | (8)=Sum(Revenue) | (13)=Sum(Revenue) |
(4) | (9) | (14) |
(5) | (10)=Sum(Revenue) | (15)=Sum(Revenue) |
Headers are indicated in bold text, the body in normal text and the footers in italic. The numbers in the upper left corners have been added to identify each cell later on - this would never appear in a real table structure.
This table might have been created with the following code:
// ... ReportContainer report = documentInstance.createReport("My Report"); ReportBlock block = report.getReportBody().createBlock(); block.getAxis(TableAxis.HORIZONTAL).addExpr(year); block.getAxis(TableAxis.VERTICAL).addExpr(country); block.getAxis(TableAxis.CONTENT).addExpr(revenue); // set a break on Country, this introduces a second header and // footer BreakElement countryBreak = block.getAxis(TableAxis.VERTICAL) .getBlockBreak().createBreakElement(country); block.getAxis(TableAxis.CONTENT).getHBlockCalculation() .createCalculationElement(revenue, Calculation.SUM); block.getAxis(TableAxis.CONTENT).getVBlockCalculation() .createCalculationElement(revenue, Calculation.SUM); Crosstable xtab = (CrossTable) block.getRepresentation() .setType(TableType.XTABLE);
By default, countryBreak.isHeaderVisible() == false
, so
we do not see it in the table above.
For the following parameters to this function, we will get the following parts of the table:
v | h | vBreak | hBreak | CellMatrix | ||
---|---|---|---|---|---|---|
TOP |
LEFT |
null |
null |
|
||
TOP |
LEFT |
countryBreak |
null |
cell between (1) and (2), not visible but identical to (1) | ||
BODY |
LEFT |
null |
null |
|
||
BOTTOM |
LEFT |
countryBreak |
null |
|
||
BOTTOM |
LEFT |
null |
null |
|
||
TOP |
BODY |
null |
null |
|
||
TOP |
BODY |
countryBreak |
null |
cell between (6) and (7), not visible but identical to (6) | ||
BODY |
BODY |
null |
null |
|
||
BOTTOM |
BODY |
countryBreak |
null |
|
||
BOTTOM |
BODY |
null |
null |
|
||
TOP |
RIGHT |
null |
null |
|
||
TOP |
RIGHT |
countryBreak |
null |
cell between (11) and (12), not visible but identical to (11) | ||
BODY |
RIGHT |
null |
null |
|
||
BOTTOM |
RIGHT |
countryBreak |
null |
|
||
BOTTOM |
RIGHT |
null |
null |
|
v
- the vertical zone.h
- the hozizontal zone.vBreak
- the vertical break, or null
to get a zone
that does not depend on a vertical break.hBreak
- the horizontal break, or null
to get a zone
that does not depend on a horizontal break.
java.lang.NullPointerException
- when v
and/or h
are null
.boolean isExtraHeaderVisible()
Checks if the crosstables extra headers are visible. A crosstable has extra headers, that normally are not displayed.
Say that if we have a crosstable that looks like:
+----------+----------+----------+ | New York | LA | Chicago | +----------+----------+----------+----------+ | 2000 | 5,000 | 4,500 | 4,000 | +----------+----------+----------+----------+ | 2001 | 6,000 | 5,000 | 5,500 | +----------+----------+----------+----------+ | 2002 | 7,500 | 6,000 | 5,750 | +----------+----------+----------+----------+It can be easily noticed that this table only contains values, even in its headers. The crosstable's extra headers, which are not displayed in the previous example, might make things a little bit easier to read:
+----------+----------+----------+----------+ | City | New York | LA | Chicago | +----------+----------+----------+----------+----------+ | Year | | Stock | Stock | Stock | +----------+----------+----------+----------+----------+ | 2000 | Stock | 5,000 | 4,500 | 4,000 | +----------+----------+----------+----------+----------+ | 2001 | Stock | 6,000 | 5,000 | 5,500 | +----------+----------+----------+----------+----------+ | 2002 | Stock | 7,500 | 6,000 | 5,750 | +----------+----------+----------+----------+----------+
true
when the extra headers are visible (default is false
)void setExtraHeaderVisible(boolean b)
CrossTable.isTopHeaderVisible()
and
CrossTable.isLeftHeaderVisible()
) will also be shown.
b
- when true
, the extra headers will be shownCrossTable.isExtraHeaderVisible()
boolean isHeaderVisible()
CrossTable.isTopHeaderVisible()
and CrossTable.isLeftHeaderVisible()
.
isHeaderVisible
in interface Table
true
when the header cells are visible (default is true
)Table.isHeaderVisible()
,
CrossTable.isExtraHeaderVisible()
void setHeaderVisible(boolean b)
CrossTable.setTopHeaderVisible(boolean)
and
CrossTable.setLeftHeaderVisible(boolean)
.
setHeaderVisible
in interface Table
b
- when true
, the header cells will be shownTable.setHeaderVisible(boolean)
,
CrossTable.setExtraHeaderVisible(boolean)
Decoration getExtraHeaderDecoration()
void setShowEmptyRows(boolean show)
show
- when true
, rows with empty measure values will be shownboolean isShowEmptyRows()
true
if show empty rows is set.void setShowEmptyColumns(boolean show)
show
- when true
, columns with empty measure values will be shownboolean isShowEmptyColumns()
true
if show empty columns is set.boolean isTopHeaderVisible()
true
if the top header is visible.void setTopHeaderVisible(boolean visible)
visible
- when true
, the top header will be shown.boolean isLeftHeaderVisible()
true
if the left header is visible.void setLeftHeaderVisible(boolean visible)
visible
- when true
, the left header will be shown.void setShowEmptyDimensionCells(boolean show)
show
- when true
, empty rows/columns will be shownboolean isShowEmptyDimensionCells()
true
if show empty rows/columns is set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |