How to retrieve the selected content from the html tag in birt report


I have created a drop down using HTML in the text field from the Birt report. and also i have a chart in the same report using the filters. But i dont know how to retrieve the selected value.

can anyone please answer my question?


  • Can you use a Report Parameter instead of a Text element? If not, what prevents you from using the Report Parameter? The issue with the way you are trying to do it is that the dropdown will run in the browser after the chart has been created.

    Jeff F.
    Customer Support Engineer I
  • The chart should have to display in default when the page loads. and using the HTML Drop Down the chart should change. this is the requirement. That's the reason i'm not using report parameters.

    Can you please tell me how to achieve this?

  • edited June 25, 2018

    In the Help > About menu, what is your Build id? Also what is the Output Format setting of your chart?

    Jeff F.
    Customer Support Engineer I
  • Version: 24.2.1
    Build id: v20171002

    The output format for my chart is HTML5.

    This is how i wanted to display.

  • can anyone help me out regarding this?

  • Are you familiar with JavaScript API (JSAPI)? There is a link to some documentation here. If you can't use the standard report functionality with parameters, you will need to write custom JSAPI code to interact with the chart. I found one code snippet that might be helpful. It filters a chart with bookmark "ChartBookmark" using the ProductLine value from the Classic Models database.

            var bviewer = this.getViewer();
            var bpagecontents = bviewer.getCurrentPageContent();
            var bchart = bpagecontents.getChartByBookmark("ChartBookmark");
            if (bchart == null) return;     // unable to get handle to chart in case where chart becomes hidden
            var filter = new"PRODUCTLINE", "=", "Planes");
            var filters = new Array();
            bchart.setChartTitle("Orders By Country (Planes)");

    You would need to get the value from the dropdown in code and send it to the filter. Note that I have not tested this code and it is meant to be used only as an example.

    Jeff F.
    Customer Support Engineer I
  • This Question is Awaiting Your Response

    The moderator is awaiting your response. Were you able to resolve the issue? If so, would you please share your solution with others in a response post? Or, would you like some further assistance? Please let us know. Your question and its resolution are important to us, and we want to help.

    David Sciuto

Sign In or Register to comment.