Use fields as default value expression for parameters

I recently migrated from using iReport on Windows to using Jaspersoft Studio 6.6.0. After finding my way around most of the changes, I got all my reports working, except for one thing. In iReport, I used to create a parameter, then under its properties, I would set the default expression value to be a field. That way when the query runs, it will assign this value to the parameter, and this value would be passed to subreports. In Jaspersoft Studio, that option is not available.  (am unable to append a screenshot to illustrate this). The only options available on the left panel when I click th icon to set default expression value are:

  1. Parameter
  2. Resources
  3. Built in Functions
  4. User defined expressions
  5. Recent expressions

Even variables are not shown in the options.

How to I get the fields option back?


ncubed940's picture
Joined: Dec 13 2018 - 11:03pm
Last seen: 4 years 5 months ago

@reportdev I don't think its an issue with the perspective.
Kindly refer to this  Stackoverflow question that includes images.

ncubed940 - 4 years 5 months ago

I see what you have mentioned. Jasper reports does not allow that feature. (ireports would have had that feature). 

Since the parameters control the datasource, I dont think you would be able to fetch a value from the datasource to fill a parameter in Jasper. 

The workaround would be to create a subreport/table element and then fill the Field value from the main datasource. 

reportdev - 4 years 5 months ago

1 Answer:

If the view is different in Jasper Studio, you can reset the perspective and it should reset the entire View to defaults.

reportdev's picture
Joined: Oct 12 2015 - 12:05pm
Last seen: 11 months 3 weeks ago