BIRT Cascading Parameters - Defaulting blank parameters to "Null Value"

Options
liteshade
liteshade Member
edited February 11, 2022 in Analytics #1
Hi,

I am currently working on a BIRT report that includes cascading parameters running six levels deep (see attachment).

Only the top parameter is required (Product Code Level 1). The way I would like this to behave is that when a user clicks "OK", any parameters that are still blank should default to "Null Value." But currently, the user must individually select "Null Value" for each parameter in order to display the report.

Is there any way to set these blank parameters as "Null Value" upon submitting the form, or removing the blank field altogether?

I first tried removing the blank field from the top of the list box (via editing the ComboBoxParameterFrangment.jsp file). After making this change, the parameter window would initially load with Product Code Levels 2 through 6 defaulted to "Null Value." But as soon as I select a Product Code Level 1, the blank selections would return on the rest of the parameters.

Next I tried updating the BirtParameterDialog.js file to set any blank values in found in the cascading parameters to null (via updating the refresh_cascade_select and collect_parameter functions). But this resulted in several errors being displayed such as this below:

SEVERE: Cannot set a null value to parameter 2.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement null value.
SQL error #1:Parameter metadata not available for the given statement
... (stack trace) ...

I've been looking online for any other possible solution but to no luck. Any help would be greatly appreciated on this matter as I am completely stumped.

Thanks,
Jeremy

Note: I am using BIRT Report Viewer 3.7.1

Comments

  • Tubal
    Tubal Member
    edited February 1, 2012 #2
    Options
    What kind of dataset are you using? (query, csv, etc)<br />
    <br />
    If it's a query, you could just leave the parameters the way they are, and modify the query text of the dataset in the beforeOpen event.<br />
    <br />
    i.e.<br />
    <br />
    <pre class='_prettyXprint _lang-auto _linenums:0'>if(params["param1"].value=="" || params["param1"].value==null){
    this.querytext.replace("holderinquery","whatIwantittobe")
    }
    </pre>