nealhudson Posted February 28, 2008 Share Posted February 28, 2008 Hi there, I have a report which contains a java.util.Collection as an input parameter. I then use this in the SQL Query using the $X{IN, field, parameter} operation.On JasperServer, I have set up a Multi-Select query input control which displays a list of possible values. Behind this there is a query to retrieve the info from the database. I now want to use this report as a drill-down from another report, i.e. embed a hyperlink in the parent report. I would like in this instance for the multi-select input to be populated with ALL the values in the database. I was thinking there would be some way of either setting up a subdataset in the parent or the child, entering the query in here to retrieve the list of values, and either sending it as the parameter in the hyperlink in the parent report, or using it as the default value in the child report. What is the best way to go about doing this? ThanksNeal Link to comment Share on other sites More sharing options...
lucianc Posted February 29, 2008 Share Posted February 29, 2008 JasperReports subdatasets can only be used currently for charts and crosstabs, and not for retrieving one or more values form the DB or other data sources. However, if one uses $X{IN, column, parameter} with an empty/null parameter values, no filter will be applied so this would be equivalent (when the DB column does not contain nulls) to passing all the values in the parameter. So if you don't set any default expression for the parameter, the query will not contain any filter by default. Regards,Lucian Link to comment Share on other sites More sharing options...
nealhudson Posted February 29, 2008 Author Share Posted February 29, 2008 Thanks Lucian - that will solve my issue RegardsNeal Link to comment Share on other sites More sharing options...
nealhudson Posted February 29, 2008 Author Share Posted February 29, 2008 Hi again Lucian I just tried this with my report, I have set up the parameter not to be mandatory. When I click the hyperlink to go from the master report to the detail report, I get the following error:net.sf.jasperreports.engine.JRRuntimeException: Multi parameters cannot contain null values. The child report contains 2 parameters - the first is the collection, the 2nd is a Date. I'm filling the Date but not the collection. Link to comment Share on other sites More sharing options...
nealhudson Posted March 3, 2008 Author Share Posted March 3, 2008 Any thoughts on this Lucian? 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