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)
Removing null and empty values from listbox
Apeksha
<p><span style="font-family:arial, sans-serif;"><span style="font-size:10pt;">I have noticed this weird thing in my report parameter page. When the parameter is marked as required, the dropdown fetches the value with a default 'Select' and rest values. But when I mark the parameter as not required, the dropdown adds a null value and an empty row in the values.</span></span></p>
<p> </p>
<p><span style="font-family:arial, sans-serif;"><span style="font-size:10pt;">I also tried referring some old post which states to modify the </span></span><span style="font-family:arial, sans-serif;"><span style="font-size:10pt;">ComboBoxParameterFragment.jsp in the </span></span></p>
<p><span style="font-family:arial, sans-serif;"><span style="font-size:10pt;">\webcontent\birt\pages\parameter . But seems like the code has changed in the recent version of BIRT . Hence I do not understand it very well.</span></span><br><br><span style="font-family:arial, sans-serif;"><span style="font-size:10pt;">Any help will be appreciated. Thanks !</span></span></p>
Find more posts tagged with
Comments
Matthew L.
<p>When you check the "is required" box for a parameter, the null and empty values wont appear in the list as "null" & "empty" are not values and therefore are automatically filtered out of the dropdown list.</p>
<p>Typically if you need a required parameter to have "No Value", you would have to add custom JavaScript logic to the reports initialize method to account for "No Value" as null.</p>
<p> </p>
<p>If you always want to remove the null and empty values from the parameter list, you can add a filter to the data set (that is used to populate the parameter) so that it will only return values that contain a value.</p>
Apeksha
<p>Thanks for your response firstly. Actually I do not need any of them, neither null nor empty. These values are not present in my database. They are added by BIRT when it renders the dropdown. So am not sure if the filtering would work and also . So BIRT adds them to the drop down list only when the parameter is marked as not required. Thanks !</p>
Matthew L.
<p>I'm not sure what would cause BIRT to list empty values in the dropdown unless they were present in the data.</p>
<p>Are you using any scripting in the parameter?</p>
<p>Are you able to reproduce the issue using the classic models built in sample database?</p>
Apeksha
<p>I have attached a sample rptdesign on the customers table which has a city dropdown which is optional. You can see the Null value being populated in the dropdown. Thanks </p>
shamo
<p>select the is required field as in the attachment. and that will pick a field from your dataset</p>
Apeksha
<p>Thanks Shamo. But the user can leave this parameter blank.(basically just with Select , the default value in dropdown) If I mark it as required, BIRT prompts me for some selection.</p>
Apeksha
<p>ok, so for this, I have opted a workaround. I mark the fields as required in BIRT and have the default value selected as either 'All' or 'Select' . And I then correspondingly handle in the backend. So with that my dropdowns are clean, no empty or null values.</p>