public interface JRField extends JRPropertiesHolder, JRCloneable
JRResultSetDataSource
implementation is used along with
the report's SQL query, make sure that there is a column for each field in the
result set obtained after the execution of the query. The corresponding column must bear
the same name and have the same data type as the field that maps it.
If a field is declared without a corresponding column in the result set, an exception will
be thrown at runtime. The columns in the result set produced by the execution of the
SQL query that do not have corresponding fields in the report template will not affect the
report-filling operations, but they also won't be accessible for display on the report.
Following are described the components of a report field definition.
name
attribute of the <field>
element is mandatory. It
lets you reference the field in report expressions by name.
java.lang.String
, but it can be changed to any class available at
runtime. Regardless of the type of a report field, the engine makes the appropriate cast in
report expressions in which the $F{}
token is used, making manual casts unnecessary.
<fieldDesciption>
element instead of the field name, you can
easily overcome restrictions of field-naming conventions when retrieving the field values
from the data source:
<field name="PersonName" class="java.lang.String" <fieldDesciption>PERSON NAME</fieldDesciption> </field>The field description is less important than in previous versions of the library because now even the field's name accepts dots, spaces, and other special characters.
Modifier and Type | Method and Description |
---|---|
String |
getDescription()
Gets the field optional description.
|
String |
getName()
Gets the field unique name.
|
JRPropertyExpression[] |
getPropertyExpressions()
Returns the list of dynamic/expression-based properties for this field.
|
Class<?> |
getValueClass()
Gets the field value class.
|
String |
getValueClassName()
Gets the field value class name.
|
void |
setDescription(String description)
Sets the field description.
|
getParentProperties, getPropertiesMap, hasProperties
clone
String getName()
String getDescription()
void setDescription(String description)
Class<?> getValueClass()
String getValueClassName()
JRPropertyExpression[] getPropertyExpressions()
Copyright © 2023 Cloud Software Group, Inc.. All rights reserved.