Package com.inet.report
Class Fields
- java.lang.Object
-
- com.inet.report.Fields
-
- All Implemented Interfaces:
java.io.Serializable
public class Fields extends java.lang.Object implements java.io.Serializable
TheFields
set for the Runtime Designer Component. This class manages all kinds ofField
s,DatabaseFields
,FormulaFields
,PromptFields
, etc. You can add, get, count and remove each kind ofField
s with this class.
When you want to instantiate a field by name, the name of the field should start with a special character:
- no character, if the field is a database field
- a '%', if the field is a
SqlExprField
- a '#', if the field is a
SummaryField
- a '@', if the field is a
FormulaField
- a '?', if the field is a
PromptField
You cannot instantiate this class directly, i.e. withnew Fields()
. Access with theget*Field
methods included in this class and with methodEngine.getFields()
in class Engine.- See Also:
DatabaseField
,FormulaField
,SummaryField
,PromptField
,SortField
,GroupField
,SQLField
,SpecialField
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
Fields.UnknownField
FOR INTERNAL USE ONLY a placeholder field for when a field could not be parsed
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormulaField
addFormulaField(java.lang.String name, java.lang.String formula, int type)
Add a new formula field into the set of formula fields.
The formula is checked during execution of this method.
Note: If the formula contains a summary operation, which requiers a group (as cond) you have to implement theRDC.MsgListener
interface if the group does not exist when the formula is checked.com.inet.report.formula.userfunctions.UserFunction
addFunction(java.lang.String name, java.lang.String formula, int syntax)
Adds a user function to the reportvoid
addListener(RDC.FieldsRefreshListener frl)
All added listeners will get a refresh call if this fields list is changed.PromptField
addPromptField(java.lang.String name, java.lang.String text, int type)
Adds a new prompt field to the set of prompt fields.SortField
addSortField(Field field, int type)
Creates a new sort field and adds it to this fields set.SortField
addSortField(Field field, FormulaField formula)
Creates a new sort field and adds it to this fields set.SortField
addSortField(java.lang.String name, int type)
Creates a new sort field and adds it to this fields set.SQLField
addSQLField(java.lang.String name, int valueType, java.lang.String sqlExpression, Datasource datasource)
Adds a new sql field to the set of sql fields.SQLField
addSQLField(java.lang.String name, java.lang.String sqlExpression)
Adds a new sql field to the set of sql fields.SummaryField
addSummaryField(Field field, int operation, java.lang.String name)
Adds a new summary field into the set of summary fields.SummaryField
addSummaryField(Field field, Field field2nd, int operation, java.lang.String name)
Adds a new summary field into the set of summary fields.void
changeAllAliases(java.lang.String newAlias, Datasource dc)
FOR INTERNAL USE ONLYvoid
changeAllAliases(java.lang.String oldAlias, java.lang.String newAlias, Datasource dc)
FOR INTERNAL USE ONLYboolean
checkIfNameExists(int type, java.lang.String name)
If a field with typetype
and namename
already exists thentrue
is returned, otherwisefalse
.DatabaseField
getDatabaseField(int idx)
Returns the idx-th element of database fields array.DatabaseField
getDatabaseField(java.lang.String dbColName)
Returns the DatabaseField with namedbColName
ornull
if not existent in report.int
getDatabaseFieldsCount()
Returns the number of database fields of this report.FormulaField
getFormulaField(int idx)
Returns the i-th element of Formula Fields array.FormulaField
getFormulaField(java.lang.String fieldName)
Returns the FormulaField with namefieldName
ornull
if not existent in report.int
getFormulaFieldsCount()
Returns the number of user formulas in this report.com.inet.report.formula.userfunctions.UserFunction
getFunction(int index)
Returns the user defined functions at the specified indexcom.inet.report.formula.userfunctions.UserFunction
getFunction(java.lang.String name)
Returns the user defined function with the specified nameint
getFunctionsCount()
Returns the number of user defined functions in this reportGroupField
getGroupNameField(int idx)
Returns the i-th element of group name fields array.GroupField
getGroupNameField(java.lang.String fieldName)
Returns the GroupField with namefieldName
ornull
if not existent in report.int
getGroupNameFieldsCount()
Returns the number of group name fields defined in this report.PromptField
getPromptField(int idx)
Returns the i-th element of Prompt Variable Fields array.PromptField
getPromptField(java.lang.String fieldName)
Returns the PromptField with namefieldName
ornull
if not existent in report.int
getPromptFieldsCount()
Returns the number of prompt fields defined for this report.SortField
getSortField(int idx)
Returns the i-th element of sort fields array.SortField
getSortField(java.lang.String fieldName)
Returns the SortField with namefieldName
ornull
if not existent in report.int
getSortFieldsCount()
Returns the number of the sort fields defined in this report.SpecialField
getSpecialField(int type)
Returns the special field with the specified operation.int
getSpecialFieldsCount()
Returns the number of special fields defined in this report.SQLField
getSQLExpressionField(int idx)
Returns the i-th element of SQL Expression Fields array.SQLField
getSQLExpressionField(java.lang.String fieldName)
Returns the SQLField with namefieldName
ornull
if not existent in report.int
getSQLExpressionFieldsCount()
Returns the number of SQL expression fields defined in this report.SummaryField
getSummaryField(int idx)
Returns the i-th element of SummaryFields array.SummaryField
getSummaryField(java.lang.String fieldName)
Returns the SummaryField with namefieldName
ornull
if not existent in report.int
getSummaryFieldsCount()
Returns the number of summary fields defined in this report.void
movePromptField(int from, int to)
Changes the position of a PromptField by moving it to the specified position.void
moveSortField(int from, int to)
Changes the position of a sort field.boolean
onlyTablesAndOneConnection()
FOR INTERNAL USE ONLYvoid
removeDatabaseField(int idx)
Removes a dataBase field from fields set and all Elements which references to it.boolean
removeField(Field field)
Removes a specific field.void
removeFormulaField(int idx)
Removes an existing formula field from set.void
removeListener(RDC.FieldsRefreshListener frl)
Remove a previously added listener.void
removePromptField(int idx)
Removes an existing prompt field from set.void
removeSortField(int idx)
Removes the sort field specified by the array index from set of sort fields.void
removeSQLField(int idx)
Removes an existing sql expression field from report design.void
removeSummaryField(int idx)
Removes an existing summary field from set.SummaryField
sumFieldExists(int sumTyp, java.lang.String field, java.lang.String field2, java.lang.String group, int nth, int condition)
FOR INTERNAL USE ONLY Checks if a SummaryField with SummaryOperationsumTyp
and columnfield
and (if notnull
) condition fieldgroup
exists.
-
-
-
Method Detail
-
getDatabaseField
public DatabaseField getDatabaseField(int idx) throws ReportException
Returns the idx-th element of database fields array.- Parameters:
idx
- The 0-based index of the required field.- Returns:
- The with idx specified database field
- Throws:
ReportException
- will be thrown if Engine was invalid or finished.java.lang.IndexOutOfBoundsException
- will be thrown if index was less than 0 or greater than size of fields set.- Since:
- 6.0
-
getDatabaseFieldsCount
public int getDatabaseFieldsCount()
Returns the number of database fields of this report. This is equals to the sum of all columns of all tables or stored procedures used in this report.- Returns:
- The number of database fields of this report.
- Since:
- 6.0
-
removeDatabaseField
public void removeDatabaseField(int idx) throws ReportException
Removes a dataBase field from fields set and all Elements which references to it.- Parameters:
idx
- The 0-based array index.- Throws:
ReportException
- will be thrown if Engine was invalid or finished.java.lang.IndexOutOfBoundsException
- will be thrown if index was less than 0 or greater than size of fields set.- Since:
- 6.0
-
getDatabaseField
public DatabaseField getDatabaseField(java.lang.String dbColName)
Returns the DatabaseField with namedbColName
ornull
if not existent in report.- Parameters:
dbColName
- The full name of the database column, i.e. Produkt.Id (alias.column).- Returns:
- The DatabaseField with this name or null if no match.
- Since:
- 6.0
-
getFormulaField
public FormulaField getFormulaField(java.lang.String fieldName)
Returns the FormulaField with namefieldName
ornull
if not existent in report.- Parameters:
fieldName
- The name of the FormulaField to be returned.- Returns:
- The FormulaField with this name or null if no match.
- Since:
- 6.0
-
getSummaryField
public SummaryField getSummaryField(java.lang.String fieldName)
Returns the SummaryField with namefieldName
ornull
if not existent in report.- Parameters:
fieldName
- The name of the SummaryField to be returned.- Returns:
- The SummaryField with this name or null if no match.
- Since:
- 6.0
-
getGroupNameField
public GroupField getGroupNameField(java.lang.String fieldName)
Returns the GroupField with namefieldName
ornull
if not existent in report.- Parameters:
fieldName
- The name of the GroupField to be returned.- Returns:
- The GroupField with this name or null if no match.
- Since:
- 6.0
-
getPromptField
public PromptField getPromptField(java.lang.String fieldName)
Returns the PromptField with namefieldName
ornull
if not existent in report.- Parameters:
fieldName
- The name of the PromptField to be returned.- Returns:
- The PromptField with this name or null if no match.
- Since:
- 6.0
-
getSQLExpressionField
public SQLField getSQLExpressionField(java.lang.String fieldName)
Returns the SQLField with namefieldName
ornull
if not existent in report.- Parameters:
fieldName
- The name of the SQLField to be returned.- Returns:
- The SQLField with this name or null if no match.
- Since:
- 6.0
-
getFormulaField
public FormulaField getFormulaField(int idx) throws ReportException
Returns the i-th element of Formula Fields array.- Parameters:
idx
- The 0-based index of the required field.- Returns:
- The field at the array position idx.
- Throws:
ReportException
- will be thrown if Engine was invalid or finished.java.lang.IndexOutOfBoundsException
- will be thrown if index was less than 0 or greater than size of fields set.- Since:
- 6.0
-
getFormulaFieldsCount
public int getFormulaFieldsCount()
Returns the number of user formulas in this report. It will not include property formulas.- Returns:
- The number of user formulas in this report.
- Since:
- 6.0
-
addFormulaField
public FormulaField addFormulaField(java.lang.String name, java.lang.String formula, int type)
Add a new formula field into the set of formula fields.
The formula is checked during execution of this method.
Note: If the formula contains a summary operation, which requiers a group (as cond) you have to implement theRDC.MsgListener
interface if the group does not exist when the formula is checked.- Parameters:
name
- The name of the formula field, the name should not null, not empty and not used in another formula already. If the formula is a "user formula" this value must be not null and not empty.formula
- The formula as String, i.e. "if {Kunde.Kunden-ID} mod 2 = 0 then 1 else 0".type
- The type of the formula field specifies the usableness. This can be:- User - All formulas except record/group selection formulas and property formulas. A non empty name is required.
- Property - Formulas which determinate property values dynamically. The formula cannot be used in other formulas.
- Returns:
- The created formula field.
- Throws:
java.lang.IllegalArgumentException
- will be thrown if the type of the formula is "user formula" and the parameter name is null or have a zero lenght, or the formula contains errors.- Since:
- 6.0
- See Also:
FormulaField.FORMULA_USER
,FormulaField.FORMULA_PROPERTY
-
removeFormulaField
public void removeFormulaField(int idx) throws ReportException
Removes an existing formula field from set.- Parameters:
idx
- The 0-based index of the formula field that should removed from set.- Throws:
ReportException
- will be thrown if Engine was invalid or finished.java.lang.IndexOutOfBoundsException
- will be thrown if index was less than 0 or greater than size of fields set.- Since:
- 6.0
-
getPromptField
public PromptField getPromptField(int idx) throws ReportException
Returns the i-th element of Prompt Variable Fields array.- Parameters:
idx
- The 0-based index of the required field.- Returns:
- The field at the array position idx.
- Throws:
ReportException
- will be thrown if Engine was invalid or finished.java.lang.IndexOutOfBoundsException
- will be thrown if index was less than 0 or greater than size of fields set.- Since:
- 6.0
-
getPromptFieldsCount
public int getPromptFieldsCount()
Returns the number of prompt fields defined for this report.- Returns:
- The number of prompt fields in this report.
- Since:
- 6.0
-
movePromptField
public void movePromptField(int from, int to) throws ReportException
Changes the position of a PromptField by moving it to the specified position. This has the effect of changing the prompt order in the user prompt request dialog. This method is equivalent to a remove at the old position and an insert at the new position, that is, all prompt fields in between the two indexes will slide one spot left.- Parameters:
from
- The current 0-based index of the PromptFieldto
- The new 0-based index of the PromptField- Throws:
ReportException
- will be thrown if Engine was invalid or finished.java.lang.IndexOutOfBoundsException
- will be thrown if one of the indexes was less than 0 or greater than size of fields set.- Since:
- 6.0
-
addPromptField
public PromptField addPromptField(java.lang.String name, java.lang.String text, int type) throws ReportException
Adds a new prompt field to the set of prompt fields.- Parameters:
name
- The name of the prompt field (hat to be unique).type
- The value type of the prompt field.text
- The text that asks the user for a value.- Returns:
- The created prompt field.
- Throws:
ReportException
- if valuetype
is not a legal constant orname
is already in use.- Since:
- 6.0
- See Also:
Field.NUMBER
,Field.CURRENCY
,Field.BOOLEAN
,Field.DATE
,Field.TIME
,Field.DATETIME
,Field.STRING
,Field.BINARY
-
removePromptField
public void removePromptField(int idx) throws ReportException
Removes an existing prompt field from set. If the field to be removed is a parent of a cascading prompt field, the cascading prompt field's value provider will be transformed into a simple FieldValueProvider.- Parameters:
idx
- The 0-based index of the prompt field that should removed from set.- Throws:
ReportException
- will be thrown if Engine was invalid or finished.java.lang.IndexOutOfBoundsException
- will be thrown if index was less than 0 or greater than size of fields set.- Since:
- 6.0
- See Also:
PromptField.getDefaultValueProvider()
,PromptField.setDefaultValueProvider(DynamicValueProvider)
,CascadingValueProvider
,FieldValueProvider
-
getGroupNameField
public GroupField getGroupNameField(int idx) throws ReportException
Returns the i-th element of group name fields array.- Parameters:
idx
- The index of the required field.- Returns:
- The field at the array position idx.
- Throws:
ReportException
- will be thrown if Engine was invalid or finished.java.lang.IndexOutOfBoundsException
- will be thrown if index was less than 0 or greater than size of fields set.- Since:
- 6.0
- See Also:
Group.getGroupNameField()
-
getGroupNameFieldsCount
public int getGroupNameFieldsCount()
Returns the number of group name fields defined in this report. This is equal to the number of groups defined as each group creates a group name field.- Returns:
- The number of group name fields in this report.
- Since:
- 6.0
-
getSummaryField
public SummaryField getSummaryField(int idx) throws ReportException
Returns the i-th element of SummaryFields array.- Parameters:
idx
- The 0-based index of the required field.- Returns:
- The field at the array position idx.
- Throws:
ReportException
- will be thrown if Engine was invalid or finished.java.lang.IndexOutOfBoundsException
- will be thrown if index was less than 0 or greater than size of fields set.- Since:
- 6.0
-
getSummaryFieldsCount
public int getSummaryFieldsCount()
Returns the number of summary fields defined in this report.- Returns:
- The number of summary fields defined in this report.
- Since:
- 6.0
-
addSummaryField
public SummaryField addSummaryField(Field field, int operation, java.lang.String name) throws ReportException
Adds a new summary field into the set of summary fields.- Parameters:
field
- The field to summarize.operation
- The operation of summarize, i.e. sum, maximum, average.name
- The name of the SummaryField.- Returns:
- The created summary field.
- Throws:
ReportException
- is thrown if value type does not match.- Since:
- 6.0
- See Also:
SummaryField.SUM
,SummaryField.AVERAGE
,SummaryField.SAMPLE_VARIANCE
,SummaryField.SAMPLE_STANDARD_DEVIATION
,SummaryField.MAXIMUM
,SummaryField.MINIMUM
,SummaryField.COUNT
,SummaryField.CORRELATION
,SummaryField.COVARIANCE
,SummaryField.WEIGHTED_AVERAGE
,SummaryField.POP_VARIANCE
,SummaryField.POP_STANDARD_DEVIATION
,SummaryField.DISTINCT_COUNT
,SummaryField.MEDIAN
,SummaryField.PERCENTILE
,SummaryField.NTH_LARGEST
,SummaryField.NTH_SMALLEST
,SummaryField.MODE
,SummaryField.NTH_MOST_FREQUENT
,SummaryField.PERCENTAGE
,SummaryField.NO_SUMMARY_OPERATION
,SummaryField.setChangeField(com.inet.report.Field)
,SummaryField.setResetField(com.inet.report.Field)
-
addSummaryField
public SummaryField addSummaryField(Field field, Field field2nd, int operation, java.lang.String name) throws ReportException
Adds a new summary field into the set of summary fields.- Parameters:
field
- The field to summarize.field2nd
- The second field used by the summary. This field is needed for the summary typesSummaryField.CORRELATION
,SummaryField.COVARIANCE
andSummaryField.WEIGHTED_AVERAGE
.operation
- The operation of summarize, i.e. sum, maximum, average.name
- The name of the SummaryField.- Returns:
- The created summary field.
- Throws:
ReportException
- is thrown if value type does not match.- Since:
- 6.0
- See Also:
SummaryField.CORRELATION
,SummaryField.COVARIANCE
,SummaryField.WEIGHTED_AVERAGE
,SummaryField.setChangeField(com.inet.report.Field)
,SummaryField.setResetField(com.inet.report.Field)
-
removeSummaryField
public void removeSummaryField(int idx) throws ReportException
Removes an existing summary field from set.- Parameters:
idx
- The 0-based index of the summary field that should removed from set.- Throws:
ReportException
- will be thrown if Engine was invalid or finished.java.lang.IndexOutOfBoundsException
- will be thrown if index was less than 0 or greater than size of fields set.- Since:
- 6.0
-
getSpecialField
public SpecialField getSpecialField(int type)
Returns the special field with the specified operation.- Parameters:
type
- The type of the SpecialField.- Returns:
- The special field of the desired type.
- Throws:
java.lang.IndexOutOfBoundsException
- If desired type is invalid.- Since:
- 6.0
- See Also:
SpecialField.PRINT_DATE
,SpecialField.PRINT_TIME
,SpecialField.PRINT_TIME_ZONE
,SpecialField.MODIFICATION_DATE
,SpecialField.MODIFICATION_TIME
,SpecialField.DATA_DATE
,SpecialField.DATA_TIME
,SpecialField.DATA_TIME_ZONE
,SpecialField.RECORD_NUMBER
,SpecialField.RECORD_COUNT
,SpecialField.PAGE_NUMBER
,SpecialField.GROUP_NUMBER
,SpecialField.TOTAL_PAGE_COUNT
,SpecialField.REPORT_TITLE
,SpecialField.REPORT_COMMENTS
,SpecialField.RECORD_SELECTION_FORMULA
,SpecialField.GROUP_SELECTION_FORMULA
,SpecialField.REPORT_FILE
,SpecialField.REPORT_AUTHOR
,SpecialField.CREATION_DATE
,SpecialField.PAGE_N_OF_M
,SpecialField.HORIZONTAL_PAGE_NUMBER
,SpecialField.CURRENT_USER_NAME
,SpecialField.CURRENT_USER_TIME_ZONE
,SpecialField.CONTENT_LOCALE
,SpecialField.SELECTION_LOCALE
-
getSpecialFieldsCount
public int getSpecialFieldsCount()
Returns the number of special fields defined in this report.- Returns:
- The number of special fields in this report.
- Since:
- 6.0
-
getSQLExpressionField
public SQLField getSQLExpressionField(int idx) throws ReportException
Returns the i-th element of SQL Expression Fields array.- Parameters:
idx
- The 0-based index of the required field.- Returns:
- The field at the array position idx.
- Throws:
ReportException
- will be thrown if Engine was invalid or finished.java.lang.IndexOutOfBoundsException
- will be thrown if index was less than 0 or greater than size of fields set.- Since:
- 6.0
-
getSQLExpressionFieldsCount
public int getSQLExpressionFieldsCount()
Returns the number of SQL expression fields defined in this report.- Returns:
- The number of SQL expression fields in this report.
- Since:
- 6.0
-
addSQLField
public SQLField addSQLField(java.lang.String name, java.lang.String sqlExpression) throws ReportException
Adds a new sql field to the set of sql fields.- Parameters:
name
- A unique name for the sql field to create.sqlExpression
- The sql expression as String.- Returns:
- The created sql field.
- Throws:
ReportException
- will be thrown if the name already exists or is empty.- Since:
- 6.0
-
addSQLField
public SQLField addSQLField(java.lang.String name, int valueType, java.lang.String sqlExpression, Datasource datasource) throws ReportException
Adds a new sql field to the set of sql fields. Starts no DB request to check the value type of field if the value type is known.- Parameters:
name
- A unique name for the sql field to create.valueType
- the type of values, if type unknown it will request the value type from dbsqlExpression
- The sql expression as String.datasource
- The data source to get connection for this sql field.- Returns:
- The created sql field.
- Throws:
ReportException
- will be thrown if the name already exists or is empty or any problems occurs by checking connection.java.lang.IllegalArgumentException
- if datasource is null- Since:
- 9.2
-
removeSQLField
public void removeSQLField(int idx) throws ReportException
Removes an existing sql expression field from report design.- Parameters:
idx
- The 0-based index of the sql field that should removed from report design.- Throws:
ReportException
- will be thrown if the Engine was invalid or finished.java.lang.IndexOutOfBoundsException
- will be thrown if index was less than 0 or greater than size of fields set.- Since:
- 6.0
-
getSortField
public SortField getSortField(java.lang.String fieldName)
Returns the SortField with namefieldName
ornull
if not existent in report.- Parameters:
fieldName
- The name of the SummaryField to be returned.- Returns:
- The SortField with this name or null if no match.
- Since:
- 13.0
-
getSortField
public SortField getSortField(int idx) throws ReportException
Returns the i-th element of sort fields array.- Parameters:
idx
- The 0-based index of the required field.- Returns:
- The field at the array position idx.
- Throws:
ReportException
- will be thrown if Engine was invalid or finished.java.lang.IndexOutOfBoundsException
- will be thrown if index was less than 0 or greater than size of fields set.- Since:
- 6.0
-
getSortFieldsCount
public int getSortFieldsCount()
Returns the number of the sort fields defined in this report. This will not include any group defined in the report which may also influence the sorting. If there are sort fields defined in a query file they will be included.- Returns:
- The number of sort fields of this report.
- Since:
- 6.0
-
addSortField
public SortField addSortField(java.lang.String name, int type) throws ReportException
Creates a new sort field and adds it to this fields set.- Parameters:
name
- The name of the field that values should be sorted. The name of the field should start with a special character for instanciation:
- no character, if the field is a database field
- a '%', if the field is a SqlExprField
- a '#', if the field is a SummaryField
- a '@', if the field is a FormulaField
- a '?', if the field is a PromptField
type
- The type of the sort field - ascending or descending.- Returns:
- The created sort field.
- Throws:
ReportException
- is thrown if value type does not match.- Since:
- 6.0
- See Also:
SortField.ASCENDING_ORDER
,SortField.DESCENDING_ORDER
-
addSortField
public SortField addSortField(Field field, int type) throws ReportException
Creates a new sort field and adds it to this fields set.- Parameters:
field
- The field that values should be sorted.type
- The type of the sort field - ascending or descending.- Returns:
- The created sort field.
- Throws:
ReportException
- is thrown if value type does not match.java.lang.IllegalArgumentException
- if the field is null- Since:
- 6.0
- See Also:
SortField.ASCENDING_ORDER
,SortField.DESCENDING_ORDER
-
addSortField
public SortField addSortField(Field field, FormulaField formula) throws ReportException
Creates a new sort field and adds it to this fields set.- Parameters:
field
- The field that values should be sorted.formula
- The type of the sort field defined over formula.- Returns:
- The created sort field.
- Throws:
ReportException
- will be thrown if value type does not match.- Since:
- 6.0
- See Also:
SortField.ASCENDING_ORDER
,SortField.DESCENDING_ORDER
,SortField.ORIGINAL_ORDER
,SortField.setSortDirectionFormula(FormulaField)
-
removeSortField
public void removeSortField(int idx) throws ReportException
Removes the sort field specified by the array index from set of sort fields.- Parameters:
idx
- The 0-based array index of the sort field that should be deleted.- Throws:
ReportException
- will be thrown if Engine was invalid or finished.java.lang.IndexOutOfBoundsException
- will be thrown if index was less than 0 or greater than size of fields set.- Since:
- 6.0
-
moveSortField
public void moveSortField(int from, int to) throws java.lang.IndexOutOfBoundsException, ReportException
Changes the position of a sort field.- Parameters:
from
- the original 0-based index positionto
- the new 0-based index position- Throws:
java.lang.IndexOutOfBoundsException
- if one of the indexes is out of rangeReportException
- will be thrown if Engine was invalid or finished.- Since:
- 13.1
-
sumFieldExists
public SummaryField sumFieldExists(int sumTyp, java.lang.String field, java.lang.String field2, java.lang.String group, int nth, int condition)
FOR INTERNAL USE ONLY Checks if a SummaryField with SummaryOperationsumTyp
and columnfield
and (if notnull
) condition fieldgroup
exists. Returns the field if exists.- Parameters:
sumTyp
- The summary operation type.field
- The name of the field to create a sum from.field2
- The name of the second field to create a sum from. (Only needed for some summary types)group
- Name of the group to create a sum for.nth
- The ntp property if needed by the summary type.condition
- The group's condition type (specified by the Group PRINT constants)- Returns:
- The SummaryField if it exists already otherwise
null
- See Also:
Group.PRINT_FOR_EACH_DAY
-
checkIfNameExists
public boolean checkIfNameExists(int type, java.lang.String name)
If a field with typetype
and namename
already exists thentrue
is returned, otherwisefalse
.- Parameters:
type
- - the type of the fieldname
- - the name to check- Returns:
- boolean True if the field exists false otherwise.
- Throws:
java.lang.IllegalArgumentException
- If the field type was invalid.- Since:
- 6.0
- See Also:
Field.getType()
-
addListener
public void addListener(RDC.FieldsRefreshListener frl)
All added listeners will get a refresh call if this fields list is changed.- Parameters:
frl
- An object which implements the RDC.FieldsRefreshListener and should handle the call-back for this fields list.- Since:
- 6.0
-
removeListener
public void removeListener(RDC.FieldsRefreshListener frl)
Remove a previously added listener.- Parameters:
frl
- An object which implements the RDC.FieldsRefreshListener interface and should handle the call-back for this fields list.- Since:
- 6.0
-
changeAllAliases
public void changeAllAliases(java.lang.String newAlias, Datasource dc) throws ReportException
FOR INTERNAL USE ONLY- Throws:
ReportException
-
changeAllAliases
public void changeAllAliases(java.lang.String oldAlias, java.lang.String newAlias, Datasource dc) throws ReportException
FOR INTERNAL USE ONLY- Throws:
ReportException
-
onlyTablesAndOneConnection
public boolean onlyTablesAndOneConnection()
FOR INTERNAL USE ONLY
-
getFunctionsCount
public int getFunctionsCount()
Returns the number of user defined functions in this report- Returns:
- the number of user defined functions in this report
- Since:
- 10.1
-
getFunction
public com.inet.report.formula.userfunctions.UserFunction getFunction(int index)
Returns the user defined functions at the specified index- Parameters:
index
- the index of the function- Returns:
- the function (never null)
- Throws:
java.lang.ArrayIndexOutOfBoundsException
- in case the index does not exist- Since:
- 10.1
-
getFunction
public com.inet.report.formula.userfunctions.UserFunction getFunction(java.lang.String name)
Returns the user defined function with the specified name- Parameters:
name
- the name of the function- Returns:
- the function of null, if there is no function with this name
- Since:
- 10.1
-
addFunction
public com.inet.report.formula.userfunctions.UserFunction addFunction(java.lang.String name, java.lang.String formula, int syntax)
Adds a user function to the report- Parameters:
name
- the name of the user functionformula
- the function implementation.syntax
- the syntax of the function- Returns:
- the created function instance
- Since:
- 10.1
- See Also:
UserFunction.remove()
,UserFunction.rename(String)
,UserFunction.duplicate(String)
,FormulaField.SYNTAX_BASIC
,FormulaField.SYNTAX_CRYSTAL
-
removeField
public boolean removeField(Field field) throws ReportException
Removes a specific field. This is a convenience function which makes it unnecessary to call the individual remove method depending on the field type. This function will not work for a special/group name Field since these can not be removed.- Parameters:
field
- The Field instance that shall be removed.- Returns:
- true <=> The Field instance could be removed.
- Throws:
ReportException
- The report seems to be invalidated in the mean time.- Since:
- 11.1
-
-