Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How can I prevent a blank entry in a parameter list?(How can I prevent a blank entry in a parameter list?)
How can I prevent a blank entry in a parameter list? [message #1627756] Sat, 21 February 2015 19:04 Go to next message
Al Koch is currently offline Al KochFriend
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 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

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
Re: How can I prevent a blank entry in a parameter list? [message #1637492 is a reply to message #1633334] Thu, 26 February 2015 18:55 Go to previous messageGo to next message
Al Koch is currently offline Al KochFriend
Messages: 62
Registered: August 2011
Member
Hi Michael,

That's a creative idea but unfortunately an "All" selection won't t work my particular context. Is there some other way to handle this? Can we prevent the blank entry altogether? Please take a look at this if you would.

Thank you.
Al
Re: How can I prevent a blank entry in a parameter list? [message #1654938 is a reply to message #1637492] Fri, 06 March 2015 22:47 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

I think you can modify the parameter jsp page to disclude the blank.

Michael

Developer Evangelist, Silanis
Re: How can I prevent a blank entry in a parameter list? [message #1654939 is a reply to message #1654938] Fri, 06 March 2015 22:48 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Take a look at this devshare from the BIRT Developer Center: http://developer.actuate.com/community/forum/index.php?/files/file/1038-removing-blank-line-in-multi-select-cascading-parameters/

Michael

Developer Evangelist, Silanis
Previous Topic:How do I get multiple parameter values processed in a Data Set?
Next Topic:Exception when displaying a Report (as html)
Goto Forum:
  


Current Time: Thu Apr 25 12:31:45 GMT 2024

Powered by FUDForum. Page generated in 0.03566 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top