Functions Jaspersoft
Functions Jaspersoft
Date & Time - Category for date and time manipulation functions
DATE Creates a date object using the specified information on java.util.Date Year The year of the new date java.lang.Integer Y
day, month and year.
Month The month of the new date java.lang.Integer Y
DATEFORMAT Format the specified date object using the chosen format java.lang.String Selected date The date to format java.util.Date Y
pattern.
Format pattern Format pattern to apply when printing the date java.lang.String Y
DATERANGE Allows to create a JasperReports DateRange instance net.sf.jasperreports.types.d Date range details The date range information java.lang.Object Y
starting from either a String expression or a Date instance. ate.DateRange
DATEVALUE Gives the corresponding numeric value (long milliseconds) java.lang.Long Date object The object representing the date java.lang.Object Y
for a specified date object.
DAY Returns the day of a given date. Date object can be a java.lang.Integer Selected date The object representing the date java.lang.Object Y
String, long value (milliseconds) or Date instance itself.
DAYS Returns the number of days between two dates. java.lang.Integer Start date The initial date java.lang.Object Y
DAYSINMONTH Returns the number of days in a month. java.lang.Integer Selected date The date to check java.lang.Object Y
DAYSINYEAR Returns the number of days in a year. java.lang.Integer Selected date The date to check java.lang.Object Y
EDATE Returns a date a number of months away. java.util.Date Selected date The object representing the date java.lang.Object Y
HOUR Returns the hour (0-23) of the day for a given date. Date java.lang.Integer Selected date The object representing the date java.lang.Object Y
object can be a String, long value (milliseconds) or Date
instance itself.
ISLEAPYEAR Checks if the given date occurs in a leap year. java.lang.Boolean Selected date The date to check java.lang.Object Y
MINUTE Returns the minute (0-59) of the hour for a given date. java.lang.Integer Selected date The object representing the date java.lang.Object Y
Date object can be a String, long value (milliseconds) or
Date instance itself.
MONTH Returns the month of a given date. Date object can be a java.lang.Integer Selected date The object representing the date java.lang.Object Y
String, long value (milliseconds) or Date instance itself.
Page 1 of 9
Date & Time - Category for date and time manipulation functions
MONTHS Returns the number of months between two dates. java.lang.Integer Start date The initial date java.lang.Object Y
NETWORKDAYS Returns the number of working days between two dates java.lang.Integer Start date The initial date java.lang.Object Y
(inclusive). Saturday and Sunday are not considered
working days. End date The end date java.lang.Object Y
SECOND Returns the second (0-59) of the minute for a given date. java.lang.Integer Selected date The object representing the date java.lang.Object Y
Date object can be a String, long value (milliseconds) or
Date instance itself.
TIME Returns a text string representing a time value (hours, java.lang.String Hours The hours for the new time value java.lang.Integer Y
seconds and minutes). If no specific pattern is provided a
default formatter is used. Minutes The minutes for the new time value java.lang.Integer Y
WEEKDAY Returns the day of the week for a given date. Date object java.lang.Integer Selected date The object representing the date java.lang.Object Y
can be a String, long value (milliseconds) or Date instance
itself. Sunday is first day Boolean flag to decide if Sunday should be considered java.lang.Boolean
as first day. Default is not
WEEKNUM Returns the week number of a given date. java.lang.Integer Selected date The date to check java.lang.Object Y
WEEKS Returns the number of weeks between two dates. java.lang.Integer Start date The initial date java.lang.Object Y
WEEKSINYEAR Returns the number of weeks in a year. java.lang.Integer Selected date The date to check java.lang.Object Y
WORKDAY Returns a date a number of workdays away. Saturday and java.util.Date Selected date The object representing the date java.lang.Object Y
Sundays are not considered working days.
Working days The number of days after the given date java.lang.Integer Y
YEAR Returns the year of a given date. Date object can be a java.lang.Integer Selected date The object representing the date java.lang.Object Y
String, long value (milliseconds) or Date instance itself.
YEARS Returns the number of years between two dates. java.lang.Integer Start date The initial date java.lang.Object Y
Page 2 of 9
Logical - Category for logical operations functions
AND Returns true if all arguments are considered true, false java.lang.Boolean Argument A boolean expression or value [Ljava.lang.Boolean; Y
otherwise.
EQUALS Checks if the two specified objects are equal. java.lang.Boolean Object 1 The first element to be compared java.lang.Object Y
IF Returns one of two values, depending on a test condition. java.lang.Object Test condition An expression returning a boolean value java.lang.Boolean Y
Value 1 (true) The value returned when the test is true java.lang.Object Y
Value 2 (false) The value returned when the test is false java.lang.Object Y
NOT Returns the negation of the specified boolean expression. java.lang.Boolean Argument A boolean expression or value java.lang.Boolean Y
OR Returns true if any of the arguments is considered true, java.lang.Boolean Argument A boolean expression or value [Ljava.lang.Boolean; Y
false otherwise.
TRUE Returns the logical value TRUE. java.lang.Boolean
Page 3 of 9
Numeric / Mathematical - Category for mathematical operations functions
ABS Returns the absolute value of a number. java.lang.Number Number The number to check java.lang.Number Y
CEIL Returns the smallest value that is greater than or equal to java.lang.Double Number Value java.lang.Number Y
the argument and is equal to a mathematical integer.
FACT Returns the factorial of a number. java.lang.Long Integer number The argument java.lang.Integer Y
FLOOR Returns the largest value that is less than or equal to the java.lang.Double Number Value java.lang.Number Y
argument and is equal to a mathematical integer.
ISEVEN Checks if a number is even. If a non-integer number is java.lang.Boolean Number The number to check java.lang.Number Y
specified, any digits after the decimal point are ignored.
ISODD Checks if a number is odd. If a non-integer number is java.lang.Boolean Number The number to check java.lang.Number Y
specified, any digits after the decimal point are ignored.
MAX Returns the maximum of a list of numeric values. java.lang.Number Number Number to compare [Ljava.lang.Number; Y
MIN Returns the minimum of a list of numeric values. java.lang.Number Number Number to compare [Ljava.lang.Number; Y
PRODUCT Returns the product of a list of numbers. java.lang.Number Number Argument [Ljava.lang.Number; Y
RANDBETWEEN Returns an Integer random number between bottom and java.lang.Integer Bottom range Integer number for the bottom range java.lang.Integer Y
top range (both inclusive).
Top range Integer number for the top range java.lang.Integer Y
SIGN Returns the sign of a number. java.lang.Integer Number The number to check java.lang.Number Y
SQRT Returns the positive square root of a number. The number java.lang.Number Positive number Argument java.lang.Number Y
must be positive.
SUM Returns the sum of a list of numbers. java.lang.Number Number Addendum [Ljava.lang.Number; Y
Page 4 of 9
Text - Category for text/string manipulation functions
BASE Returns a text representation of a number, in a specified java.lang.String Number The positive integer number to convert java.lang.Integer Y
base radix.
Radix The base radix, an integer between 2 and 36 java.lang.Integer Y
CHAR Returns a single text character, given a character code. java.lang.String Char code The character code, in the range 1-255 java.lang.Integer Y
CLEAN Returns a new text string without non-printable characters. java.lang.String Text The text to be cleaned java.lang.String Y
CODE Returns the numeric code (0-255) for the first character in java.lang.Integer Text The string containing the character to convert java.lang.String Y
a string.
CONCATENATE Combines a list of strings into a single one. java.lang.String Text Argument [Ljava.lang.String; Y
DOUBLE_VALUE Returns a Double number representing the given text java.lang.Double Number (as text) The input text string representing a number java.lang.String Y
string.
EXACT Returns TRUE if the two text specified are exactly the java.lang.Boolean Text 1 The first text to compare java.lang.String Y
same (case sensitive compare).
Text 2 The second text to compare java.lang.String Y
FIND Returns the character position of a string inside another java.lang.Integer Find text The text to look into java.lang.String Y
text. If the text is not found then -1 is returned.
Text to search The text string to search java.lang.String Y
Start position The position from which the search should start java.lang.Integer
FIXED Returns the text representing number with the specified java.lang.String Number The number to print out java.lang.Number Y
decimal places.
Decimals The number of decimal places java.lang.Integer Y
Omit separators The flag to specify if the thousands separators should java.lang.Boolean
be included or not
FLOAT_VALUE Returns a Float number representing the given text string. java.lang.Float Number (as text) The input text string representing a number java.lang.String Y
INTEGER_VALUE Returns an Integer number representing the given text java.lang.Integer Number (as text) The input text string representing a number java.lang.String Y
string.
LEFT Returns the specified number of characters (1 by default) java.lang.String Text The input text java.lang.String Y
from the left side of the input text.
Characters num The number of characters. Default (not specified) is 1 java.lang.Integer
LEN Returns the length of the specified text string. java.lang.Integer Text The input text string java.lang.String Y
LONG_VALUE Returns a Long number representing the given text string. java.lang.Long Number (as text) The input text string representing a number java.lang.String Y
Page 5 of 9
Text - Category for text/string manipulation functions
LOWER Performs the lower case conversion of the specified text java.lang.String Text The input text string java.lang.String Y
string.
LTRIM Clear a string, removing leading whitespaces. java.lang.String Text The text string to be trimmed java.lang.String Y
MID Returns the text from the middle of a text string. java.lang.String Text The input text java.lang.String Y
PROPER Capitalizes each words of the specified text. The remaining java.lang.String Text The input text java.lang.String Y
parts of words are in lowercase.
REPLACE Replaces parts of a text string with a different one. Starting java.lang.String Original Text The input text to modify java.lang.String Y
from a specified position, removes a certain number of
characters and then insert the new text. Start position The number of characters. Default (not specified) is 1 java.lang.Integer Y
New Text The text that will replace the old one java.lang.String Y
REPT Replicates an input text string for a specified number of java.lang.String Original Text The input text to replicate java.lang.String Y
times.
Number of copies The needed number of copies java.lang.Integer Y
RIGHT Returns the specified number of characters (1 by default) java.lang.String Text The input text java.lang.String Y
from the right side of the input text.
Characters num The number of characters. Default (not specified) is 1 java.lang.Integer
RTRIM Clear a string, removing trailing whitespaces. java.lang.String Text The text string to be trimmed java.lang.String Y
SEARCH Returns the position of a string of text in another string. java.lang.Integer Find Text The text to find java.lang.String Y
Search is not case-sensitive.
Text to search The text to look into java.lang.String Y
SUBSTITUTE Substitutes new text for old text in a text string. When no java.lang.String Original Text The text to be modified java.lang.String Y
occurrence is specified all occurrences are replaced.
Old Text The old text to be replaced java.lang.String Y
New Text The new text that will replace the old one java.lang.String Y
T Returns the text string if the value is a string, otherwise an java.lang.String Generic value The object value to be tested java.lang.Object Y
empty string is returned.
Page 6 of 9
Text - Category for text/string manipulation functions
TEXT Converts a number into a text string according to a java.lang.String Number The number to be formatted java.lang.Number Y
specified format.
Format The format pattern java.lang.String Y
TRIM Clear a string,removing leading and trailing whitespaces. java.lang.String Text The text string to be trimmed java.lang.String Y
UPPER Performs the upper case conversion of the specified text java.lang.String Text The input text string java.lang.String Y
string.
Functions Examples
Page 7 of 9
Date & Time Functions Expression Result
Current date DATEFORMAT(NOW(), "EEEE, MMM d, yyyy") luni, Mai 25, 2015
Five years ago DATEFORMAT(EDATE(TODAY(), -60), "MMMM d, yyyy") mai 25, 2010
Concatenate "Hello", " ", "World" CONCATENATE("Hello", " ", "World") Hello World
Case sensitive search for "ll' in "Hello" "Found on position " + (FIND("Hello", "ll") + 1) Found on position 3
Case insensitive search for "LL" in "all" "Found on position " + (SEARCH("LL", "all") + 1) Found on position 2
Replicates "Hello " three times REPT("Hello ", 3) Hello Hello Hello
Substitute "o" by "0" in "Hello World" SUBSTITUTE("Hello World", "o", "0") Hell0 W0rld
Page 8 of 9
Logical Functions Expression Result
Page 9 of 9