|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ReportBody
Warning: This interface is no longer functional from the SAP BusinessObjects 4.0 release onwards.
TheReportBody
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 |
---|
SectionContainer createSection()
SectionContainer
, holding a
ReportCell
to display the section header.
SectionContainer insertSection(ReportExpression expression)
insertSection(expression, null)
.
expression
- the expression the new section should be based on
ReportBody.insertSection(ReportExpression, ReportElement)
SectionContainer insertSection(ReportExpression expression, ReportElement fromElement)
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
expression
- ReportExpression the new section should be based onfromElement
- First ReportElement to be moved. If null all child elements
are moved to new section
ReportBody.createSection()
,
ReportExpression
,
ReportElement
SectionContainer insertSection(ReportExpression expression, double fromY)
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.
expression
- ReportExpression the new section should be based onfromY
- Highest Y coordinate from which child elements should be moved
to the section.
ReportBody.createSection()
,
ReportElement
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.
section
- the section to removeReportBlock createBlock()
TableType.VTABLE
.
ReportBlock createBlock(BlockType type)
type
- the type of block to create
FreeCell createFreeCell(java.lang.String text)
text
- the text to display in the cell
java.lang.NullPointerException
- when text
is null
ReportCell createReportCell(ReportExpression expr)
FormulaExpression
,
the expression will automatically be transformed to a formula =expr
.
expr
- the report expression
java.lang.NullPointerException
- when expr
is null
void createDefaultTables(DataProvider[] dps)
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,"","");
dps
- The data providers to create default tables for. When
null
, this method will create tables for
objects in all data providers.void createDefaultGraph()
void createDefaultTables(DataProvider[] dps, CreateDefaultTablesParameters parameters)
CreateDefaultTablesParameters
class.
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 createDefaultTablesvoid setProperty(java.lang.String name, java.lang.String value)
ReportBody
.
This custom property will be saved along with the document structure on
calling DocumentInstance.save()
.
name
- the property name.value
- the property value.java.lang.String getProperty(java.lang.String name)
ReportBody.setProperty(String, String)
.
name
- the property name.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |