Monday, October 24, 2011

Pass parameters from main report to table's data source in iReport

Following steps help to pass parameters from main report to table data source in iReport (3.6.7 or 4.1.2)
  1. Create required parameters in the main report
    • right clicking on the parameters section of main report
    • add parameter
    • set the properties (data type)
    • set default expression (optional)
  1. Create parameters within the sub data source
    • Set name , data type as same as main report parameters
  1. Map the parameters in main report and data set
    • Right click on the table and click on Edit Table Dataset
    • Select the parameters
    • Click on add
    • Choose the parameter (created in dataset) from upper combo
    • Assign value expression (parameter which added in step 1)