|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ReportDictionary
Warning: This interface is no longer functional from the SAP BusinessObjects 4.0 release onwards.
TheReportDictionary interface represents the collection of
all ReportExpression objects that can be used in a report.
This collection is built by calling either
Query.addResultObject(DataSourceObject) or
Scope.addScopeObject(DataSourceObject) and then calling either
DataProvider.runQuery() or DataProvider.generateQuery().
Example: Creating and running a Query, then
retrieving resulting ReportExpression instances.
// Get the DataSourceObjects we need. DataSourceObjects myClasses = myDataProvider.getDataSource().getClasses(); DataSourceObject yearObj = myClasses.getChild(YEAR_ID); DataSourceObject revenueObj = myClasses.getChild(REVENUE_ID); // Add objects to the query. Query myQuery = myDataProvider.getQuery(); myQuery.addResultObject(yearObj); myQuery.addResultObject(revenueObj); // Run the query; fetch data and populate ReportDictionary. myDataProvider.runQuery(); // Get the ReportExpressions. ReportDictionary myDict = myDocument.getDictionary(); ReportExpression year = myDict.getChild(YEAR_ID); ReportExpression revenue = myDict.getChild(REVENUE_ID);
Note: after running a Query it is possible for the
ReportDictionary to be empty. In this case, to check that a
document has Prompts or Contexts that need to
be set, call DocumentInstance.getMustFillPrompts() and
DocumentInstance.getMustFillContexts(). Once
Contexts and/or
Prompts have been set, the
ReportDictionary will contain the data requested in the
Query.
| Method Summary | |
|---|---|
FormulaExpression |
createFormula(java.lang.String definition)
Creates a formula. |
VariableExpression |
createVariable(java.lang.String name,
ObjectQualification qualif,
java.lang.String definition)
Creates a variable. |
VariableExpression |
createVariable(java.lang.String name,
ObjectQualification qualif,
java.lang.String definition,
ReportExpression dimension)
Creates a variable in Report Dictionary. |
VariableExpression |
createVariable(java.lang.String name,
java.lang.String definition)
Create a new variable in dictionary. |
void |
deleteVariable(java.lang.String name)
Removes a variable from the dictionary. |
ReportExpression |
getChild(java.lang.String exprID)
Gets a report expression by unique identifier. |
ReportExpression |
getChildAt(int index)
Returns the report expression at the specified position in the list. |
ReportExpression |
getChildByName(java.lang.String name)
Gets the first report expression whose name is name. |
int |
getChildCount()
Gets the number of ReportExpressions. |
SynchroManager |
getSynchroManager()
Returns the SynchroManager for MultiDP
ReportExpression. |
VariableExpression[] |
getVariables()
Returns all variables available for the document. |
| Method Detail |
|---|
int getChildCount()
ReportExpressions. Note that when this
function unexpectedly returns 0, there may be prompts
and/or contexts to be filled. See the class documentation at the top of
the page for more information.
ReportExpressionsReportExpression getChildAt(int index)
index - the index of the report expression to return (0 based)
java.lang.ArrayIndexOutOfBoundsException - if index is out of range (index < 0 || index >= getChildCount())ReportExpression getChild(java.lang.String exprID)
DataSourceObject d that has a corresponding
ReportExpression r,
d.getID().equals(r.getID()) == true.
exprID - the ID of the expression to get
ReportExpression with ID exprID,
or null when there is no
ReportExpression in the dictionary with ID
exprID.
java.lang.NullPointerException - when exprID is nullReportExpression.getID()ReportExpression getChildByName(java.lang.String name)
name.
name - the name to look for
ReportExpression with name name,
or null when there is no
ReportExpression in the collection with name
name.
java.lang.NullPointerException - when name is nullReportExpression.getName()VariableExpression[] getVariables()
VariableExpression createVariable(java.lang.String name,
ObjectQualification qualif,
java.lang.String definition)
throws REException
Creates a variable. The new variable will be added to this dictionary and can be used as any other report dictionary child.
Note that no two variables are allowed to have the same name.
name - the name for the new variablequalif - the object qualification, can be either
ObjectQualification.DIMENSION,
ObjectQualification.DETAIL or
ObjectQualification.MEASUREdefinition - the definition of the formula, for example
="My " + [Resort]
ServerException - when the variable definition or name are invalid
java.lang.NullPointerException - when any parameter is null
java.lang.IllegalArgumentException - when name or definition is
empty string.
java.lang.IllegalArgumentException - when qualif is not one of the three allowed
types (see above)
REException
VariableExpression createVariable(java.lang.String name,
ObjectQualification qualif,
java.lang.String definition,
ReportExpression dimension)
throws REException
ReportDictionary.createVariable(String, ObjectQualification, String) more
DIMENSION qualified ReportExpression object
dimensionparameter. that the new variable should attached
to.
dimension should be an instance of DPExpression,
VariableExpression or Link.
name - the name for the new variablequalif - the object qualification should be
ObjectQualification.DETAIL. qualif could be DIMENSION
or MEASURE only when dimension parameter is
null.definition - the definition of the formula, for example
="My " + [Resort]dimension - DIMENSION qualified ReportExpression object
that new variable to be attached to. dimension>
could be null.
java.lang.NullPointerException - when any of name, qualif,
definition parameter is null.
java.lang.IllegalArgumentException - when dimension is a FormulaExpression or when
dimension> isn't qualified as DIMENSION or
when qualif is not DIMENSION, DETAIL or
MEASURE, or when any of name,
definition parameter is an empty string
java.lang.UnsupportedOperationException - when qualif isn't DETAIL but
dimension isn't null
REException - when definition is invalid.
FormulaExpression createFormula(java.lang.String definition)
throws REException
definition - the definition of the formula, for example
="My " + [Resort]
ServerException - when the formula definition is invalid
java.lang.NullPointerException - when definition is null
REExceptionvoid deleteVariable(java.lang.String name)
name - the name of the variable to remove
java.lang.NullPointerException - when name is null.SynchroManager getSynchroManager()
SynchroManager for MultiDP
ReportExpression.
VariableExpression createVariable(java.lang.String name,
java.lang.String definition)
throws REException
ReportDictionary.createVariable(String, ObjectQualification, String) but
ObjectQualification is computed using definition.
Note: Only an aggregation (count, max, min, sum, average, delegate, percentage etc) will give a measure qualified variable.
name - variable name.definition - the definition of the variable formula.
java.lang.NullPointerException - when any parameter is null.
java.lang.IllegalArgumentException - when any parameter is empty String.
ServerException - when the variable definition or name are invalid
REExceptionReportDictionary.createVariable(String, ObjectQualification, String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||