How can I prevent a blank entry in a parameter list? [message #1627756] |
Sat, 21 February 2015 19:04 |
Al Koch Messages: 62 Registered: August 2011 |
Member |
|
|
Hi,
I have a Cascading Parameter Group with two parameters. (The query that loads the Data Set that is listed in the 2nd parameter list box uses the value selected from the 1st parameter to filter that list). This is working. When the report comes up, the 1st parameter list box shows its default selection and the 2nd parameter shows the 1st value of the 2nd Data Set list, filtered by the default value displayed in the 1st parameter. However, if the selection is changed in the 1st parameter, this causes the contents of the list displayed in the 2nd parameter to be changed (which is correct) but now the list in the 2nd parameter's list box starts with an empty entry. If that is selected and OK is pushed we see an "ugly" message saying that the "ID used for the 2nd Report Parameter" (a "no friendly"/internal ID) has no value which is not a good error message.
I'm pretty sure the problem has to do with the default value that is set for the 2nd parameter. I happened to select a as a default a value that is in the Data Set when filtered by the default value in the 1st parameter. But when the 1st parameters value is changed, the 2nd Data Set changes (good) and since the 2nd parameter's default value does not occur in the newly filtered list I suspect that the code is displaying a blank entry at the top of the list.
I see that in addition to specifying a constant as the default a JavaScript function could be defined. I'm not at all sure how to write a JavaScript function to dynamically change the default value based upon the value selected as the 1st parameter. Worse, even if I did there is no way to define a default value for the 2nd parameter based on each possible filter value selected in the 1st parameter because the user can add new data values into the database for the Data Sets used for these two parameters and I can't know ahead of time what those values will be - so it's not possible to define such a function.
The only solution I can see would be to request that the code not display a blank entry in a parameter list box when the default value is not available in the Data Set. In fact, I would argue that this is a bug.
Two questions:
1) Even though defining a JavaScript function won't solve this particular problem, can someone tell me how to write a JavaScript function that would define a default value based on the selection in the 1st parameter?
2) Does anyone have any ideas how I can prevent having a blank entry at the top of a parameter list when no default value is available?
Thank you.
[Updated on: Sat, 21 February 2015 19:04] Report message to a moderator
|
|
|
Re: How can I prevent a blank entry in a parameter list? [message #1633334 is a reply to message #1627756] |
Tue, 24 February 2015 20:27 |
|
Just a quick question: Would "All" be an option to add as the default for the second parameter and as a value in the second data set so that there is always a consistent option for the second level? As for removing the blank parameter option, you could likely do this in the jsp pages within the viewer. I'd have to look at it a little closer to figure that out.
Michael
Developer Evangelist, Silanis
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03566 seconds