Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7543171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:21:27+00:00 2026-05-30T08:21:27+00:00

I have been trying to make a list box report parameter with multiple choice

  • 0

I have been trying to make a list box report parameter with multiple choice enabled. I’m trying to filter my report based on this parameter. I have wrote a code something like this, but it is not working;

importPackage(Packages.java.util.logging);
var fileHandler = new FileHandler("/tmp/birt.log", true);
var rootLogger = Logger.getLogger("");
rootLogger.addHandler(fileHandler);

var queryString = "";
queryString = "select * from public.r_"+params["rid"]+"_0 where (r_date_1 >= '"+params["startdate"]+"' and r_date_2 <'"+params["enddate"]+"')";
queryString += " and (r_vchar_3=";

filterIPLength = reportContext.getParameterValue("filterIP").length;
Logger.getAnonymousLogger().info("Parameter Count: "+filterIPLength);


for(i = 0; i<filterIPLength; i++) {
    queryString  += "'"+reportContext.getParameterValue("filterIP")[i]+"'";

    if (i != filterIPLength - 1) {
        queryString += "or r_vchar_3=";
    }
}

queryString += ")";
this.queryText = queryString;

the problem here is, reportContext.getParameterValue("filterIP").length; line always returns 1, even though I choose multiple parameters and the report only shows the first selected data since for loop runs only once.

What may cause this problem? How can i debug and solve it?

Any ideas will be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:21:28+00:00Added an answer on May 30, 2026 at 8:21 am

    Your script should work, at least it works in my BIRT version (2.6, Eclipse 3.6, Win-32). I’ve written a small minimalistic report (which works) to track down the problem, probably it can help you debugging.:


    <?xml version="1.0" encoding="UTF-8"?>
    <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.22" id="1">
    <property name="createdBy">Eclipse BIRT Designer Version 2.6.1.v20100902 Build &lt;2.6.1.v20100915-1750></property>
    <property name="units">in</property>
    <property name="iconFile">/templates/blank_report.gif</property>
    <property name="bidiLayoutOrientation">ltr</property>
    <property name="imageDPI">120</property>
    <parameters>
    <scalar-parameter name="NewParameter" id="7">
    <property name="valueType">static</property>
    <property name="dataType">string</property>
    <property name="distinct">true</property>
    <list-property name="selectionList">
    <structure>
    <property name="value">123</property>
    <property name="label">test</property>
    </structure>
    <structure>
    <property name="value">124</property>
    <property name="label">test2</property>
    </structure>
    </list-property>
    <property name="paramType">multi-value</property>
    <property name="controlType">list-box</property>
    <property name="mustMatch">true</property>
    <property name="fixedOrder">true</property>
    <structure name="format">
    <property name="category">Unformatted</property>
    </structure>
    </scalar-parameter>
    </parameters>
    <data-sources>
    <script-data-source name="Data Source" id="95">
    <method name="beforeOpen"><![CDATA[paramLength = reportContext.getParameterValue("NewParameter").length;]]></method>
    </script-data-source>
    </data-sources>
    <data-sets>
    <script-data-set name="Data Set" id="96">
    <list-property name="resultSetHints">
    <structure>
    <property name="position">0</property>
    <property name="name">test</property>
    <property name="dataType">string</property>
    </structure>
    </list-property>
    <list-property name="columnHints">
    <structure>
    <property name="columnName">test</property>
    </structure>
    </list-property>
    <structure name="cachedMetaData">
    <list-property name="resultSet">
    <structure>
    <property name="position">1</property>
    <property name="name">test</property>
    <property name="dataType">string</property>
    </structure>
    </list-property>
    </structure>
    <property name="dataSource">Data Source</property>
    </script-data-set>
    </data-sets>
    <styles>
    <style name="report" id="4">
    <property name="fontFamily">sans-serif</property>
    <property name="fontSize">10pt</property>
    </style>
    <style name="crosstab-cell" id="5">
    <property name="borderBottomColor">#CCCCCC</property>
    <property name="borderBottomStyle">solid</property>
    <property name="borderBottomWidth">1pt</property>
    <property name="borderLeftColor">#CCCCCC</property>
    <property name="borderLeftStyle">solid</property>
    <property name="borderLeftWidth">1pt</property>
    <property name="borderRightColor">#CCCCCC</property>
    <property name="borderRightStyle">solid</property>
    <property name="borderRightWidth">1pt</property>
    <property name="borderTopColor">#CCCCCC</property>
    <property name="borderTopStyle">solid</property>
    <property name="borderTopWidth">1pt</property>
    </style>
    <style name="crosstab" id="6">
    <property name="borderBottomColor">#CCCCCC</property>
    <property name="borderBottomStyle">solid</property>
    <property name="borderBottomWidth">1pt</property>
    <property name="borderLeftColor">#CCCCCC</property>
    <property name="borderLeftStyle">solid</property>
    <property name="borderLeftWidth">1pt</property>
    <property name="borderRightColor">#CCCCCC</property>
    <property name="borderRightStyle">solid</property>
    <property name="borderRightWidth">1pt</property>
    <property name="borderTopColor">#CCCCCC</property>
    <property name="borderTopStyle">solid</property>
    <property name="borderTopWidth">1pt</property>
    </style>
    </styles>
    <page-setup>
    <simple-master-page name="Simple MasterPage" id="2">
    <page-footer>
    <text id="3">
    <property name="contentType">html</property>
    <text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
    </text>
    </page-footer>
    </simple-master-page>
    </page-setup>
    <body>
    <data id="107">
    <property name="whiteSpace">nowrap</property>
    <property name="dataSet">Data Set</property>
    <list-property name="boundDataColumns">
    <structure>
    <property name="name">test</property>
    <text-property name="displayName">test</text-property>
    <expression name="expression" type="javascript">dataSetRow["test"]</expression>
    <property name="dataType">string</property>
    </structure>
    </list-property>
    <property name="resultSetColumn">test</property>
    </data>
    <text-data id="93">
    <expression name="valueExpr">"Param length is " + paramLength</expression>
    <property name="contentType">html</property>
    </text-data>
    </body>
    </report>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to make this to be a little jQuery plugin that
Using MVC 2 I have been trying to make this record store project. Creating
I have been trying to make a case for using Python at my work.
I have been trying to make a div fade in evey 30sec and out
I have been trying to make the sub-menu horizontal. In my HTML it looks
I have been trying to make an init script using start-stop-daemon. I am stuck
I have been trying to make a Cross-platform 2D Online Game, and my maps
I have been trying to test my application to make sure that all the
I have been trying to get yui-css grid system to make a three column
I'm pretty much a newb with spring-hibernate and I have been trying to make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.