Changes

Modify an iReport Template

2,326 bytes added, 15:39, 17 September 2013
Report Query Filtering
==Report Query Filtering==
iReport Designer provides an option for limiting or filtering the results of the query that returns data to the report. While in most cases this Report Query filter is ignored by {{IMSMANG}} once the report as been imported in favor of the search criteria, there are some cases where it is important to edit the Report Query filters in iReport. The two main reasons are:* '''temporarily''': to limit the results returned when previewing the report during the design phase in iReport* '''permanently''': for use in Subreports to restrict the data returned to those that have a relationship with the main report. For example to only return Activities that are associated with the Land in the main report. Both approaches use the same steps. ===Filtering resultsUsing Report Query filters===To use Report Query filters, #Open the Report Query window from iReport Designer#:[[Image:IReport ReportQueryButton.png|center|200px|''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 Limitationsettings and return to the report. ===ImsmaQuery Language Syntax===The ImsmaQuery Language syntax is a language designed to limit or filter datasets in iReports. It is similar to the WHERE clause syntax in SQL though not identical. ImsmaQuery language generally uses the following format: ''field'' OPERATOR "''value''"as in localId ="MF-HQ-1" #To start using ImsmaQuery Language, first decide which field you want to include 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")
==the SQL Field==
319
edits