Today, I have to make custom header for my report, this custom parameter is variable that stored in Map (which is named “year”) from my java code. Now what I have to do is passing this (year) Main Report parameter trough the Table’s datasource. By the way, I currently using iReport 3.7.4. Back to the topic, this is how to do it :

  1. Expand Table Dataset 1, create parameter in Parameters, in my case I name it currentYear.
  2. Right Click on your table, choose Edit table data source then select Parameters tab.
  3. Click Add button, it will show you Add/modify parameter dialog.
  4. Click on Dataset parameter name combo box and select your parameter (mine is currentYear).
  5. Edit it Value expression to $P{year}.
  6. Click OK until all dialog closed.

Now you are done. The rest you have to do is passed parameter. Don’t forget to compile😉 .