list box parameter in report not working

nalany
edited February 11, 2022 in Analytics #1

Hello,
I'm beginner at Birt.
I found an example to create a report where we can display parameter in a list box.
The problem is that when I select the one choice in the select list, the report doesn't work (it always display all the data).
In attached the rptdesign.
Can anyone help me to find a solution ?

Thanks,

Comments

  • jfranken
    edited January 2, 2019 #2

    I am not sure how your code is supposed to work. If you want to run that code, my suggestion is to use the browser debugging tools to try to find the issue. The console.log("message") command prints to the browser console pane.

    Attached is a version of your report that I modified. I removed your code and did a more traditional implementation. I noticed that you want "ALL" as an option. There are a few steps required to add "ALL" to the list and filter accordingly.

    1. Add "ALL" to the ParameterDS query via a union clause so that it will appear in the list.
    2. Change the parameter type to List Box and make it Visiible.
    3. Change the Data Set filter so that it handles the case where "ALL" is selected.

    I created the example quickly, so please test it thoroughly before using it in production.

    Warning No formatter is installed for the format ipb
  • Here is a modified version of your report. I removed the code and used the following steps to add the "ALL" option to the list:

    1. Change the ParameterDS query. Add the "ALL" value.
    2. Change the parameter to List Box and make it visible.
    3. Modify the Data Set filter to handle the "ALL" selection.

    Please test thoroughly before using in production.

    Warning No formatter is installed for the format ipb
  • Hi Jeff,

    Thanks for your time to answer to my request and for the changes on the report which is works very well.
    What I really need is that list of the parameter is displayed on the report, in a select list, as you can see in the screenshot.
    Do you know if is it possible ? If yes, can you help me to do that please ?

    Thanks a lot,

  • Thanks for the clarification. If I understand correctly now, the existing parameter interface implements the same functionality that you are trying to implement. It requires three mouse clicks instead of two, but it works without any code. You probably already know this, but you said you are new to the product so I wanted to mention it.

    I tested your report in Chrome, Firefox, and IE. The report and the custom dropdown listbox you created work perfectly for me in Chrome and Firefox. The dropdown does not work in IE. You said that when you select a country in the list, the report shows all of the data, not just the data for the selected country. When I tested in Chrome and Firefox, the data was filtered correctly. Does it work for you in Chrome and Firefox? Do you need to use a different browser? If so, which browser are you using and does that browser support your code?

    I have a question about your code. How does the report get reloaded? It looks like the following line just saves the modified URL:

    window.location.search = query.toString()

    Does it also automatically load the URL? I was expecting to see a load() or reload() call.

    Thanks.

    Warning No formatter is installed for the format ipb