|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ConditionPrompt
Warning: This interface is no longer functional from the SAP BusinessObjects 4.0 release onwards.
TheConditionPrompt interface defines a prompt for a condition.
| Method Summary | |
|---|---|
void |
addDefault(java.lang.String value)
Adds a value that will be entered into the prompt by default. |
void |
addDefault(ValueFromLov value)
Adds a value that will be entered into the prompt by default. |
void |
clearDefaultValues()
Clears any default values. |
java.lang.String |
getDefault(int index)
Returns a default value at a given index. |
int |
getDefaultCount()
Returns the count of default values. |
ValueFromLov |
getDefaultValueFromLov(int index)
Returns a default value at a given index. |
java.lang.String |
getInputFormat()
Returns the default input format for the object of this prompt. |
boolean |
getKeepValues()
Checks if the value(s) entered will be kept for the next time when the user is prompted. |
java.lang.String |
getQuestion()
Returns the question that will be presented to the user when the prompt needs a value. |
ObjectType |
getType()
Returns the type of the object of the underlying ConditionObject. |
boolean |
hasLOV()
Checks if this prompt have a list of values. |
void |
hasLOV(boolean b)
When set to true, a list of values will be presented to the user when prompted to enter a value for prompt. |
boolean |
isConstrained()
Checks if the user can type a value for this prompt. |
boolean |
isMonoValue()
Checks if multiple values are allowed. |
boolean |
isOptional()
Checks if entering a value for this ConditionalPrompt is optional. |
void |
setConstrained(boolean constrain)
Determines whether a user can type a value. |
void |
setKeepValues(boolean b)
Specifies if values are kept after entering them. |
void |
setMonoValue(boolean mono)
Determines whether multiple values are allowed. |
void |
setOptional(boolean isOptional)
Specifies if entering value for this ConditionalPrompt is optional. |
void |
setQuestion(java.lang.String question)
Changes the question that will be presented to the user when the prompt needs a value. |
| Method Detail |
|---|
java.lang.String getQuestion()
void setQuestion(java.lang.String question)
Note: The question string is used as the unique identifier. If the same question
is used for more than one prompt, the user will be prompted only once.
question - The question to be asked.
java.lang.NullPointerException - When question is null.ObjectType getType()
ConditionObject.
java.lang.String getInputFormat()
Returns the default input format for the object of this prompt.
Depending on the ObjectType of the underlying
ConditionObject's DataSourceObject, a value will be
returned.
This method is especially useful for determining the way a date is
expected, for example this might be dd/mm/yy or
mm/dd/yy. The default input format depends on the locale
passed to ReportEngine.init(Object, String).
Note that, as there is no way to tell if an
ObjectType.NUMERIC represents a currency, in no case
will this return a currency format.
ConditionPrompt.getType(),
ReportEngine.getDefaultFormatNumber(FormatNumberType)boolean isConstrained()
true when a user can type a value for this promptvoid setConstrained(boolean constrain)
constrain - when true, a user can type a value for this prompt.boolean isMonoValue()
true when multiple values are not allowed.void setMonoValue(boolean mono)
mono - when true, multiple values are not allowed.boolean hasLOV()
true, when this prompt has a list of values.void hasLOV(boolean b)
true, a list of values will be presented to the user when prompted to enter a value for prompt.
b - when true, a list of values will be presented to the
user when prompted to enter a value for prompt.boolean getKeepValues()
true when values are kept.void setKeepValues(boolean b)
b - when true, values entered will be kept for the next
time this prompt is presented.void setOptional(boolean isOptional)
ConditionalPrompt is optional.
If specified true , then entering value for the current ConditionalPrompt is optional i.e.
user can skip this prompt when running a query.
If set to false, then a value must be selected when running a query.
Example:Setting optional prompts
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 country = ds.getClasses().getChildByName("Country");
DataSourceObject revenue = ds.getClasses().getChildByName("Revenue");
Query q = dp.getQuery();
// Add result objects to the query
q.addResultObject(country);
// q.addResultObject(year);
q.addResultObject(revenue);
ConditionContainer condCon = q.createCondition(LogicalOperator.OR);
ConditionObject condObj = condCon.createConditionObject(country);
FilterCondition filterCon = condObj.createFilterCondition(Operator.IN_LIST);
ConditionPrompt condPrompt = filterCon.createConditionPrompt("Country ?");
condPrompt.setOptional(true);
// Run the query and fetch the data
dp.runQuery();
doc.refresh();
out.print("Document has prompt: " +doc.getMustFillPrompts());
Prompts prompts = doc.getPrompts();
Prompt prompt = prompts.getItem(0);
out.print("Prompt is Optional: "+prompt.isOptional());
isOptional - true or falseConditionPrompt.isOptional()boolean isOptional()
ConditionalPrompt is optional.
true if entering value is optional, otherwise false.ConditionPrompt.setOptional(boolean),
Prompt.isOptional()void addDefault(java.lang.String value)
value - the value
java.lang.NullPointerException - when value is nullPrompt.getDefaultValues()void addDefault(ValueFromLov value)
value - the value which is an object of the class ValueFromLov
java.lang.NullPointerException - when value is nulljava.lang.String getDefault(int index)
index - the index of the element to return (0 based)
java.lang.ArrayIndexOutOfBoundsException - when index is invalid
(index < 0 || index >= getDefaultCount())Prompt.getDefaultValues()ValueFromLov getDefaultValueFromLov(int index)
index - the index of the element to return (0 based)
ValueFromLov
java.lang.ArrayIndexOutOfBoundsException - when index is invalid
(index < 0 || index >= getDefaultCount())int getDefaultCount()
void clearDefaultValues()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||