Jump to content

How to build jasper parameterized queries which are not-required fields


kiran_3

Recommended Posts

I am new to jasper reports , I want to build a report which takes few fields among them few are required and few not required fields. I ran a sample report in jasper studio which has single parameter . how can I mention such non required parameters in the query . Required parameter can be mentioned as below.

select * from member where first_name=$P{param_name};

 

is there anyway to put non-required field in that query, say when i run the report it asks me to enter that parameter rite , if i didn't give param value it doesn't execute the report. in my case if i give parameter take it show based on it else show me all records. can i do it using any if else condition?

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

OK. How is your parameter set up? I set mine up when using this function as a 'Multiple Select query' this function lets you select more than one option or none at all so I set it up to do that, this does require you to provide the SQL for the select list options. The parameter will still prompt if you have it set to prompt, you just won't have to select anything from the list.

 

I'm sorry, I don't have much success changing the XML and it working so I hope my above suggestions help.

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...