com.businessobjects.rebean.wi
Interface ReportDictionary


public interface ReportDictionary

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

The ReportDictionary 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

getChildCount

int getChildCount()
Gets the number of 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.

Returns:
the number of ReportExpressions

getChildAt

ReportExpression getChildAt(int index)
Returns the report expression at the specified position in the list.

Parameters:
index - the index of the report expression to return (0 based)
Returns:
the report expression at the given index
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index is out of range (index < 0 || index >= getChildCount())

getChild

ReportExpression getChild(java.lang.String exprID)
Gets a report expression by unique identifier. For every DataSourceObject d that has a corresponding ReportExpression r, d.getID().equals(r.getID()) == true.

Parameters:
exprID - the ID of the expression to get
Returns:
the ReportExpression with ID exprID, or null when there is no ReportExpression in the dictionary with ID exprID.
Throws:
java.lang.NullPointerException - when exprID is null
See Also:
ReportExpression.getID()

getChildByName

ReportExpression getChildByName(java.lang.String name)
Gets the first report expression whose name is name.

Parameters:
name - the name to look for
Returns:
the ReportExpression with name name, or null when there is no ReportExpression in the collection with name name.
Throws:
java.lang.NullPointerException - when name is null
See Also:
ReportExpression.getName()

getVariables

VariableExpression[] getVariables()
Returns all variables available for the document.

Returns:
an array of all variables
Since:
6.5.0

createVariable

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.

Parameters:
name - the name for the new variable
qualif - the object qualification, can be either ObjectQualification.DIMENSION, ObjectQualification.DETAIL or ObjectQualification.MEASURE
definition - the definition of the formula, for example ="My " + [Resort]
Returns:
a new variable
Throws:
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
Since:
6.5.0

createVariable

VariableExpression createVariable(java.lang.String name,
                                  ObjectQualification qualif,
                                  java.lang.String definition,
                                  ReportExpression dimension)
                                  throws REException
Creates a variable in Report Dictionary. It's similar as 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.

Parameters:
name - the name for the new variable
qualif - 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.
Returns:
a new variable
Throws:
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.
Since:
11.5

createFormula

FormulaExpression createFormula(java.lang.String definition)
                                throws REException
Creates a formula.

Parameters:
definition - the definition of the formula, for example ="My " + [Resort]
Returns:
the new formula
Throws:
ServerException - when the formula definition is invalid
java.lang.NullPointerException - when definition is null
REException
Since:
6.5.0

deleteVariable

void deleteVariable(java.lang.String name)
Removes a variable from the dictionary. If there is no variable with the specified name, nothing happens.

Parameters:
name - the name of the variable to remove
Throws:
java.lang.NullPointerException - when name is null.
Since:
6.5.0

getSynchroManager

SynchroManager getSynchroManager()
Returns the SynchroManager for MultiDP ReportExpression.

Returns:
the single SynchroManager instance of this dictionary.
Since:
11.5

createVariable

VariableExpression createVariable(java.lang.String name,
                                  java.lang.String definition)
                                  throws REException
Create a new variable in dictionary. Similar than 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.
The other functions which is not an aggregation like "=Length ([Country])" will give the same qualification as [Country].

Parameters:
name - variable name.
definition - the definition of the variable formula.
Returns:
a new variable
Throws:
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
REException
Since:
12.0
See Also:
ReportDictionary.createVariable(String, ObjectQualification, String)