Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Eclipse BIRT Report Developer Guide
Previous Page Home Next Page

Previous Next

Writing Expressions

You can create many reports using data that comes directly from a data source simply by dragging the data set fields from Data Explorer to the report. Sometimes, however, you want to display information that is not in the data source, or you want to display data differently than it appears in the data source. You might also want to sort data using a formula, rather than sorting on an existing field. For these cases, and many others, you write expressions using JavaScript.

An expression is a statement that produces a value. An expression can be a literal value, such as:

When you drag a field into the report, BIRT Report Designer creates a column binding with the correct expression for you. The expression specifies the name of the field whose values the report displays. For example, the following expressions get values from the customerName field and the phone field, respectively:

An expression can contain any combination of literal values, fields, operators, variables, and functions, as long as it evaluates to a single value. In the following examples, the first expression combines static text with a field, the second expression uses a JavaScript function, and the third expression multiplies the values of two fields:


(c) Copyright Actuate Corporation 2009

  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire