Package quadbase.common.param
Interface Param
public interface Param
This interface represents a parameter used in a template, it can be used to retrieve information
about the parameter such as name, prompt name, as well as set or get its current
values.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThis is the parent() value of a Param who belongs to the root report (non sub report). -
Method Summary
Modifier and TypeMethodDescriptionIf (isMapToColumn()) Returns the column nameThe custom date format.Returns the default value.quadbase.common.formula.FormulaReturns default value of a date parameter as a date expression (ex.Returns the description of the parameter displayed on the pop up dialog.quadbase.common.util.IQueryFileInfointernal use onlyquadbase.reportdesigner.report.Reportinternal use onlyGets a Vector of objects of the corresponding SQL type that are unique values of this parameter retrieved from the database.intReturns java.sql.TypesIf (isMapToColumn()) Returns the table namegetValue()Returns the current value of the parameter as the appropriate java object.If (this.multiValue()), returns the current values of the parameter as a Vector of the appropriate java objects, else returns null.quadbase.common.formula.FormulaReturns value of a date parameter as a date expression (ex.booleanWhether this parameter is a date and its value provided by the user with setValue() is a custom date format.booleanWhether this is a formula parameter (not query parameter)booleanWhen using the parameter dialog or the ParameterPageWriter this attributes is used to control whether a selection list or a input text box is used.booleanbooleanWhether this parameter can take multiple values.name()The name of this parameterparent()The name of the template that contains this parameter.voidsetColumnName(String columnName) If (isMapToColumn()) Set the column namevoidvoidsetDefaultValue(Object defaultValue) Set default valuevoidsetDefaultValueVariable(quadbase.common.formula.Formula f) Set default value of a date parameter to a date expression (ex.voidsetMapToColumn(boolean mapToColumn) Enables or disables mapToColumn.voidsetPromptName(String promptName) Set the description of the parameter displayed on the pop up dialog.voidsetQueryFileInfo(quadbase.common.util.IQueryFileInfo qf) internal use onlyvoidsetReport(quadbase.reportdesigner.report.Report r) internal use onlyvoidvoidsetSqlType(int sqlType) Set java.sql.TypesvoidsetTableName(String tableName) If (isMapToColumn()) Set the table namevoidSets the current value of the paremeter as the appropriate java object if and only if (!this.multiValue()).voidIf (this.multiValue()), Sets the current values of the parameter as a Vector of the appropriate java objects, else returns null.voidsetValueVariable(quadbase.common.formula.Formula f) Set value of a date parameter to a date expression (ex.
-
Field Details
-
ROOT_REPORT
This is the parent() value of a Param who belongs to the root report (non sub report).- See Also:
-
-
Method Details
-
name
String name()The name of this parameter -
parent
String parent()The name of the template that contains this parameter.- Returns:
- the name of the template that contains this parameter, or Param.ROOT_REPORT if this is the root (main) report.
-
getPromptName
String getPromptName()Returns the description of the parameter displayed on the pop up dialog. -
setPromptName
Set the description of the parameter displayed on the pop up dialog. -
isFormulaParam
boolean isFormulaParam()Whether this is a formula parameter (not query parameter) -
isCustomDateFormat
boolean isCustomDateFormat()Whether this parameter is a date and its value provided by the user with setValue() is a custom date format. If true, it allows the user to provide a custom date format to convert a string into a java Date object. This can be used for parameters with type DATE, TIME, or TIMESTAMP. This is only applicable if the parameter value is to be filled in by the user and not chosen from a list of predefined values. The date format should follow the guidlines defined in java.text.SimpleDateFormat. -
getDateFormat
String getDateFormat()The custom date format.- See Also:
-
isMapToColumn
boolean isMapToColumn()When using the parameter dialog or the ParameterPageWriter this attributes is used to control whether a selection list or a input text box is used. If true, a selection list is used, else a text box.
If isMapToColumn() returns true, getTableName() and getColumnName() will be called to find out all distinct values from database. Then the values will be displayed in a choice box. The java.sql.Types of the column is retrived from the meta data of database.
If isMapToColumn() returns false, getSqlType() is called to get the java.sql.Types of the input value. A text field will be shown instead of a choice box. It is useful if you don't want to expose the contents of database. -
setMapToColumn
void setMapToColumn(boolean mapToColumn) Enables or disables mapToColumn.- See Also:
-
getTableName
String getTableName()If (isMapToColumn()) Returns the table name- See Also:
-
setTableName
If (isMapToColumn()) Set the table name- See Also:
-
getColumnName
String getColumnName()If (isMapToColumn()) Returns the column name- See Also:
-
setColumnName
If (isMapToColumn()) Set the column name- See Also:
-
getSqlType
int getSqlType()Returns java.sql.Types -
setSqlType
void setSqlType(int sqlType) Set java.sql.Types -
multiValue
boolean multiValue()Whether this parameter can take multiple values. If true, then calling setValue(Vector) sets multiple values. -
getValue
Object getValue()Returns the current value of the parameter as the appropriate java object. Returns null if (this.multiValue()). -
getValues
Vector getValues()If (this.multiValue()), returns the current values of the parameter as a Vector of the appropriate java objects, else returns null. -
setValue
Sets the current value of the paremeter as the appropriate java object if and only if (!this.multiValue()). -
setValues
If (this.multiValue()), Sets the current values of the parameter as a Vector of the appropriate java objects, else returns null. -
getDefaultValue
Object getDefaultValue()Returns the default value. -
setDefaultValue
Set default value -
getDefaultValueVariable
quadbase.common.formula.Formula getDefaultValueVariable()Returns default value of a date parameter as a date expression (ex. CurrentDate - 1 WEEK)- Returns:
- Formula date expression
-
setDefaultValueVariable
void setDefaultValueVariable(quadbase.common.formula.Formula f) Set default value of a date parameter to a date expression (ex. CurrentDate - 1 WEEK)- Parameters:
Formula- date expression
-
getValueVariable
quadbase.common.formula.Formula getValueVariable()Returns value of a date parameter as a date expression (ex. CurrentDate - 1 WEEK)- Returns:
- Formula date expression
-
setValueVariable
void setValueVariable(quadbase.common.formula.Formula f) Set value of a date parameter to a date expression (ex. CurrentDate - 1 WEEK)- Parameters:
Formula- date expression
-
getSelectionChoices
Vector getSelectionChoices()Gets a Vector of objects of the corresponding SQL type that are unique values of this parameter retrieved from the database.- Returns:
- null if a selection is not available
-
getSqlSelect
String getSqlSelect() -
setSqlSelect
-
getDefaultSql
String getDefaultSql() -
setDefaultSql
-
getQueryFileInfo
quadbase.common.util.IQueryFileInfo getQueryFileInfo()internal use only -
setQueryFileInfo
void setQueryFileInfo(quadbase.common.util.IQueryFileInfo qf) internal use only -
getReport
quadbase.reportdesigner.report.Report getReport()internal use only -
setReport
void setReport(quadbase.reportdesigner.report.Report r) internal use only -
isUnmapped
boolean isUnmapped()
-