|
Re: Dynamic Parameter with Scripted Data Set [message #638895 is a reply to message #638893] |
Sat, 13 November 2010 00:39 |
|
Mike,
What version of BIRT are you using?
Can you try the attached report?
Jason
<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.22"
id="1">
<property name="comments">Copyright (c) 2006 <<Your Company
Name here>></property>
<property name="createdBy">Eclipse BIRT Designer Version
2.6.1.v20100902 Build <2.6.1.v20100915-1750></property>
<property name="units">in</property>
<property name="layoutPreference">auto layout</property>
<parameters>
<scalar-parameter name="NewParameter" id="50">
<property name="valueType">dynamic</property>
<property name="dataSetName">SDSet2</property>
<expression name="valueExpr"
type="javascript">dataSetRow["col1"]</expression>
<property name="dataType">string</property>
<property name="distinct">true</property>
<property name="paramType">simple</property>
<property name="controlType">list-box</property>
<property name="mustMatch">false</property>
<property name="fixedOrder">true</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
</parameters>
<data-sources>
<script-data-source name="SDS2" id="4"/>
</data-sources>
<data-sets>
<script-data-set name="SDSet2" id="5">
<list-property name="resultSetHints">
<structure>
<property name="position">1</property>
<property name="name">col1</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">col2</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">col3</property>
<property name="dataType">string</property>
</structure>
</list-property>
<list-property name="columnHints">
<structure>
<property name="columnName">col1</property>
</structure>
<structure>
<property name="columnName">col2</property>
</structure>
<structure>
<property name="columnName">col3</property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">col1</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">col2</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">col3</property>
<property name="dataType">string</property>
</structure>
</list-property>
</structure>
<property name="dataSource">SDS2</property>
<method name="open"><![CDATA[tcount=0;]]></method>
<method name="fetch"><![CDATA[if (tcount < 20)
{
row["col1"] = "Test"+tcount;
row["col2"] = "Test2"+tcount;
row["col3"] = "Test3"+tcount;
tcount++;
return true;
}
else
return false;]]></method>
</script-data-set>
</data-sets>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<property name="topMargin">1in</property>
<property name="leftMargin">1.25in</property>
<property name="bottomMargin">1in</property>
<property name="rightMargin">1.25in</property>
<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="51">
<list-property name="boundDataColumns">
<structure>
<property name="name">NewParameter</property>
<expression name="expression"
type="javascript">params["NewParameter"]</expression>
<property name="dataType">string</property>
</structure>
</list-property>
<property name="resultSetColumn">NewParameter</property>
</data>
</body>
</report>
On 11/12/2010 6:53 PM, Mike wrote:
> I am creating a report with an input parameter based on a data set. I
> need a combo box to populate based on a query. The datasource is
> scripted and therefore i am using a scripted data set. I have two data
> sets, one for the parameter and the one for the report. I assign the
> data set to the parameter dynamically and set the data set and the field.
>
> The problem is when i run the report the combo box is not getting
> populated. I know the data set works because if i put it on the report i
> get results.
> It is as if the query is not being executed before the parameters window
> comes up.
>
> What do i need to do to have a combo box populate based on a scripted
> data set?
> Thanks
>
|
|
|
|
Re: Dynamic Parameter with Scripted Data Set [message #639210 is a reply to message #638898] |
Mon, 15 November 2010 15:42 |
|
Mike,
I believe that was a bug in BIRT 2.1.2. It is fixed in later versions
of BIRT.
Jason
On 11/12/2010 8:23 PM, Mike wrote:
> I am using birt 2.1.2 for maximo 7.1.1.4.
>
> I tried to copy and paste that XML into a new report but i got XML errors.
>
> Thanks
|
|
|
|
Re: Dynamic Parameter with Scripted Data Set [message #730099 is a reply to message #730076] |
Tue, 27 September 2011 15:42 |
|
Can you try it with BIRT 2.6 or 3.7?
Jason
On 9/27/2011 11:16 AM, Krzysiek wrote:
> I've got exactly the same issue I've got scripted data Source and I try
> to use it to fetch dynamically into report parameter values list - but
> the list is empty - I'm pretty sure that my data source work fine cause
> I could set default value for parameter form it - in this case when I've
> run the report I've got only one (this) value on the list.
> I'm using Birt 2.3.2 - any suggestion how to fix it ?
|
|
|
|
Re: Dynamic Parameter with Scripted Data Set [message #730492 is a reply to message #730336] |
Wed, 28 September 2011 14:11 |
|
I did not see the screenshot. Can you try the attached example?
Jason
On 9/28/2011 3:53 AM, Krzysiek wrote:
> I tried 3.7 and it is exactly the same
> Here are couple of screenshots:
> As I said I'm able to select a default value for the parameter
>
>
> But when i run report it look like this:
>
>
> and stack trace of the error (unfortunately not whole and as an image :( )
>
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04187 seconds