com.businessobjects.rebean.wi
Interface ReportBody

All Superinterfaces:
Decoration, ReportElement, ReportElementContainer, TreeNode, Unit

public interface ReportBody
extends ReportElementContainer, Decoration

Warning: This interface is no longer functional from the SAP BusinessObjects 4.0 release onwards.

The ReportBody interface represents the body of a report. The report body is the part between the header and the footer (if any).


Method Summary
 ReportBlock createBlock()
          Creates a new block.
 ReportBlock createBlock(BlockType type)
          Creates a new block of a given type.
 void createDefaultGraph()
          Temporary method for cvom integration test.
 void createDefaultTables(DataProvider[] dps)
          For the given data providers, the createDefaultTables method looks in the report dictionary for expressions and inserts one or more tables into report.
 void createDefaultTables(DataProvider[] dps, CreateDefaultTablesParameters parameters)
          This method allows to customize the behaviour of the createDefaultTables method thanks to the CreateDefaultTablesParameters class.
 FreeCell createFreeCell(java.lang.String text)
          Creates a new cell holding a specified text.
 ReportCell createReportCell(ReportExpression expr)
          Creates a new cell, based on a report expression.
 SectionContainer createSection()
          Creates a new section.
 void deleteSection(SectionContainer section)
          Removes section and moves all its elements to this container.
 java.lang.String getProperty(java.lang.String name)
          Gets the value of a custom property created using ReportBody.setProperty(String, String).
 SectionContainer insertSection(ReportExpression expression)
          Inserts a section.
 SectionContainer insertSection(ReportExpression expression, double fromY)
          Creates a new section, moves all current children to the new section and adds the expression to the new section's axis.
 SectionContainer insertSection(ReportExpression expression, ReportElement fromElement)
          Creates a new section, moves all current children to the new section and adds the expression to the new section's axis.
 void setProperty(java.lang.String name, java.lang.String value)
          Sets a custom property attached to this ReportBody.
 
Methods inherited from interface com.businessobjects.rebean.wi.ReportElementContainer
copyReportElement, getWidth, move, removeAllChildren, removeReportElement, removeReportElementAt
 
Methods inherited from interface com.businessobjects.rebean.wi.ReportElement
getFather, getID, getReportElement, getReportElement, getReportElementCount
 
Methods inherited from interface com.businessobjects.rebean.wi.TreeNode
getChildAt, getChildCount, getIndex, getParent, isLeaf
 
Methods inherited from interface com.businessobjects.rebean.wi.Unit
getUnit, setUnit
 
Methods inherited from interface com.businessobjects.rebean.wi.Decoration
getAlignment, getAttributes, getBackgroundAlignment, getFont, setAlignment, setAttributes, setBackgroundAlignment, setFont
 

Method Detail

createSection

SectionContainer createSection()
Creates a new section. This creates a SectionContainer, holding a ReportCell to display the section header.

Returns:
the new section container

insertSection

SectionContainer insertSection(ReportExpression expression)
Inserts a section. The result of this function is the same as calling insertSection(expression, null).

Parameters:
expression - the expression the new section should be based on
Returns:
the new section container
Since:
6.1
See Also:
ReportBody.insertSection(ReportExpression, ReportElement)

insertSection

SectionContainer insertSection(ReportExpression expression,
                               ReportElement fromElement)
Creates a new section, moves all current children to the new section and adds the expression to the new section's axis.

All moved child elements will have the same position relative to the new section cell. Some extra vertical space will be added for this section cell.

When fromElement != null, all elements from fromElement and below will be moved into the new section. Elements above fromElement will not be moved.

When fromElement == null, all child elements of this container will be moved into the new section.

When fromElement is not a child of this container, all children will be moved into the section as for fromElement == null

Parameters:
expression - ReportExpression the new section should be based on
fromElement - First ReportElement to be moved. If null all child elements are moved to new section
Returns:
the new section container
Since:
6.5
See Also:
ReportBody.createSection(), ReportExpression, ReportElement

insertSection

SectionContainer insertSection(ReportExpression expression,
                               double fromY)
Creates a new section, moves all current children to the new section and adds the expression to the new section's axis.

When fromY >= 0, all elements with a y coordinate >= fromY will be moved into the new section. Elements above fromY will not be moved. The new section will be inserted at Y coordinate fromY, unless when this would overlap the section on higher elements. In that case, the smallest possible Y coordinate > fromY will be used for the new section. All elements that are moved into the new section will keep their position in the document (so that oldY == newSection.getY() + newY), except when this would not leave enough place for the section cell; in that case, all elements are moved down until there is enough place.

