Well,<br />
i googled and tried like 3 days before i post here. I saw many people asking and having the same problem, but there are not many solutions for this problem.<br />
<br />
My problem is the default value in the "Cascading parameter group".<br />
The default value is that first "blank" in the listbox. <br />
Lets say my list (from the database) contains: <br />
"a"<br />
"b"<br />
"c"<br />
<br />
In the report i will have:<br />
"" <- default<br />
"a"<br />
"b"<br />
"c"<br />
<br />
Example from this forum :<br />
<br />
<img src='
http://www.birt-exchange.org/org/forum/uploads//monthly_09_2011/post-42134-13154799041724.jpg' alt='Posted Image' class='bbc_img' /><br />
<br />
<br />
When i set the default value as "a" for example, the default value will be "a" and the blank line will be removed. The problem is, i dont wanna set a hard-coded default value.<br />
<br />
Now my question is:<br />
1/ Is there any way to set the default value as the "first value from the dataset" ?<br />
like in the normal listbox parameter (not cascaded).<br />
In the normal listbox parameter, the default value is always the first value from the dataset (if you dont set a default value, ofc).<br />
<br />
2/ Is there a way to get a value (from an sql query) before the report is loaded and set that value to the default value? I could in this case just select the first value from the database and set it as a default value for my cascading parameter group.<br />
<br />
3/ A solution would be just to get a value from the database before the report loads, and set it as a default value. but i dont know how to do this.. Is it possible to run an sql query as a script in OnPrepare() or Initialize() ?<br />
<br />
What i dont understand is, why does BIRT pick the first value as "default value" in the normal parameter list-box, and not for the cascading parameter group.<br />
<br />
I would appreciate any answer.<br />
Thanks.