How to pass parameter value in the field value ?



i want to do this $F{$P{subject}}.

i create general structure for .jrxml file. i pass query dynamically to the query tag like this,

    <queryString language="SQL">

So here Field is dyanamically changes. field can be fill by parameter ?

jani99harsh's picture
Joined: Mar 3 2017 - 1:12am
Last seen: 3 years 10 months ago

1 Answer:


Since JR 6.3.1 you could use the property for each field, to map the column name dinamically. Meaning you could use a static field name in JRXML that will map a column name in your dynamic query. For instance:


 <parameter name="paramId" class="java.lang.String">
 <field name="id" class="java.lang.Integer">
   <propertyExpression name=""><![CDATA[$P{paramId}]]></propertyExpression>

In the above example, whenever you will use the $F{id} expression in the JRXML file, the "emp_id" column in the sql query will be referenced, via the parameter paramId.

shertage's picture
Joined: Sep 26 2006 - 8:06pm
Last seen: 2 months 4 weeks ago