<p>Hello guys,</p><p> </p><p>I'm trying to get the selection list from a dynamic report parameter backed by a scripted data set and it is always being populated with an empty list. Code from <a data-ipb='nomediaparse' href='
http://www.birt-exchange.org/forum/index.php?/topic/23042-dynamic-parametes-from-application/?p=81059'>this post</a> is being used. Specifically, the following code is responsible for getting selection list values:</p><p> </p><div><pre class="_prettyXprint _lang-">if (scalar.getControlType() != IScalarParameterDefn.TEXT_BOX) { //log.info("dynamic parameter"); if (parameterHandle.getContainer() instanceof CascadingParameterGroupHandle){ Collection sList = Collections.EMPTY_LIST; String groupName = parameterHandle.getContainer().getName(); //used for Cascading parameters see IGetParameterDefinitionTask.java code for comments task.evaluateQuery(groupName); //Need to load this for calls to get next level. //This just gets the first level Object [] keyValueTmp = new Object[1]; sList = task.getSelectionListForCascadingGroup( groupName, keyValueTmp ); for ( Iterator sl = sList.iterator( ); sl.hasNext( ); ) { IParameterSelectionChoice sI = (IParameterSelectionChoice) sl.next( ); Object value = sI.getValue( ); Object label = sI.getLabel( ); log.info( label + "--" + value); } } else { Collection selectionList = task.getSelectionList(scalar.getName()); if (selectionList != null) { HashMap dynamicList = new HashMap(); for (Iterator sliter = selectionList.iterator(); sliter.hasNext();) { IParameterSelectionChoice selectionItem = (IParameterSelectionChoice) sliter.next(); Object value = selectionItem.getValue(); String label = selectionItem.getLabel(); //log.info( label + "--" + value); //Display label unless null then display value. Value is //the what should get passed to the report. dynamicList.put(value,label); } parameter.put("options", dynamicList); } }}</pre></div><div> </div><p><span class='bbc_underline'><strong>task.getSelectionList(scalar.getName());</strong></span></p><p>is always returning an empty list.</p><p> </p><p>It seems that using the code above, the scripted data set is not getting initialized or called. Particularly, our scripted data set calls a WS on a server and there is no log of any request on this server. It just logs something when using Birt Viewer to display the report. Through the Birt Viewer web app the report parameter list is displayed correctly. So, I don't think it is a configuration problem.</p><p> </p><p>Any ideas?</p><p> </p><p>Regards,</p><p> </p><p>David</p>