Search code examples
birtactuate

sending multiple selected values comma-separated to a stored procedure


I am currently using this:

params["RPBla"].join(",")

as default parameter of a (stored procedure) dataset. This works fine and sends one or more selected values from the report parameter RPBla to a stored procedure, e.g.:

1,2,3

Unfortunately, this does not work if the user does not select any value. Any ideas what to do. Actuate BIRT should send NULL instead of for example 1,2,3.


Solution

  • What about testing the content in this default value expression, something like:

    if (params["RPBla"].value==null){
       null;
    }else{
       var list=params["RPBla"].join(",");
       list.length>0 ? list : null;
    }
    

    Of course you could return anything you need instead of "null" here, for example returning a specific value warning the stored procedure that the filter should be disabled.