DocJones Posted June 23, 2010 Share Posted June 23, 2010 Heyas,i am trying to get a report with two cascading input controls up and running but it seems, input controls of type DATE are not supported: These controls can use parameter values from other named parameter input controls whose values can resolve to a string. (taken from here)My use case is a Date picker for picking several records (multi-select, collection) of a given date (single select, date).Any help is appreciated.regardsMarc Link to comment Share on other sites More sharing options...
DocJones Posted June 29, 2010 Author Share Posted June 29, 2010 Anyone? (Yes, this is a shameless bump) :D Link to comment Share on other sites More sharing options...
Gaby38 Posted June 29, 2010 Share Posted June 29, 2010 Hello Marc,As far as I remember, I already used date parameters to get a list of values for another parameter via a query. I don't remember if that was a single-select or multi-select query but this was working fine.But, in a general way, to have cascading controls working fine I'm obliged to define define default values for parameters used by other parameters (for instance for a date : have to-day date)Post Edited by Gaby38 at 06/29/2010 20:48 Link to comment Share on other sites More sharing options...
DocJones Posted July 1, 2010 Author Share Posted July 1, 2010 Hello Gaby38,thanks, that helped to bring me further! I set the defaultValueExpression property of the date parameter to "new Date()" and now, i initially get the depending multi-select list filled correctly. However, if i change the date to a different date, the multi select list does not update itself.I can't see a query executing in the jasperserver.log (i am logging the queries) after the first time i called the report. Am i missing a vital part here? thanks and regardsMarc EDIT: I see the following in the LOG:Upon starting the report via webserver interface:010-07-01 14:00:30,049 DEBUG JRJdbcQueryExecuter,http-8081-2:155 - SQL query string: SELECT * FROM INTAUF.ORDR WHERE INTAUF.ORDR.ORDR_ENTRYUSER IN( SELECT FLDVAL_USR_NICKNAME FROM USRMGMT.FLDVAL WHERE FLDVAL_USRFLD_ID='IAF_FS_GKBELOG' AND FLDVAL_VALUE='3500') AND DATE(ORDR_FILESENDDATE)=?2010-07-01 14:00:30,064 DEBUG JRJdbcQueryExecuter,http-8081-2:252 - Parameter #1 (HB_DATE of type java.util.Date): Thu Jul 01 14:00:30 CEST 2010And nothing more if i change the value in the date picker... Upon starting the report using iReport2010-07-01 14:00:22,987 DEBUG JRJdbcQueryExecuter,http-8081-1:155 - SQL query string:2010-07-01 14:00:23,346 WARN ManagementService,http-8081-1:805 - Loading uri: /IDS/Development/HB_TEST2010-07-01 14:00:23,365 WARN ManagementService,http-8081-1:813 - Loaded RU null2010-07-01 14:00:23,373 WARN ManagementService,http-8081-1:820 - Loaded resource /IDS/Development/HB_TEST_files/HB_ORDR com.jaspersoft.jasperserver.api.metadata.common.domain.client.InputControlImpl@114de83This one is being ommitted to the log each time i change the date parameter (note the empty SQL query string :( )I am totally clueless about what i am doing wrong here... (JRXML attached) Post Edited by DocJones at 07/01/2010 11:47Post Edited by DocJones at 07/01/2010 11:47 Link to comment Share on other sites More sharing options...
DocJones Posted July 2, 2010 Author Share Posted July 2, 2010 Any help is appreciated. We are planning to go live with the report next week. If i dont get it managed to work i am forced to let the user select only the shipments from the current day. thanks & have a nice weekend all :D/M Link to comment Share on other sites More sharing options...
DocJones Posted July 7, 2010 Author Share Posted July 7, 2010 Heyas, i hate to bump threads, but so far, i havent been able to find a solution for this problem. Apparently, from the jasperserver.log, the cascading input control mechanism doesn't react on changing the date in the date picker. If anyone can help, i'D be really happy! regards/M Link to comment Share on other sites More sharing options...
lucianc Posted July 7, 2010 Share Posted July 7, 2010 As far as I can tell, the case should work as long as you write the input control query to expect a String parameter with the format used in the UI. I.e. if the UI uses yyyy-MM-dd, your query should work with parameter values such as 2010-05-15 (as Strings).Also remember to set a data source for the input control query.Regards,Lucian Link to comment Share on other sites More sharing options...
DocJones Posted July 7, 2010 Author Share Posted July 7, 2010 luciancWrote: Also remember to set a data source for the input control query. This just did the trick! Thanks a lot, i wasn't aware that the cascading input control needs a seperate data source. I was thinking it reuses the main reports datasource (very much likesubreports do). It works now (even with a input control of data type java.sql.Date).Thanks and kudos, Lucian regards/M Link to comment Share on other sites More sharing options...
lucianc Posted July 7, 2010 Share Posted July 7, 2010 I don't know either why the report's data source is not used for cascading input controls. I'm not very familiar with that part of JS, there might be a reason that I'm not aware of. Link to comment Share on other sites More sharing options...
DocJones Posted July 8, 2010 Author Share Posted July 8, 2010 It would be good to add this behaviour to the documentation at http://jasperforge.org/plugins/mwiki/index.php/Jasperserver/Cascading_input_controls Anyway, thanks again for your help, Lucian,/M Link to comment Share on other sites More sharing options...
cjasper Posted November 29, 2012 Share Posted November 29, 2012 Hi @DocJones, I am using a simple query in my cascading input control "select EXTRACT(MONTH FROM DATE $P{input_date}) as converted_date ;". where input_date is of type Date.It's simply not working giving an error unable to execute the cascading input control error.Can you please help me on this Thanks 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