Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Setting defaultValue type of ScalarParameterHandle
CarstenS
<p>I want to set the defaultValue type of a ScalarParameterHandle with the DesignEngineAPI.</p><p> </p><p>The resulting rptdesign should have something like this:</p><pre class="_prettyXprint"><scalar-parameter name="param1" id="74"> <property name="isRequired">false</property> <property name="dataType">dateTime</property> <simple-property-list name="defaultValue"> <value type="javascript">new Date()</value> </simple-property-list> <property name="controlType">text-box</property></scalar-parameter></pre><p>I tried something like this:</p><p> </p>
<pre class="_prettyXprint">ScalarParameterHandle scalarParameter = elem.newScalarParameter("param1");scalarParameter.setValueType(DesignChoiceConstants.PARAM_VALUE_TYPE_STATIC);PropertyHandle valuePropHandle = scalarParameter.getPropertyHandle(ScalarParameterHandle.DEFAULT_VALUE_PROP);valuePropHandle.setStringValue("new Date()");</pre><p> </p><p>Hope someone can help me...</p><p> </p><p> </p><p> </p>
Find more posts tagged with
Comments
mwilliams
<p>I haven't tried it, but you might try something like:</p><p> </p><p>ArrayList myList = new ArrayList();</p><p>myList.add("new Date()");</p><p>scalarParameter.setDefaultValueList(myList);</p><p> </p><p>I'll try it out here in a bit and let you know. If it works, I'll post exact code, unless you beat me to it.
</p>