Jump to content
Changes to the Jaspersoft community edition download ×

How do you solicit parameters from users


george_17

Recommended Posts

Hi all

I have had some excellent advice here and really appreciate sharing the knowledge.

I now need to understand how to write a report like select * from table x where date = a date entered by the user

can anyone tell me how to do this please??

many thanks

 

george

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

user specified inputs are passed to a report via "parameters", there are tons of examples online you can use as a guide if it's your first time setting this up. You can reference those parameters in your query to get data filtered by user input. if you're using jasper server, there are two steps. You need to create an input control and associate that to your published report, then you need a parameter defined in your jrxml that has a matching id with the input control. That's how jasper knows to correlate a server input with a report parameter. Again, lots of good info online via tutorials, and step by step videos on youtube.

 

select * from table x where date = $P{date}

- date is a parameter defined in the report jrxml and referenced in the query; you can test this out on jasper studio very quickly

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