FreeReportv0.9.0한국어

Expressions and functions

The safe expression language: fields, arithmetic, conditions, sum, count, avg, page subtotals, running totals, date and string functions.

Fields, visibility rules, filters and text templates use a small, safe expression language: arithmetic, comparisons, && || ! ?? and ?:, member access (customer.name, items[0]) and the functions below. It has no access to globals and cannot assign. In text, write expressions in braces with an optional format after a colon: "{sum(amount):#,##0}원".

price * qty                         arithmetic
amount >= params.minAmount           comparison with a parameter
customer.name ?? '(미지정)'           member access and fallback
qty > 10 ? '대량' : '일반'             condition
sum(amount)                          aggregate over the band's scope
sum(amount, 'page')                  page subtotal
sum(amount) / sum(amount, 'report')  share of the grand total
format(date, 'yyyy년 M월 d일 (ddd)')  2026년 10월 15일 (목)
koreanAmount(1230000)                일금 일백이십삼만원정
bizNo('7928703276')                  792-87-03276
{page} / {pages}                     page x / y in a text template

Variables

NameTypeDescription
page, pagesnumberPage number and page count (per group with resetPageNumber).
rowNumnumberRow number within the group (or report).
rowIndexnumberRow number within the report.
groupKey, groupLevelunknown, numberCurrent group value and depth.
nowDateTime the report was laid out.
paramsobjectParameter values: params.from.
row, rows, allRows, dataobject, arrayCurrent row, rows in scope, all rows, the whole data object.

Aggregates and scopes

The scope is the second argument: 'group' (the current group), 'page' (rows on the current page — page subtotals) or 'report' (every row). Without it, aggregates use the band's natural scope: the group in group bands, the page in page bands, the whole report elsewhere.

NameTypeDescription
sum(expr, scope?)numberSum over the scope.
avg / min / max(expr, scope?)numberAverage, minimum, maximum.
count(expr?, scope?)numberRows (or non-empty values).
distinct(expr, scope?)numberNumber of different values.
first / last(expr, scope?)unknownValue of the first / last row.
runningSum(expr, scope?)numberSum up to and including the current row (default scope report).

Functions

NameTypeDescription
format(v, f)stringFormat a number or date: format(date, "yyyy-MM-dd").
koreanAmount(n) / korean(n)string1230000 → 일금 일백이십삼만원정.
bizNo(v), phone(v)string1234567890 → 123-45-67890; 0212345678 → 02-1234-5678.
round / floor / ceil(v, digits?)numberRounding to digits after the point.
abs, number, string—Conversions.
upper, lower, trim, len, left, right, substr, replace, concat, padStart, joinstringText functions.
iif(c, a, b), coalesce(...), isEmpty(v)—Conditions and fallbacks (?: and ?? work too).
date, today, now, year, month, day, addDays, dateDiff, ymd—Dates.
groupSum(rows, key, value), groupCount(rows, key)arrayTotals per key, handy as a chart source.
min2(a, b), max2(a, b)numberSmaller / larger of two values.