Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Use Cascaded Parameter Value for Default Value in Subsequent Cascaded Parameter
mwengren
Hi all, <br />
<br />
I have a question about something that I think <em class='bbc'>should</em> be possible to do using a cascaded parameter group, but I am not able to make it work. <br />
<br />
Basically, I have a cascaded parameter group with three parameters. The first parameter 'RP_FaultType' allows the user to select what is called a fault type where the values are just strings from a database field. The resulting fault type string selected by the user is fed as a parameter into a data set that populates a second parameter called 'RP_FaultType_Default'. This is just a query of the same database table that selects a value from a number field with default values in days to use for each fault type for calculations in the reports. The query in this case is:<br />
<br />
select DAYS_DEFAULT <br />
from FAULT_TYPES<br />
where FAULT_TYPE = ?<br />
<br />
This sequence works fine, as soon as the user picks a 'RP_FaultType' the 'RP_FaultType_Default' field is populated from the database. <br />
<br />
The final cascaded parameter is the one that is giving me issues. What I want to do is to use the <strong class='bbc'>value</strong> of RP_FaultType_Default as the default value for the third cascaded parameter that lets the user override the default if they want. This parameter uses a data set that returns a list of integer values from another database table containing alternate number of days options. The list looks like this:<br />
<br />
DAYS:<br />
7<br />
14<br />
21<br />
30<br />
60<br />
90<br />
120<br />
365<br />
<br />
But, when I try to set the default value for the third cascaded parameter 'RP_FaultType_DaysSelected' to 'params["RP_FaultType_Default"].value', I get an error: 'The value does not match the data type'. It <em class='bbc'>should</em> because RP_FaultType_Default is clearly an integer, and it shows up in the field in the parameter list. See attached screenshot. The data type for my 'RP_FaultType_DaysSelected' parameter is set to Integer. <br />
<br />
Is this possible? It seems like a pretty straightforward usage of cascaded parameter groups, using the resulting value of one cascaded parameter as a default value for a subsequent one. Am I doing something wrong?<br />
<br />
Any help appreciated.<br />
<br />
Micah
Find more posts tagged with
Comments
mwilliams
Do you have a default value for params["RP_FaultType_Default"]? If not, if you set it to a value that's in your 3rd parameter list, do you still get an error?
mwengren
Hi Michael,
Unfortunately, yes, I still get an error if I enter a default value under "RP_FaultType_Default" that is an integer and in the value list for "RP_FaultType_DaysSelected". It seems that BIRT doesn't recognize the formula that at runtime will refer to an integer when setting the value in the designer GUI, and throws an error. It would be nice if this could be overrided.
I also tried manually changing the formula for default value for "RP_FaultType_DaysSelected" to params["RP_FaultType_Default"].value in the source code for the report, but that didn't work either.
I used a workaround instead where I display the default value from the database in the "RP_FaultType_Default" parameter, don't offer any other choices, and list the override options for "RP_FaultType_DaysSelected" with a blank default value, and then check in the code for a variable whether or not params["RP_FaultType_DaysSelected"] == null. If null, I just use the value for "RP_FaultType_Default". It works, but it would look much better if the original design worked. Maybe a bug to fix for a future release.
Micah
mwilliams
What version are you using? You can log bugs in the bugzilla at www.eclipse.org/birt. If you do this, please post the bug report in here for future reference.