Jump to: navigation, search

Modify an iReport Template

2 bytes removed, 20:11, 6 March 2014
Version 6.0
====For numeric variables====__NOEDITSECTION__
For variables that are numeric (area sizes, number of devices, etc):
# From the '''Report Inspector''', Select select the field that you wish to sum or count.# Drag the field to the Summary Band of the iReport Template canvas.
# A dialogue will pop up, select '''The result of an aggregation function''' and choose the calculation type you want to perform.
#: [[Image:IReport VariableAdd1.png|center|300px|''Select aggregation function'']]<div align="center">''Choose the type of calculation''</div>
# Choose '''OK'''.
# The variable will now appear in the '''Report Inspector''' and can be used in the iReport.
#: [[Image:IReport VariableAdd2.png|center|300px|''Select aggregation function'']]<div align="center">''Choose the type of calculation''</div>
# In the '''Properties''' pane,
#: [[Image:IReport VariableAdd4.png|center|300px|''Variable Properties Pane'']]<div align="center">''Variable Properties Pane''</div>
## Enter a Variable name (e.g. SumAreaSize} .
## Select the variable class (i.e. the type of variable to be created. Normally this is the same as the type of the field to be used).
## Choose the '''Calculation''' type, normally '''Sum''' or '''Count'''.
## Enter a '''Variable Expression'''. Normally this is simply selecting the field to be summed or counted (e.g. '''$F{areaSize}'''). Click the [[Image:Editor Button.png]] on the Variable Expression line to open the Variable Expression editor.
#: [[Image:IReport VariableAdd5.png|center|300px|''Edit Variable Expression'']]<div align="center">''Edit Variable Expression''</div>
# Choose OK.
# Drag the variable to iReport template as desired.
To use Report Query filters,
#Open the Report Query window from iReport Designer.
#:[[Image:IReport ReportQueryButton.png|center|500px|''iReport Report Query Button'']]<div align="center">''Open Report Query''</div>
# Choose '''ImsmaQuery''' from the '''Query language''' drop down.
#:[[Image:IReport ReportQuery.png |center|400px|''iReport Report Query Window'']]<div align="center">''Report Query Window''</div>
# Enter a valid [[#ImsmaQuery Language Syntax|ImsmaQuery Language]] filter in the textbox (e.g. localId="MF-HQ-1").
# Choose the '''Preview Data''' button to verify that the query is limited as desired.
# Choose '''OK''' to save the Report Query settings and return to the report.
localId = "MF-HQ-1"
#To start using ImsmaQuery Language, first decide which field you want to include in your filter. You may choose any field that is available on the data source to begin your filtering. As in most places in iReport fields are case sensitive. Therefore '''''localId''''' will work but '''''LocalId''''', '''''LocalID''''' and '''''localid''''' will all fail to filter the data.}}
#Next choose your operator. Valid operators include "=", "<", ">", "<>", and "LIKE" among others.
#Finally, select the value you want to use. Values in ImsmaQuery are always double quoted (e.g. "MF-HQ-1" or "MF-HQ-%"). In addition to constants in the value section, the LIKE operator can take % characters to represent wild cards. For example:
====SQL Field Examples====__NOEDITSECTION__
The SQL statement can be any valid SQL statement that returns a result. This field can be used to retrieve data that is otherwise in difficult to access areas of the database. You can use any valid PostgreSQL statement in the SQL field including
* VIEWS, JOINS, HAVING, sub-selects, and sub-queries
* PostrgreSQL functions such as COALESCE()

Navigation menu