When fromY < 0, all child elements of this container will be moved into the new section. No positions will be kept; all elements will be moved to their default positions in the new section.

Parameters:
expression - ReportExpression the new section should be based on
fromY - Highest Y coordinate from which child elements should be moved to the section.
Returns:
the new section container
Since:
11.5
See Also:
ReportBody.createSection(), ReportElement

deleteSection

void deleteSection(SectionContainer section)

Removes section and moves all its elements to this container. section has to be a child of this container, otherwise nothing happens. The section cell is deleted and is not moved.

All moved children's positions relative to the section will be kept, but vertically the space for the section cell will be removed.

Parameters:
section - the section to remove
Since:
6.1

createBlock

ReportBlock createBlock()
Creates a new block. By default, the block will be a TableType.VTABLE.

Returns:
the new block

createBlock

ReportBlock createBlock(BlockType type)
Creates a new block of a given type.

Parameters:
type - the type of block to create
Returns:
the new block

createFreeCell

FreeCell createFreeCell(java.lang.String text)
Creates a new cell holding a specified text.

Parameters:
text - the text to display in the cell
Returns:
the new cell
Throws:
java.lang.NullPointerException - when text is null

createReportCell

ReportCell createReportCell(ReportExpression expr)
Creates a new cell, based on a report expression. If it is not a FormulaExpression, the expression will automatically be transformed to a formula =expr.

Parameters:
expr - the report expression
Returns:
the new cell
Throws:
java.lang.NullPointerException - when expr is null

createDefaultTables

void createDefaultTables(DataProvider[] dps)
For the given data providers, the createDefaultTables method looks in the report dictionary for expressions and inserts one or more tables into report.

This method keeps track of which objects can be placed together in a single table and adds all objects from the first query of every data provider. If two objects are incompatible, they will be placed in different tables.

This method makes sure that no two incompatible objects are placed together in one block. It is called after creating one or more data providers to show the resulting data correctly in a report.

Example: Create default tables
IInfoObject ceInfoobject = (IInfoObject)universes.get(31);
String universeId =((IUniverse)ceInfoobject).buildUniverseIdString();
DocumentInstance doc = repEng.newDocument(universeId);
ReportContainer report = doc.createReport("Report1");
DataProviders dps = doc.getDataProviders();
// Retrieve the 1st data provider
DataProvider dp = dps.getItem(0);
// Retrieve the universe objects
DataSource ds = dp.getDataSource();
DataSourceObject invoiceDate = ds.getClasses().getChildByName("Invoice Date");
DataSourceObject reservationDate = ds.getClasses().getChildByName("Reservation Date");
DataSourceObject revenue = ds.getClasses().getChildByName ("Revenue");
Query q = dp.getQuery();
// Add result objects to the query
q.addResultObject(invoiceDate);
q.addResultObject(reservationDate);
q.addResultObject(revenue);
// Run the query and fetch the data
dp.runQuery();
ReportBody body = report.getReportBody();
body.createDefaultTables(null);
doc.applyFormat();

Reports reps = doc.getReports();
Report rep = reps.getItem(0);
HTMLView htmlView = (HTMLView)rep.getView(OutputFormatType.DHTML);
PrintWriter writer = response.getWriter();
htmlView.getContent(writer,"","");

Parameters:
dps - The data providers to create default tables for. When null, this method will create tables for objects in all data providers.
Since:
11.7

createDefaultGraph

void createDefaultGraph()
Temporary method for cvom integration test. It will create a bar graph with the data of the first DataProvider.


createDefaultTables

void createDefaultTables(DataProvider[] dps,
                         CreateDefaultTablesParameters parameters)
This method allows to customize the behaviour of the createDefaultTables method thanks to the CreateDefaultTablesParameters class.

Parameters:
dps - The data providers to create default tables for. When null, this method will create tables for objects in all data providers.
parameters - allows to custom the behaviour of the createDefaultTables
Since:
12.0

setProperty

void setProperty(java.lang.String name,
                 java.lang.String value)
Sets a custom property attached to this ReportBody. This custom property will be saved along with the document structure on calling DocumentInstance.save().

Parameters:
name - the property name.
value - the property value.
Since:
12.2

getProperty

java.lang.String getProperty(java.lang.String name)
Gets the value of a custom property created using ReportBody.setProperty(String, String).

Parameters:
name - the property name.
Returns:
the property value.
Since:
12.2