Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » How to get all default values of scalar parameter(A parameter may have more than one default value. How can I get these?)
How to get all default values of scalar parameter [message #831835] Thu, 29 March 2012 12:19 Go to next message
Eric Düll is currently offline Eric DüllFriend
Messages: 2
Registered: March 2012
Junior Member
Hi everybody,

the following snippet shows a "multiple-value" birt report parameter, that has more than one default value. IScalarParameterDefn only returns me teh first default parameter --> getDefaultValue()

IGetParameterDefinitionTask.getSelectionList( "param_listbox_multiple" ).getDefaultValue(); //returns only M02

Can anyone tell me how I get the list of all default values {"M02", "A01"}

Thanks a lot, Eric

        <scalar-parameter name="param_listbox_multiple" id="77">
            <text-property name="helpText">Welche Vorerkrankungen hatten sie bisher (mehrere Antworten möglich. Default ist Mumps und Angina)</text-property>
            <text-property name="promptText">Vorerkrankungen</text-property>
            <property name="valueType">static</property>
            <property name="dataType">string</property>
            <property name="distinct">true</property>
            <simple-property-list name="defaultValue">
                <value type="constant">M02</value>
                <value type="constant">A01</value>
            </simple-property-list>
            <list-property name="selectionList">
                <structure>
                    <property name="value">M01</property>
                    <property name="label">Masern</property>
                </structure>
                <structure>
                    <property name="value">M02</property>
                    <property name="label">Mumps</property>
                </structure>
                <structure>
                    <property name="value">R1</property>
                    <property name="label">Röteln</property>
                </structure>
                <structure>
                    <property name="value">A01</property>
                    <property name="label">Angina</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>

Re: How to get all default values of scalar parameter [message #832394 is a reply to message #831835] Fri, 30 March 2012 04:45 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Try this:

IScalarParameterDefn scalar = (IScalarParameterDefn) param;
ScalarParameterHandle myhandle = (ScalarParameterHandle)
param.getHandle();
ArrayList myvals = (ArrayList) myhandle.getDefaultValueList();

Check to see if myvals is not null and then iterate it.

Jason


On 3/29/2012 8:19 AM, Eric Düll wrote:
> Hi everybody,
>
> the following snippet shows a "multiple-value" birt report parameter,
> that has more than one default value. IScalarParameterDefn only returns
> me teh first default parameter --> getDefaultValue()
>
>
> IGetParameterDefinitionTask.getSelectionList( "param_listbox_multiple"
> ).getDefaultValue(); //returns only M02
>
> Can anyone tell me how I get the list of all default values {"M02", "A01"}
>
> Thanks a lot, Eric
>
>
> <scalar-parameter name="param_listbox_multiple" id="77">
> <text-property name="helpText">Welche Vorerkrankungen hatten sie bisher
> (mehrere Antworten möglich. Default ist Mumps und Angina)</text-property>
> <text-property name="promptText">Vorerkrankungen</text-property>
> <property name="valueType">static</property>
> <property name="dataType">string</property>
> <property name="distinct">true</property>
> <simple-property-list name="defaultValue">
> <value type="constant">M02</value>
> <value type="constant">A01</value>
> </simple-property-list>
> <list-property name="selectionList">
> <structure>
> <property name="value">M01</property>
> <property name="label">Masern</property>
> </structure>
> <structure>
> <property name="value">M02</property>
> <property name="label">Mumps</property>
> </structure>
> <structure>
> <property name="value">R1</property>
> <property name="label">Röteln</property>
> </structure>
> <structure>
> <property name="value">A01</property>
> <property name="label">Angina</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>
>
>
Re: How to get all default values of scalar parameter [message #832598 is a reply to message #832394] Fri, 30 March 2012 10:31 Go to previous message
Eric Düll is currently offline Eric DüllFriend
Messages: 2
Registered: March 2012
Junior Member
Thanks a lot,

Eric
Previous Topic:Can't add more than one x/y series to scatterplot
Next Topic:Report Preview in eclipse does not work
Goto Forum:
  


Current Time: Thu Nov 27 22:13:08 GMT 2014

Powered by FUDForum. Page generated in 0.03926 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software