Jump to content
We've recently updated our Privacy Statement, available here ×

How to use optional parameters?


Recommended Posts

Hi All,

We have a requirement on optional parameter. I have written the below query for that.

 

Select * from tablename

where clause

$P!{}

 

We are not able to preview the report in Jasper Studio(6.2) and as well as in server.

Can someone help me on this means how to add the optional parameter in studio and how to add i/p control in server.

 

 

Thanks,

Saikiran

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Lets suppose I have the following query,

Select L_name, 
age_1,
$P!{check} as Characteristic
from table


This Query allows me to view the various characteristics of the person I am refering above. It would be dependent on another parameter, let us call that parameter as $P{value}. 

In the default expression of the parameter "check", I could define the following;

$P{value}==1 ? "Physical_strength" : $P{value}==2 ? "IQ": "Nature";

Depending on the various values of $P{value}, the parameter "check" will input the values into the query and mind you, the above three stated characteristics are nothing but the table columns, so basically we are displaying different columns based on the parameter "value".

For instance, the parameter "value" was entered as 2, so my running query would look like (which you can check in the logs);

 

select L_name, age_1, IQ as characteristics from table


Thank you
KKriplani

Link to comment
Share on other sites

Here is a quick tutorial on how to use report parameters in Jaspersoft Studio: http://community.jaspersoft.com/wiki/using-report-parameters-jaspersoft-studio

You could also check out the official guide for more detailed information: http://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v621/using-parameters

When deploying your reports in Server, it will automatically create and map the input controls to your report parameters. If you need to edit an existing input control or add a new one you could use this: http://community.jaspersoft.com/documentation/jasperreports-server-user-guide/adding-input-controls

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...