public interface JRTextField extends JRTextElement, JREvaluation, JRAnchor, JRHyperlink
isStretchWithOverflow
flag to true for the particular text field elements
you are interested in. By doing this, you'll ensure that if the specified height for the text
field is not sufficient, it will automatically be increased (never decreased) in order to be
able to display the entire text content.
When text fields are affected by this stretch mechanism, the entire report section to
which they belong is also stretched.
<textFieldExpression>
element (see getExpression()
) and can return values from various types, like the ones listed below:
java.lang.Boolean
java.lang.Byte
java.util.Date
java.sql.Timestamp
java.sql.Time
java.lang.Double
java.lang.Float
java.lang.Integer
java.lang.Long
java.lang.Short
java.math.BigDecimal
java.lang.Number
java.lang.String
evaluationTime
attribute
inherited from JREvaluation
)
that lets you decide the exact moment you want the text field expression to be evaluated,
avoiding the default behavior in which the expression is evaluated immediately when the
current report section is generated.
The evaluationTime
attribute can have one of the following values
(see JREvaluation.getEvaluationTimeValue()
):
Now
- The text field expression is evaluated when the current band is filled.Report
- The text field expression is evaluated when the end of the report is reached.Page
- The text field expression is evaluated when the end of the current page is reachedColumn
- The text field expression is evaluated when the end of the current column is reachedGroup
- The text field expression is evaluated when the group specified by the evaluationGroup
attribute (see JREvaluation.getEvaluationGroup()
) changesAuto
- Each variable participating in the text field expression is evaluated at a time corresponding
to its reset type. Fields are evaluated Now
. This evaluation type should be used for expressions
that combine values evaluated at different times, like the percentage out of a totalAuto
when other types suffice, as it can lead to performance loss.
isBlankWhenNull
attribute
(see isBlankWhenNull()
) to true. By doing this, the text field will cease to display null
and will instead display an empty string. This way nothing will appear on your document if the text field value is
null.
pattern
attribute (see getPattern()
) or the
<patternExpression>
element (see getPatternExpression()
).
The engine instantiates the java.text.DecimalFormat
class if the text field
expression returns subclasses of the java.lang.Number
class, or instantiates the
java.text.SimpleDataFormat
if the text field expression returns java.util.Date
,
java.sql.Timestamp
or java.sql.Time
objects.
For numeric fields, the value you should supply to this attribute is the same as if you
formatted the value using java.text.DecimalFormat
.
For date/time fields, the value of this attribute has to be one of the following:
Short
, Medium
, Long
, Full
, Default
(corresponding to
java.text.DateFormat
styles), or Hide
. The formatter is constructed by calling
one of the getDateTimeInstance()
, getDateInstance()
, or
getTimeInstance()
methods of java.text.DateFormat
(depending on one of
the date/time parts being hidden) and supplying the date/time styles and report
locale.java.text.SimpleDateFormat
. Note that in
this case the internationalization support is limited.java.text.DecimalFormat
and
java.text.SimpleDateFormat
classes.JREvaluation
Modifier and Type | Field and Description |
---|---|
static String |
FORMAT_TIMEZONE_SYSTEM |
static String |
PROPERTY_FORMAT_TIMEZONE |
static String |
PROPERTY_PATTERN_DATE
Provides a default pattern to be used for
java.sql.Date values. |
static String |
PROPERTY_PATTERN_DATETIME
Provides a default pattern to be used for
java.util.Date values other than
java.sql.Date and java.sql.Time . |
static String |
PROPERTY_PATTERN_INTEGER
Provides a default pattern to be used for numerical values that are known to be integer,
i.e.
|
static String |
PROPERTY_PATTERN_NUMBER
Provides a default pattern to be used for numerical values other than the integer types.
|
static String |
PROPERTY_PATTERN_TIME
Provides a default pattern to be used for
java.sql.Time values. |
static String |
PROPERTY_SQL_DATE_FORMAT_TIMEZONE |
static String |
PROPERTY_SQL_TIME_FORMAT_TIMEZONE |
static String |
PROPERTY_SQL_TIMESTAMP_FORMAT_TIMEZONE |
PROPERTY_PRINT_KEEP_FULL_TEXT, PROPERTY_SAVE_LINE_BREAKS, PROPERTY_TRUNCATE_AT_CHAR, PROPERTY_TRUNCATE_SUFFIX
DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_PDF_EMBEDDED, DEFAULT_PDF_ENCODING, DEFAULT_PDF_FONT_NAME
MARKUP_HTML, MARKUP_NONE, MARKUP_RTF, MARKUP_STYLED_TEXT
NO_BOOKMARK
Modifier and Type | Method and Description |
---|---|
JRExpression |
getExpression()
Gets the expression for this field.
|
String |
getOwnPattern() |
String |
getPattern()
Gets the pattern used for this text field.
|
JRExpression |
getPatternExpression()
Gets the pattern expression, in case the patter needs to be dynamic.
|
boolean |
isBlankWhenNull()
Indicates whether an empty string will be displayed if the field's expression evaluates to
null . |
Boolean |
isOwnBlankWhenNull() |
boolean |
isStretchWithOverflow()
Specifies whether the text field will stretch vertically if its text does not fit in one line.
|
void |
setBlankWhenNull(boolean isBlank)
Specifies whether an empty string sholuld be displayed if the field's expression evaluates to
null . |
void |
setBlankWhenNull(Boolean isBlank) |
void |
setPattern(String pattern)
Sets the pattern used for this text field.
|
void |
setStretchWithOverflow(boolean isStretchWithOverflow)
Set to true if the text field should stretch vertically if its text does not fit in one line.
|
clone, collectExpressions, getElementGroup, getKey, getPositionTypeValue, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertyExpressions, getStretchTypeValue, getX, getY, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setWidth, setX
visit
clone
getParentProperties, getPropertiesMap, hasProperties
getUUID
getHorizontalAlignmentValue, getOwnHorizontalAlignmentValue, getOwnVerticalAlignmentValue, getVerticalAlignmentValue, setHorizontalAlignment, setVerticalAlignment
getHorizontalTextAlign, getOwnHorizontalTextAlign, getOwnVerticalTextAlign, getVerticalTextAlign, setHorizontalTextAlign, setVerticalTextAlign
getFontName, getFontsize, getFontSize, getOwnFontName, getOwnFontsize, getOwnFontSize, getOwnPdfEncoding, getOwnPdfFontName, getPdfEncoding, getPdfFontName, isBold, isItalic, isOwnBold, isOwnItalic, isOwnPdfEmbedded, isOwnStrikeThrough, isOwnUnderline, isPdfEmbedded, isStrikeThrough, isUnderline, setBold, setBold, setFontName, setFontSize, setFontSize, setFontSize, setItalic, setItalic, setPdfEmbedded, setPdfEmbedded, setPdfEncoding, setPdfFontName, setStrikeThrough, setStrikeThrough, setUnderline, setUnderline
getFontsize, getFontSize, getLineSpacingValue, getMarkup, getOwnLineSpacingValue, getOwnMarkup, getOwnRotationValue, getRotationValue, setLineSpacing, setMarkup, setRotation
getBackcolor, getForecolor, getHeight, getModeValue, getOwnBackcolor, getOwnForecolor, getOwnModeValue, getWidth, setBackcolor, setForecolor, setMode
getDefaultLineColor, getLineBox
getParagraph
getDefaultStyleProvider, getStyle, getStyleNameReference
getEvaluationGroup, getEvaluationTimeValue
getAnchorNameExpression, getBookmarkLevel
getHyperlinkAnchorExpression, getHyperlinkPageExpression, getHyperlinkParameters, getHyperlinkReferenceExpression, getHyperlinkTarget, getHyperlinkTooltipExpression, getHyperlinkTypeValue, getHyperlinkWhenExpression, getLinkTarget, getLinkType
static final String PROPERTY_FORMAT_TIMEZONE
static final String PROPERTY_SQL_DATE_FORMAT_TIMEZONE
static final String PROPERTY_SQL_TIMESTAMP_FORMAT_TIMEZONE
static final String PROPERTY_SQL_TIME_FORMAT_TIMEZONE
static final String FORMAT_TIMEZONE_SYSTEM
static final String PROPERTY_PATTERN_DATE
java.sql.Date
values.
Locale specific values can be configured by appending _<locale code> to the property name.
The property can be set at global/JasperReports context level.
static final String PROPERTY_PATTERN_TIME
java.sql.Time
values.
Locale specific values can be configured by appending _<locale code> to the property name.
The property can be set at global/JasperReports context level.
static final String PROPERTY_PATTERN_DATETIME
java.util.Date
values other than
java.sql.Date
and java.sql.Time
.
Locale specific values can be configured by appending _<locale code> to the property name.
The property can be set at global/JasperReports context level.
static final String PROPERTY_PATTERN_INTEGER
java.math.BigInteger
.
Locale specific values can be configured by appending _<locale code> to the property name.
The property can be set at global/JasperReports context level.
static final String PROPERTY_PATTERN_NUMBER
Locale specific values can be configured by appending _<locale code> to the property name.
The property can be set at global/JasperReports context level.
boolean isStretchWithOverflow()
void setStretchWithOverflow(boolean isStretchWithOverflow)
String getPattern()
String getOwnPattern()
void setPattern(String pattern)
boolean isBlankWhenNull()
null
.Boolean isOwnBlankWhenNull()
void setBlankWhenNull(boolean isBlank)
null
.isBlank
- true if an empty string will be displayed instead of null values, false otherwisevoid setBlankWhenNull(Boolean isBlank)
JRExpression getExpression()
JRExpression getPatternExpression()
getPattern()
Copyright © 2017. All rights reserved.