jkeri Posted March 15, 2013 Share Posted March 15, 2013 My Jasper reports are launched from a java webpage that has multiple items on it. I want to select multiple items from the webpage and pass all of them into my Jasper report. My report has a simple SQL querySELECT SAMPLENUMBER from SAMPLE_TABLEWHERE SAMPLENUMBER in the list of samples i checked off on the webpage.Can anyone help me with the coding that need to be in the SQL query and any other tips on this?Thanks in advance. Link to comment Share on other sites More sharing options...
marianol Posted March 18, 2013 Share Posted March 18, 2013 To do this you will need to use a parameter in your report. And since you want to use the 'IN' statment in your query; your report parameter has to be defined as a collection and you will use the $X{IN, , } expresion in your query. So if you named your parameter 'MYSELECTEDNUMBERS', your report query will look like:SELECT SAMPLENUMBER from SAMPLE_TABLEWHERE $X{IN, SAMPLENUMBER, MYSELECTEDNUMBERS}You will find more information in Chapter 6 of the iReport ultimate guide (http://community.jaspersoft.com/documentation) and also here: http://jasperreports.sourceforge.net/sample.reference/query/index.html Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now