Jump to content
We've recently updated our Privacy Statement, available here ×

Cascading Input: Multi select query and date param


DocJones

Recommended Posts

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.

regards

Marc

Link to comment
Share on other sites

  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

 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

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 regards
Marc

 

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 2010


And nothing more if i change the value in the date picker...

 

Upon starting the report using iReport


2010-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_TEST
2010-07-01 14:00:23,365  WARN ManagementService,http-8081-1:813 - Loaded RU null
2010-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@114de83


This 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:47



Post Edited by DocJones at 07/01/2010 11:47
Link to comment
Share on other sites

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

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

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

lucianc
Wrote:

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

  • 2 years later...

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

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