public class DatabaseField extends Field
DatabaseField
holds the information needed to use a field from a database table.TableSource.addColumn(String, int)
in class TableSource
or with method setName(String)
.
The short name is an alias for the full name, i.e. Phonenumber.DatabaseField
is handled by class TableSource
.
You can use the following methods to add a database field to an existing report:engine.getDatabaseTables().getDataSource(string).getTableSource(int or string).addColumn(String, int)
.DatabaseField
is handled by class Fields
.
You can use the following method to get a database field of an existing report:engine.getFields().getDatabaseField(int or string)
.FieldElement
or FieldPart
.BINARY, BOOLEAN, CURRENCY, CURSOR, DATABASE_FIELD, DATE, DATETIME, FORMULA_FIELD, GROUP_NAME_FIELD, NUMBER, PARAMETER_FIELD, SORT_FIELD, SPECIAL_FIELD, SQL_FIELD, STRING, SUMMARY_FIELD, TIME, UNKNOWN
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getColumnLabel()
Returns the label of this
DatabaseField . |
java.lang.String |
getShortName()
Returns the short name of a database field.
|
TableSource |
getTableSource()
Returns the table source this database field is based on, will never return
null . |
boolean |
hasColumnLabel()
Returns whether a column label was set or not.
|
void |
setColumnLabel(java.lang.String columnLabel)
Specifies an alias for table columns.
|
void |
setName(java.lang.String fullname)
Specifies the name of the
DatabaseField . |
checkNameExists, duplicate, extractReference, getField, getGroup, getName, getPlaceholderName, getRefName, getType, getValueType, indexOf, paramString, setField, setGroup, setValueType, trimAwayBrackets
isDOMParser, parseDOM, parseElement, parseEndElement, parseText
public void setName(java.lang.String fullname) throws ReportException
DatabaseField
.setName
in class Field
fullname
- The qualified column name for this database field.ReportException
- If the alias or table name was missing.java.lang.IllegalArgumentException
- If the database field name was emptypublic void setColumnLabel(java.lang.String columnLabel)
columnLabel
- Label of the database fieldgetColumnLabel()
,
hasColumnLabel()
public java.lang.String getColumnLabel()
DatabaseField
. The label is an additional information only.
It can be used to explain abstract column names. This label will be used from i-net Designer for example.getColumnLabel()
,
hasColumnLabel()
public boolean hasColumnLabel()
true
if a column label was set, false
otherwise.setColumnLabel(String)
,
getColumnLabel()
public java.lang.String getShortName()
public TableSource getTableSource()
null
.null
Copyright © 1999-2020 by i-net software GmbH