Skip to main content
Skip table of contents

Adding Parameters to the Report

Many reports will require one or more parameters that help the user to filter the results they get back from the report.  

For example, records between a certain date range or a text field in the record that matches a value set by the user when running the report.  The following report illustrates various ways of setting report parameters.


Adding a Date Type Parameter

The following process describes how to apply date filtering to a new or existing report to restrict the data results to a specific point in time (or date range). For example, you may wish to enable the user to select a date or date range in which to display results - when the user selects the report they will be presented with date fields to choose any date values they want to filter the report on.

  1. Open the Customer List report. (A fast way to reopen a report is to click on File → Open Recent File then select the Customer List report)
  2. Add a new parameter to represent the Date value we want to search for. Right-click on Parameters in the Report Inspector window then select Add Parameter, this will create a new parameter named parameter1. We'll use this to set the date from which records are to be selected.


  3. Click the parameter1 at the Report Inspector (left panel),  this will show the properties at the right panel under Properties, set the Name of the parameter as P_DATEFROM, and change the Parameter Class to java.lang.Date. This will ensure the date picker control appears to help the user select their date


  4. We have to update the SQL statement in the report to include this parameter in the WHERE clause that filters the Date field. Right-click on the name of the report and select Edit Query to edit the SQL Query for this report
  5. Write the WHERE sentence WHERE VSCL.CREATEDDATE >= $P{P_DATEFROM}. You can also drag the parameter to the editor.
  6. Now run a Preview to test the new parameter in your report.You should be presented with date picker controls for each of your parameters

  7. Update AppBase importing this new version using the steps in the article Adding Parameters to the Report

Adding a String Parameter

  1. Open the Customer List report. (A fast way to reopen a report is to click on File → Open Recent File then select the Customer List report)
  2. Add a new parameter to represent the Priority value we want to search for. Right-click on Parameters in the Report Inspector window then select Add Parameter, this will create a new parameter named parameter1. We'll use this to set the date from which records are to be selected.

  3. Click the parameter1 at the Report Inspector (left panel),  this will show the properties at the right panel under Properties, set the Name of the parameter as P_PRIORITY, and change the Parameter Class to java.lang.String.
  4. We have to update the SQL statement in the report to include this parameter in the WHERE clause that filters the Priority field. Right-click on the name of the report and select Edit Query to edit the SQL Query for this report.
  5. Add to the WHERE sentence AND UPPER(VSCL.PRIORITY_NAME) LIKE UPPER($P{P_PRIORITY}). You can also drag the parameter to the editor.
  6. Run a Preview.
    (Note that when you preview this report in iReport, it has no awareness of the parameter you have created in your Solution so you will have to directly type in your status value to restrict what records you get back).

  7. Update AppBase importing this new version using the steps in the article Adding Parameters to the Report


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.