Skip to main content



      Home
Home » Archived » BIRT » Showing data set values in a combo box
Showing data set values in a combo box [message #253522] Mon, 27 August 2007 09:06 Go to next message
Eclipse UserFriend
Originally posted by: ruby.boyarski.verix.com

Hi,
Is there a way (even scripted) to show DB values in a combobox (HTML
SELECT)?
I plan to add script that refreshes the report with the selected value once
selected.
Thanks,
Ruby
Re: Showing data set values in a combo box [message #253536 is a reply to message #253522] Mon, 27 August 2007 10:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Ruby,

Using a dynamic dataset and then tying it to a BIRT Data Set should work.

Jason

news://news.eclipse.org/eclipse.birt wrote:
> Hi,
> Is there a way (even scripted) to show DB values in a combobox (HTML
> SELECT)?
> I plan to add script that refreshes the report with the selected value once
> selected.
> Thanks,
> Ruby
>
>
Re: Showing data set values in a combo box [message #253540 is a reply to message #253536] Mon, 27 August 2007 10:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ruby.boyarski.verix.com

But the problem is not fetching the data.
I can't find a control for combo box in the palette...

"Jason Weathersby" <jasonweathersby@alltel.net> wrote in message
news:faum71$r0h$4@build.eclipse.org...
> Ruby,
>
> Using a dynamic dataset and then tying it to a BIRT Data Set should work.
>
> Jason
>
> news://news.eclipse.org/eclipse.birt wrote:
>> Hi,
>> Is there a way (even scripted) to show DB values in a combobox (HTML
>> SELECT)?
>> I plan to add script that refreshes the report with the selected value
>> once selected.
>> Thanks,
>> Ruby
Re: Showing data set values in a combo box [message #253543 is a reply to message #253540] Mon, 27 August 2007 10:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ruby.boyarski.verix.com

Now I see that you were referring to the parameters page.
What I want to do is show a combo at the top of my report page to select a
value from a combo and then, upon user selection, show values (according to
the selection) in the lower part of the report.
Although it's like showing parameters in the same page as the report I
couldn't find a way to do so (show parameters and report on the same page)
so I thought combo with hyperlinks may be the answer... Isn't it?

"news://news.eclipse.org/eclipse.birt" <ruby.boyarski@verix.com> wrote in
message news:faumdj$toa$1@build.eclipse.org...
> But the problem is not fetching the data.
> I can't find a control for combo box in the palette...
>
> "Jason Weathersby" <jasonweathersby@alltel.net> wrote in message
> news:faum71$r0h$4@build.eclipse.org...
>> Ruby,
>>
>> Using a dynamic dataset and then tying it to a BIRT Data Set should work.
>>
>> Jason
>>
>> news://news.eclipse.org/eclipse.birt wrote:
>>> Hi,
>>> Is there a way (even scripted) to show DB values in a combobox (HTML
>>> SELECT)?
>>> I plan to add script that refreshes the report with the selected value
>>> once selected.
>>> Thanks,
>>> Ruby
>
>
Re: Showing data set values in a combo box [message #253567 is a reply to message #253543] Mon, 27 August 2007 14:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Ruby,

There may be better ways to do what you want, but here is an example
that uses a hidden table (OnCreate script) and a hidden data element to
add script to a report to rerun a report using a combo box.

Jason

<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.14"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.2.0.v20070620 Build &lt;2.2.0.v20070626-1003></property>
<property name="units">in</property>
<property name="comments">Copyright (c) 2007 &lt;&lt;Your Company
Name here>></property>
<html-property name="description">Creates a blank report with no
predefined content.</html-property>
<method name="beforeFactory"><![CDATA[myopts = new Array();
ii=0;]]></method>
<text-property name="displayName">Blank Report</text-property>
<property name="iconFile">/templates/blank_report.gif</property>
<parameters>
<scalar-parameter name="ordern" id="60">
<property name="valueType">static</property>
<property name="dataType">integer</property>
<property name="isRequired">false</property>
<property name="controlType">text-box</property>
<property name="defaultValue">10101</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
</parameters>
<data-sources>
<oda-data-source
extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
id="6">
<text-property name="displayName"></text-property>
<property
name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
<property name="odaURL">jdbc:classicmodels:sampledb</property>
<property name="odaUser">ClassicModels</property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
name="Data Set" id="7">
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="dataType">integer</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="nativeName">ORDERNUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
</list-property>
<property name="queryText">select ordernumber
from orderdetails</property>
</oda-data-set>
<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
name="orderdetails" id="22">
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="parameters">
<structure>
<property name="name">param_1</property>
<property name="paramName">ordern</property>
<property name="nativeName"></property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
<property name="position">1</property>
<expression name="defaultValue">10101</expression>
<property name="isOptional">false</property>
<property name="isInput">true</property>
<property name="isOutput">false</property>
</structure>
</list-property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="nativeName">ORDERNUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="nativeName">PRODUCTCODE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="nativeName">QUANTITYORDERED</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="nativeName">PRICEEACH</property>
<property name="dataType">float</property>
<property name="nativeDataType">8</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="nativeName">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">5</property>
</structure>
</list-property>
<property name="queryText">select *
from orderdetails
where ordernumber = ?</property>
<xml-property name="designerValues"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
<model:DesignValues
xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
<Version>1.0</Version>
<design:DataSetParameters>
<design:parameterDefinitions>
<design:inOutMode>In</design:inOutMode>
<design:attributes>
<design:name></design:name>
<design:position>1</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:nullability>Unknown</design:nullability>
<design:uiHints/>
</design:attributes>
<design:inputAttributes>
<design:elementAttributes>
<design:defaultScalarValue>10101</design:defaultScalarValue >
<design:optional>false</design:optional>
<design:masksValue>false</design:masksValue>
<design:uiHints>
<design:promptStyle>TextField</design:promptStyle>
</design:uiHints>
</design:elementAttributes>
</design:inputAttributes>
</design:parameterDefinitions>
</design:DataSetParameters>
<design:ResultSets derivedMetaData="true">
<design:resultSetDefinitions>
<design:resultSetColumns>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ORDERNUMBER</design:name>
<design:position>1</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>ORDERNUMBER</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>PRODUCTCODE</design:name>
<design:position>2</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>PRODUCTCODE</design:label>
<design:formattingHints>
<design:displaySize>15</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>QUANTITYORDERED</design:name>
<design:position>3</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>QUANTITYORDERED</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>PRICEEACH</design:name>
<design:position>4</design:position>
<design:nativeDataTypeCode>8</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>PRICEEACH</design:label>
<design:formattingHints>
<design:displaySize>22</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ORDERLINENUMBER</design:name>
<design:position>5</design:position>
<design:nativeDataTypeCode>5</design:nativeDataTypeCode>
<design:precision>5</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>ORDERLINENUMBER</design:label>
<design:formattingHints>
<design:displaySize>6</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
</design:resultSetColumns>
</design:resultSetDefinitions>
</design:ResultSets>
</model:DesignValues>]]></xml-property>
</oda-data-set>
</data-sets>
<styles>
<style name="crosstab" id="4">
<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-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="detail" id="57">
<property name="backgroundColor">#BACAE2</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="headerfooter" id="58">
<property name="backgroundColor">#004080</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
</style>
<style name="groupheader" id="59">
<property name="backgroundColor">#0080FF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</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>
<table id="9">
<property name="width">100%</property>
<property name="dataSet">Data Set</property>
<list-property name="visibility">
<structure>
<property name="format">all</property>
<expression name="valueExpr">true</expression>
</structure>
</list-property>
<list-property name="boundDataColumns">
<structure>
<property name="name">ORDERNUMBER</property>
<expression
name="expression">dataSetRow["ORDERNUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
</list-property>
<column id="16"/>
<header>
<row id="10">
<cell id="11">
<label id="17">
<text-property
name="text">ORDERNUMBER</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="12">
<method name="onCreate"><![CDATA[myopts[ii] =
this.getRowData().getColumnValue(0);
ii++;]]></method>
<cell id="13">
<data id="18">
<property
name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="14">
<cell id="15"/>
</row>
</footer>
</table>
<data id="21">
<list-property name="visibility">
<structure>
<property name="format">all</property>
<expression name="valueExpr">true</expression>
</structure>
</list-property>
<list-property name="boundDataColumns">
<structure>
<property name="name">Column Binding</property>
<expression name="expression">"test";</expression>
<property name="dataType">any</property>
</structure>
</list-property>
<method name="onCreate"><![CDATA[ss = "";
for( i=0; i < myopts.length; i++ ){
ss = ss + "sel1.options[" + i + "] = new Option( '" + myopts[i] + "', '"
+ myopts[i] + "');";
}]]></method>
<property name="resultSetColumn">Column Binding</property>
</data>
<text id="19">
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<html>



<form name='frm'>
<select name='sel'>
<option></option>
</select>
<INPUT Type="BUTTON" Value="Refresh" onClick="reloadPage(this.form)">
</form>
</html>
<script language="javascript">



function reloadPage(form) {
var sel1 = document.frm.sel;
//alert("Reload Page");
var temp = new String(location.href);
var targetURL = new String();

if(temp.indexOf("__overwrite=") != -1 ){
targetURL = temp.substring(0, temp.indexOf("&__overwrite") -1);
}else{
targetURL = temp;
}

targetURL += "&__overwrite=true";
targetURL += "&ordern=" + form.sel.value;



//alert( targetURL );

//window.location.href = targetURL;
document.location.replace(targetURL);


}

var sel1 = document.frm.sel;



<VALUE-OF>ss;</VALUE-OF>
</script>]]></text-property>
</text>
<table id="23">
<property name="width">100%</property>
<property name="dataSet">orderdetails</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">ORDERNUMBER</property>
<expression
name="expression">dataSetRow["ORDERNUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRODUCTCODE</property>
<expression
name="expression">dataSetRow["PRODUCTCODE"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">QUANTITYORDERED</property>
<expression
name="expression">dataSetRow["QUANTITYORDERED"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRICEEACH</property>
<expression
name="expression">dataSetRow["PRICEEACH"]</expression>
<property name="dataType">float</property>
</structure>
<structure>
<property name="name">ORDERLINENUMBER</property>
<expression
name="expression">dataSetRow["ORDERLINENUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
</list-property>
<column id="52"/>
<column id="53"/>
<column id="54"/>
<column id="55"/>
<column id="56"/>
<header>
<row id="24">
<property name="style">headerfooter</property>
<cell id="25">
<label id="26">
<text-property
name="text">ORDERNUMBER</text-property>
</label>
</cell>
<cell id="27">
<label id="28">
<text-property
name="text">PRODUCTCODE</text-property>
</label>
</cell>
<cell id="29">
<label id="30">
<text-property
name="text">QUANTITYORDERED</text-property>
</label>
</cell>
<cell id="31">
<label id="32">
<text-property
name="text">PRICEEACH</text-property>
</label>
</cell>
<cell id="33">
<label id="34">
<text-property
name="text">ORDERLINENUMBER</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="35">
<property name="style">detail</property>
<cell id="36">
<data id="37">
<property
name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
<cell id="38">
<data id="39">
<property
name="resultSetColumn">PRODUCTCODE</property>
</data>
</cell>
<cell id="40">
<data id="41">
<property
name="resultSetColumn">QUANTITYORDERED</property>
</data>
</cell>
<cell id="42">
<data id="43">
<property
name="resultSetColumn">PRICEEACH</property>
</data>
</cell>
<cell id="44">
<data id="45">
<property
name="resultSetColumn">ORDERLINENUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="46">
<property name="style">headerfooter</property>
<cell id="47"/>
<cell id="48"/>
<cell id="49"/>
<cell id="50"/>
<cell id="51"/>
</row>
</footer>
</table>
</body>
</report>


news://news.eclipse.org/eclipse.birt wrote:
> Now I see that you were referring to the parameters page.
> What I want to do is show a combo at the top of my report page to select a
> value from a combo and then, upon user selection, show values (according to
> the selection) in the lower part of the report.
> Although it's like showing parameters in the same page as the report I
> couldn't find a way to do so (show parameters and report on the same page)
> so I thought combo with hyperlinks may be the answer... Isn't it?
>
> "news://news.eclipse.org/eclipse.birt" <ruby.boyarski@verix.com> wrote in
> message news:faumdj$toa$1@build.eclipse.org...
>> But the problem is not fetching the data.
>> I can't find a control for combo box in the palette...
>>
>> "Jason Weathersby" <jasonweathersby@alltel.net> wrote in message
>> news:faum71$r0h$4@build.eclipse.org...
>>> Ruby,
>>>
>>> Using a dynamic dataset and then tying it to a BIRT Data Set should work.
>>>
>>> Jason
>>>
>>> news://news.eclipse.org/eclipse.birt wrote:
>>>> Hi,
>>>> Is there a way (even scripted) to show DB values in a combobox (HTML
>>>> SELECT)?
>>>> I plan to add script that refreshes the report with the selected value
>>>> once selected.
>>>> Thanks,
>>>> Ruby
>>
>
>
Re: Showing data set values in a combo box [message #253637 is a reply to message #253567] Tue, 28 August 2007 02:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ruby.boyarski.verix.com

Thanks for the example! It helps a lot.
I have a problem though. When running in the "preview" or "View report as
HTML" it works well.
But, it doesn't work well when running with "View report in Web Viewer" or
when publishing it to the iServer.
The script code doesn't run (everthing else runs well) and thus the combo is
not populated. Any idea why that is and how to solve it?
Cheers,
Ruby

"Jason Weathersby" <jasonweathersby@alltel.net> wrote in message
news:fav5lf$49i$1@build.eclipse.org...
> Ruby,
>
> There may be better ways to do what you want, but here is an example that
> uses a hidden table (OnCreate script) and a hidden data element to add
> script to a report to rerun a report using a combo box.
>
> Jason
>
> <?xml version="1.0" encoding="UTF-8"?>
> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.14"
> id="1">
> <property name="createdBy">Eclipse BIRT Designer Version
> 2.2.0.v20070620 Build &lt;2.2.0.v20070626-1003></property>
> <property name="units">in</property>
> <property name="comments">Copyright (c) 2007 &lt;&lt;Your Company Name
> here>></property>
> <html-property name="description">Creates a blank report with no
> predefined content.</html-property>
> <method name="beforeFactory"><![CDATA[myopts = new Array();
> ii=0;]]></method>
> <text-property name="displayName">Blank Report</text-property>
> <property name="iconFile">/templates/blank_report.gif</property>
> <parameters>
> <scalar-parameter name="ordern" id="60">
> <property name="valueType">static</property>
> <property name="dataType">integer</property>
> <property name="isRequired">false</property>
> <property name="controlType">text-box</property>
> <property name="defaultValue">10101</property>
> <structure name="format">
> <property name="category">Unformatted</property>
> </structure>
> </scalar-parameter>
> </parameters>
> <data-sources>
> <oda-data-source
> extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
> id="6">
> <text-property name="displayName"></text-property>
> <property
> name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
> <property name="odaURL">jdbc:classicmodels:sampledb</property>
> <property name="odaUser">ClassicModels</property>
> </oda-data-source>
> </data-sources>
> <data-sets>
> <oda-data-set
> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
> name="Data Set" id="7">
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">Data Source</property>
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="nativeName">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> </list-property>
> <property name="queryText">select ordernumber
> from orderdetails</property>
> </oda-data-set>
> <oda-data-set
> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
> name="orderdetails" id="22">
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">PRODUCTCODE</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">QUANTITYORDERED</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">PRICEEACH</property>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">ORDERLINENUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">Data Source</property>
> <list-property name="parameters">
> <structure>
> <property name="name">param_1</property>
> <property name="paramName">ordern</property>
> <property name="nativeName"></property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> <property name="position">1</property>
> <expression name="defaultValue">10101</expression>
> <property name="isOptional">false</property>
> <property name="isInput">true</property>
> <property name="isOutput">false</property>
> </structure>
> </list-property>
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="nativeName">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">PRODUCTCODE</property>
> <property name="nativeName">PRODUCTCODE</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">QUANTITYORDERED</property>
> <property name="nativeName">QUANTITYORDERED</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">PRICEEACH</property>
> <property name="nativeName">PRICEEACH</property>
> <property name="dataType">float</property>
> <property name="nativeDataType">8</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">ORDERLINENUMBER</property>
> <property name="nativeName">ORDERLINENUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">5</property>
> </structure>
> </list-property>
> <property name="queryText">select *
> from orderdetails
> where ordernumber = ?</property>
> <xml-property name="designerValues"><![CDATA[<?xml
> version="1.0" encoding="UTF-8"?>
> <model:DesignValues
> xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
> xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
> <Version>1.0</Version>
> <design:DataSetParameters>
> <design:parameterDefinitions>
> <design:inOutMode>In</design:inOutMode>
> <design:attributes>
> <design:name></design:name>
> <design:position>1</design:position>
> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
> <design:nullability>Unknown</design:nullability>
> <design:uiHints/>
> </design:attributes>
> <design:inputAttributes>
> <design:elementAttributes>
> <design:defaultScalarValue>10101</design:defaultScalarValue >
> <design:optional>false</design:optional>
> <design:masksValue>false</design:masksValue>
> <design:uiHints>
> <design:promptStyle>TextField</design:promptStyle>
> </design:uiHints>
> </design:elementAttributes>
> </design:inputAttributes>
> </design:parameterDefinitions>
> </design:DataSetParameters>
> <design:ResultSets derivedMetaData="true">
> <design:resultSetDefinitions>
> <design:resultSetColumns>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>ORDERNUMBER</design:name>
> <design:position>1</design:position>
> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
> <design:precision>10</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> </design:attributes>
> <design:usageHints>
> <design:label>ORDERNUMBER</design:label>
> <design:formattingHints>
> <design:displaySize>11</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>PRODUCTCODE</design:name>
> <design:position>2</design:position>
> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
> <design:precision>15</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> </design:attributes>
> <design:usageHints>
> <design:label>PRODUCTCODE</design:label>
> <design:formattingHints>
> <design:displaySize>15</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>QUANTITYORDERED</design:name>
> <design:position>3</design:position>
> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
> <design:precision>10</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> </design:attributes>
> <design:usageHints>
> <design:label>QUANTITYORDERED</design:label>
> <design:formattingHints>
> <design:displaySize>11</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>PRICEEACH</design:name>
> <design:position>4</design:position>
> <design:nativeDataTypeCode>8</design:nativeDataTypeCode>
> <design:precision>15</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> </design:attributes>
> <design:usageHints>
> <design:label>PRICEEACH</design:label>
> <design:formattingHints>
> <design:displaySize>22</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>ORDERLINENUMBER</design:name>
> <design:position>5</design:position>
> <design:nativeDataTypeCode>5</design:nativeDataTypeCode>
> <design:precision>5</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> </design:attributes>
> <design:usageHints>
> <design:label>ORDERLINENUMBER</design:label>
> <design:formattingHints>
> <design:displaySize>6</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> </design:resultSetColumns>
> </design:resultSetDefinitions>
> </design:ResultSets>
> </model:DesignValues>]]></xml-property>
> </oda-data-set>
> </data-sets>
> <styles>
> <style name="crosstab" id="4">
> <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-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="detail" id="57">
> <property name="backgroundColor">#BACAE2</property>
> <property name="fontFamily">"Arial"</property>
> <property name="fontSize">small</property>
> <property name="paddingTop">0px</property>
> <property name="paddingLeft">0px</property>
> <property name="paddingBottom">0px</property>
> <property name="paddingRight">0px</property>
> </style>
> <style name="headerfooter" id="58">
> <property name="backgroundColor">#004080</property>
> <property name="fontFamily">"Arial"</property>
> <property name="fontSize">small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFFF</property>
> </style>
> <style name="groupheader" id="59">
> <property name="backgroundColor">#0080FF</property>
> <property name="fontFamily">"Arial"</property>
> <property name="fontSize">small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFFF</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>
> <table id="9">
> <property name="width">100%</property>
> <property name="dataSet">Data Set</property>
> <list-property name="visibility">
> <structure>
> <property name="format">all</property>
> <expression name="valueExpr">true</expression>
> </structure>
> </list-property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">ORDERNUMBER</property>
> <expression
> name="expression">dataSetRow["ORDERNUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> <column id="16"/>
> <header>
> <row id="10">
> <cell id="11">
> <label id="17">
> <text-property
> name="text">ORDERNUMBER</text-property>
> </label>
> </cell>
> </row>
> </header>
> <detail>
> <row id="12">
> <method name="onCreate"><![CDATA[myopts[ii] =
> this.getRowData().getColumnValue(0);
> ii++;]]></method>
> <cell id="13">
> <data id="18">
> <property
> name="resultSetColumn">ORDERNUMBER</property>
> </data>
> </cell>
> </row>
> </detail>
> <footer>
> <row id="14">
> <cell id="15"/>
> </row>
> </footer>
> </table>
> <data id="21">
> <list-property name="visibility">
> <structure>
> <property name="format">all</property>
> <expression name="valueExpr">true</expression>
> </structure>
> </list-property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">Column Binding</property>
> <expression name="expression">"test";</expression>
> <property name="dataType">any</property>
> </structure>
> </list-property>
> <method name="onCreate"><![CDATA[ss = "";
> for( i=0; i < myopts.length; i++ ){
> ss = ss + "sel1.options[" + i + "] = new Option( '" + myopts[i] + "', '" +
> myopts[i] + "');";
> }]]></method>
> <property name="resultSetColumn">Column Binding</property>
> </data>
> <text id="19">
> <property name="contentType">html</property>
> <text-property name="content"><![CDATA[<html>
>
>
>
> <form name='frm'>
> <select name='sel'>
> <option></option>
> </select>
> <INPUT Type="BUTTON" Value="Refresh" onClick="reloadPage(this.form)">
> </form>
> </html>
> <script language="javascript">
>
>
>
> function reloadPage(form) {
> var sel1 = document.frm.sel;
> //alert("Reload Page");
> var temp = new String(location.href);
> var targetURL = new String();
>
> if(temp.indexOf("__overwrite=") != -1 ){
> targetURL = temp.substring(0, temp.indexOf("&__overwrite") -1);
> }else{
> targetURL = temp;
> }
>
> targetURL += "&__overwrite=true";
> targetURL += "&ordern=" + form.sel.value;
>
>
>
> //alert( targetURL );
> //window.location.href = targetURL;
> document.location.replace(targetURL);
>
>
> }
>
> var sel1 = document.frm.sel;
>
>
>
> <VALUE-OF>ss;</VALUE-OF>
> </script>]]></text-property>
> </text>
> <table id="23">
> <property name="width">100%</property>
> <property name="dataSet">orderdetails</property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">ORDERNUMBER</property>
> <expression
> name="expression">dataSetRow["ORDERNUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="name">PRODUCTCODE</property>
> <expression
> name="expression">dataSetRow["PRODUCTCODE"]</expression >
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="name">QUANTITYORDERED</property>
> <expression
> name="expression">dataSetRow["QUANTITYORDERED"]</expression >
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="name">PRICEEACH</property>
> <expression
> name="expression">dataSetRow["PRICEEACH"]</expression>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="name">ORDERLINENUMBER</property>
> <expression
> name="expression">dataSetRow["ORDERLINENUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> <column id="52"/>
> <column id="53"/>
> <column id="54"/>
> <column id="55"/>
> <column id="56"/>
> <header>
> <row id="24">
> <property name="style">headerfooter</property>
> <cell id="25">
> <label id="26">
> <text-property
> name="text">ORDERNUMBER</text-property>
> </label>
> </cell>
> <cell id="27">
> <label id="28">
> <text-property
> name="text">PRODUCTCODE</text-property>
> </label>
> </cell>
> <cell id="29">
> <label id="30">
> <text-property
> name="text">QUANTITYORDERED</text-property>
> </label>
> </cell>
> <cell id="31">
> <label id="32">
> <text-property
> name="text">PRICEEACH</text-property>
> </label>
> </cell>
> <cell id="33">
> <label id="34">
> <text-property
> name="text">ORDERLINENUMBER</text-property>
> </label>
> </cell>
> </row>
> </header>
> <detail>
> <row id="35">
> <property name="style">detail</property>
> <cell id="36">
> <data id="37">
> <property
> name="resultSetColumn">ORDERNUMBER</property>
> </data>
> </cell>
> <cell id="38">
> <data id="39">
> <property
> name="resultSetColumn">PRODUCTCODE</property>
> </data>
> </cell>
> <cell id="40">
> <data id="41">
> <property
> name="resultSetColumn">QUANTITYORDERED</property>
> </data>
> </cell>
> <cell id="42">
> <data id="43">
> <property
> name="resultSetColumn">PRICEEACH</property>
> </data>
> </cell>
> <cell id="44">
> <data id="45">
> <property
> name="resultSetColumn">ORDERLINENUMBER</property>
> </data>
> </cell>
> </row>
> </detail>
> <footer>
> <row id="46">
> <property name="style">headerfooter</property>
> <cell id="47"/>
> <cell id="48"/>
> <cell id="49"/>
> <cell id="50"/>
> <cell id="51"/>
> </row>
> </footer>
> </table>
> </body>
> </report>
>
>
> news://news.eclipse.org/eclipse.birt wrote:
>> Now I see that you were referring to the parameters page.
>> What I want to do is show a combo at the top of my report page to select
>> a value from a combo and then, upon user selection, show values
>> (according to the selection) in the lower part of the report.
>> Although it's like showing parameters in the same page as the report I
>> couldn't find a way to do so (show parameters and report on the same
>> page) so I thought combo with hyperlinks may be the answer... Isn't it?
>>
>> "news://news.eclipse.org/eclipse.birt" <ruby.boyarski@verix.com> wrote in
>> message news:faumdj$toa$1@build.eclipse.org...
>>> But the problem is not fetching the data.
>>> I can't find a control for combo box in the palette...
>>>
>>> "Jason Weathersby" <jasonweathersby@alltel.net> wrote in message
>>> news:faum71$r0h$4@build.eclipse.org...
>>>> Ruby,
>>>>
>>>> Using a dynamic dataset and then tying it to a BIRT Data Set should
>>>> work.
>>>>
>>>> Jason
>>>>
>>>> news://news.eclipse.org/eclipse.birt wrote:
>>>>> Hi,
>>>>> Is there a way (even scripted) to show DB values in a combobox (HTML
>>>>> SELECT)?
>>>>> I plan to add script that refreshes the report with the selected value
>>>>> once selected.
>>>>> Thanks,
>>>>> Ruby
>>>
>>
Re: Showing data set values in a combo box [message #253710 is a reply to message #253637] Tue, 28 August 2007 13:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Ruby,

Try this example. I think it will suit your needs and is much simpler
as well.

Jason

<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.7"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.1.3.v20070705-1847 Build &lt;20070705-1847></property>
<property name="units">in</property>
<property name="comments">Copyright (c) 2006 &lt;&lt;Your Company
Name here>></property>
<method name="beforeFactory"><![CDATA[scriptstring = "";]]></method>
<parameters>
<scalar-parameter name="ordernmbr" id="19">
<property name="valueType">static</property>
<property name="dataType">string</property>
<property name="concealValue">false</property>
<property name="allowBlank">true</property>
<property name="allowNull">true</property>
<property name="controlType">text-box</property>
<property name="defaultValue">10101</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
</parameters>
<data-sources>
<oda-data-source
extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
id="4">
<text-property name="displayName"></text-property>
<property
name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
<property name="odaURL">jdbc:classicmodels:sampledb</property>
<property name="odaUser">ClassicModels</property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
name="Data Set" id="5">
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="dataType">integer</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="nativeName">ORDERNUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
</list-property>
<property name="queryText">select distinct ordernumber
from orderdetails</property>
</oda-data-set>
<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
name="orderdetails" id="6">
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="parameters">
<structure>
<property name="name">param_1</property>
<property name="paramName">ordernmbr</property>
<property name="nativeName"></property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
<property name="position">1</property>
<property name="isOptional">true</property>
<property name="isInput">true</property>
</structure>
</list-property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="nativeName">ORDERNUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="nativeName">PRODUCTCODE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="nativeName">QUANTITYORDERED</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="nativeName">PRICEEACH</property>
<property name="dataType">float</property>
<property name="nativeDataType">8</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="nativeName">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">5</property>
</structure>
</list-property>
<property name="queryText">select *
from orderdetails
where ordernumber = ?</property>
<xml-property name="designerValues"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
<model:DesignValues
xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
<Version>1.0</Version>
<design:DataSetParameters>
<design:parameterDefinitions>
<design:inOutMode>In</design:inOutMode>
<design:attributes>
<design:name></design:name>
<design:position>1</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:nullability>Unknown</design:nullability>
<design:uiHints/>
</design:attributes>
<design:inputAttributes>
<design:elementAttributes>
<design:defaultScalarValue>10101</design:defaultScalarValue >
<design:optional>true</design:optional>
<design:masksValue>false</design:masksValue>
<design:uiHints>
<design:promptStyle>TextField</design:promptStyle>
</design:uiHints>
</design:elementAttributes>
</design:inputAttributes>
</design:parameterDefinitions>
</design:DataSetParameters>
</model:DesignValues>]]></xml-property>
</oda-data-set>
</data-sets>
<styles>
<style name="detail" id="54">
<property name="backgroundColor">#BACAE2</property>
<property name="fontFamily">Arial</property>
<property name="fontSize">small</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="headerfooter" id="55">
<property name="backgroundColor">#004080</property>
<property name="fontFamily">Arial</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
</style>
<style name="groupheader" id="56">
<property name="backgroundColor">#0080FF</property>
<property name="fontFamily">Arial</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</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>
<table id="7">
<property name="width">100%</property>
<property name="dataSet">Data Set</property>
<list-property name="visibility">
<structure>
<property name="format">all</property>
<expression name="valueExpr">true</expression>
</structure>
</list-property>
<list-property name="boundDataColumns">
<structure>
<property name="name">ORDERNUMBER</property>
<expression
name="expression">dataSetRow["ORDERNUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
</list-property>
<column id="16"/>
<header>
<row id="8">
<cell id="9">
<label id="10">
<text-property
name="text">ORDERNUMBER</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="11">
<method name="onCreate"><![CDATA[var colval =
this.getRowData().getColumnValue(0);
scriptstring= scriptstring + "<option value='" + colval +
"'>"+colval+"</option>";]]></method>
<cell id="12">
<data id="13">
<property
name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="14">
<cell id="15"/>
</row>
</footer>
</table>
<text id="17">
<property name="contentType">html</property>
<text-property name="content"><![CDATA[
<form name='frm' action="">
<script language="javascript">
function rp(form) {
alert("Reload Page");
}

function reloadPage(form) {
var sel1 = form.ordernmbr;
//alert("Reload Page");
var temp = new String(location.href);
var targetURL = new String();
var xyz = -1;

xyz=temp.indexOf("__overwrite=")

if( xyz != -1 ){
//alert( xyz );
targetURL = temp.substring(0, xyz-1);
//alert(temp.substring(0, xyz-1));
}else{
targetURL = temp;
}

targetURL += "&__overwrite=true";
targetURL += "&ordernmbr=" + form.ordernmbr.value;



//alert( targetURL );

//window.location.href = targetURL;
document.location.replace(targetURL);


}
</script>


<select name='ordernmbr'>
<VALUE-OF format="HTML">scriptstring;</VALUE-OF>
</select>
<INPUT Type="BUTTON" name="mybutton" Value="Refresh"
onClick='reloadPage(this.form)'></INPUT>
</form>]]></text-property>
</text>
<table id="20">
<property name="width">100%</property>
<property name="dataSet">orderdetails</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">ORDERNUMBER</property>
<expression
name="expression">dataSetRow["ORDERNUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRODUCTCODE</property>
<expression
name="expression">dataSetRow["PRODUCTCODE"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">QUANTITYORDERED</property>
<expression
name="expression">dataSetRow["QUANTITYORDERED"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRICEEACH</property>
<expression
name="expression">dataSetRow["PRICEEACH"]</expression>
<property name="dataType">float</property>
</structure>
<structure>
<property name="name">ORDERLINENUMBER</property>
<expression
name="expression">dataSetRow["ORDERLINENUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
</list-property>
<column id="49"/>
<column id="50"/>
<column id="51"/>
<column id="52"/>
<column id="53"/>
<header>
<row id="21">
<property name="style">headerfooter</property>
<cell id="22">
<label id="23">
<text-property
name="text">ORDERNUMBER</text-property>
</label>
</cell>
<cell id="24">
<label id="25">
<text-property
name="text">PRODUCTCODE</text-property>
</label>
</cell>
<cell id="26">
<label id="27">
<text-property
name="text">QUANTITYORDERED</text-property>
</label>
</cell>
<cell id="28">
<label id="29">
<text-property
name="text">PRICEEACH</text-property>
</label>
</cell>
<cell id="30">
<label id="31">
<text-property
name="text">ORDERLINENUMBER</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="32">
<property name="style">detail</property>
<cell id="33">
<data id="34">
<property
name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
<cell id="35">
<data id="36">
<property
name="resultSetColumn">PRODUCTCODE</property>
</data>
</cell>
<cell id="37">
<data id="38">
<property
name="resultSetColumn">QUANTITYORDERED</property>
</data>
</cell>
<cell id="39">
<data id="40">
<property
name="resultSetColumn">PRICEEACH</property>
</data>
</cell>
<cell id="41">
<data id="42">
<property
name="resultSetColumn">ORDERLINENUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="43">
<property name="style">headerfooter</property>
<cell id="44"/>
<cell id="45"/>
<cell id="46"/>
<cell id="47"/>
<cell id="48"/>
</row>
</footer>
</table>
</body>
</report>


news://news.eclipse.org/eclipse.birt wrote:
> Thanks for the example! It helps a lot.
> I have a problem though. When running in the "preview" or "View report as
> HTML" it works well.
> But, it doesn't work well when running with "View report in Web Viewer" or
> when publishing it to the iServer.
> The script code doesn't run (everthing else runs well) and thus the combo is
> not populated. Any idea why that is and how to solve it?
> Cheers,
> Ruby
>
> "Jason Weathersby" <jasonweathersby@alltel.net> wrote in message
> news:fav5lf$49i$1@build.eclipse.org...
>> Ruby,
>>
>> There may be better ways to do what you want, but here is an example that
>> uses a hidden table (OnCreate script) and a hidden data element to add
>> script to a report to rerun a report using a combo box.
>>
>> Jason
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.14"
>> id="1">
>> <property name="createdBy">Eclipse BIRT Designer Version
>> 2.2.0.v20070620 Build &lt;2.2.0.v20070626-1003></property>
>> <property name="units">in</property>
>> <property name="comments">Copyright (c) 2007 &lt;&lt;Your Company Name
>> here>></property>
>> <html-property name="description">Creates a blank report with no
>> predefined content.</html-property>
>> <method name="beforeFactory"><![CDATA[myopts = new Array();
>> ii=0;]]></method>
>> <text-property name="displayName">Blank Report</text-property>
>> <property name="iconFile">/templates/blank_report.gif</property>
>> <parameters>
>> <scalar-parameter name="ordern" id="60">
>> <property name="valueType">static</property>
>> <property name="dataType">integer</property>
>> <property name="isRequired">false</property>
>> <property name="controlType">text-box</property>
>> <property name="defaultValue">10101</property>
>> <structure name="format">
>> <property name="category">Unformatted</property>
>> </structure>
>> </scalar-parameter>
>> </parameters>
>> <data-sources>
>> <oda-data-source
>> extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
>> id="6">
>> <text-property name="displayName"></text-property>
>> <property
>> name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
>> <property name="odaURL">jdbc:classicmodels:sampledb</property>
>> <property name="odaUser">ClassicModels</property>
>> </oda-data-source>
>> </data-sources>
>> <data-sets>
>> <oda-data-set
>> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
>> name="Data Set" id="7">
>> <structure name="cachedMetaData">
>> <list-property name="resultSet">
>> <structure>
>> <property name="position">1</property>
>> <property name="name">ORDERNUMBER</property>
>> <property name="dataType">integer</property>
>> </structure>
>> </list-property>
>> </structure>
>> <property name="dataSource">Data Source</property>
>> <list-property name="resultSet">
>> <structure>
>> <property name="position">1</property>
>> <property name="name">ORDERNUMBER</property>
>> <property name="nativeName">ORDERNUMBER</property>
>> <property name="dataType">integer</property>
>> <property name="nativeDataType">4</property>
>> </structure>
>> </list-property>
>> <property name="queryText">select ordernumber
>> from orderdetails</property>
>> </oda-data-set>
>> <oda-data-set
>> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
>> name="orderdetails" id="22">
>> <structure name="cachedMetaData">
>> <list-property name="resultSet">
>> <structure>
>> <property name="position">1</property>
>> <property name="name">ORDERNUMBER</property>
>> <property name="dataType">integer</property>
>> </structure>
>> <structure>
>> <property name="position">2</property>
>> <property name="name">PRODUCTCODE</property>
>> <property name="dataType">string</property>
>> </structure>
>> <structure>
>> <property name="position">3</property>
>> <property name="name">QUANTITYORDERED</property>
>> <property name="dataType">integer</property>
>> </structure>
>> <structure>
>> <property name="position">4</property>
>> <property name="name">PRICEEACH</property>
>> <property name="dataType">float</property>
>> </structure>
>> <structure>
>> <property name="position">5</property>
>> <property name="name">ORDERLINENUMBER</property>
>> <property name="dataType">integer</property>
>> </structure>
>> </list-property>
>> </structure>
>> <property name="dataSource">Data Source</property>
>> <list-property name="parameters">
>> <structure>
>> <property name="name">param_1</property>
>> <property name="paramName">ordern</property>
>> <property name="nativeName"></property>
>> <property name="dataType">integer</property>
>> <property name="nativeDataType">4</property>
>> <property name="position">1</property>
>> <expression name="defaultValue">10101</expression>
>> <property name="isOptional">false</property>
>> <property name="isInput">true</property>
>> <property name="isOutput">false</property>
>> </structure>
>> </list-property>
>> <list-property name="resultSet">
>> <structure>
>> <property name="position">1</property>
>> <property name="name">ORDERNUMBER</property>
>> <property name="nativeName">ORDERNUMBER</property>
>> <property name="dataType">integer</property>
>> <property name="nativeDataType">4</property>
>> </structure>
>> <structure>
>> <property name="position">2</property>
>> <property name="name">PRODUCTCODE</property>
>> <property name="nativeName">PRODUCTCODE</property>
>> <property name="dataType">string</property>
>> <property name="nativeDataType">12</property>
>> </structure>
>> <structure>
>> <property name="position">3</property>
>> <property name="name">QUANTITYORDERED</property>
>> <property name="nativeName">QUANTITYORDERED</property>
>> <property name="dataType">integer</property>
>> <property name="nativeDataType">4</property>
>> </structure>
>> <structure>
>> <property name="position">4</property>
>> <property name="name">PRICEEACH</property>
>> <property name="nativeName">PRICEEACH</property>
>> <property name="dataType">float</property>
>> <property name="nativeDataType">8</property>
>> </structure>
>> <structure>
>> <property name="position">5</property>
>> <property name="name">ORDERLINENUMBER</property>
>> <property name="nativeName">ORDERLINENUMBER</property>
>> <property name="dataType">integer</property>
>> <property name="nativeDataType">5</property>
>> </structure>
>> </list-property>
>> <property name="queryText">select *
>> from orderdetails
>> where ordernumber = ?</property>
>> <xml-property name="designerValues"><![CDATA[<?xml
>> version="1.0" encoding="UTF-8"?>
>> <model:DesignValues
>> xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
>> xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
>> <Version>1.0</Version>
>> <design:DataSetParameters>
>> <design:parameterDefinitions>
>> <design:inOutMode>In</design:inOutMode>
>> <design:attributes>
>> <design:name></design:name>
>> <design:position>1</design:position>
>> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
>> <design:nullability>Unknown</design:nullability>
>> <design:uiHints/>
>> </design:attributes>
>> <design:inputAttributes>
>> <design:elementAttributes>
>> <design:defaultScalarValue>10101</design:defaultScalarValue >
>> <design:optional>false</design:optional>
>> <design:masksValue>false</design:masksValue>
>> <design:uiHints>
>> <design:promptStyle>TextField</design:promptStyle>
>> </design:uiHints>
>> </design:elementAttributes>
>> </design:inputAttributes>
>> </design:parameterDefinitions>
>> </design:DataSetParameters>
>> <design:ResultSets derivedMetaData="true">
>> <design:resultSetDefinitions>
>> <design:resultSetColumns>
>> <design:resultColumnDefinitions>
>> <design:attributes>
>> <design:name>ORDERNUMBER</design:name>
>> <design:position>1</design:position>
>> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
>> <design:precision>10</design:precision>
>> <design:scale>0</design:scale>
>> <design:nullability>Nullable</design:nullability>
>> </design:attributes>
>> <design:usageHints>
>> <design:label>ORDERNUMBER</design:label>
>> <design:formattingHints>
>> <design:displaySize>11</design:displaySize>
>> </design:formattingHints>
>> </design:usageHints>
>> </design:resultColumnDefinitions>
>> <design:resultColumnDefinitions>
>> <design:attributes>
>> <design:name>PRODUCTCODE</design:name>
>> <design:position>2</design:position>
>> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
>> <design:precision>15</design:precision>
>> <design:scale>0</design:scale>
>> <design:nullability>Nullable</design:nullability>
>> </design:attributes>
>> <design:usageHints>
>> <design:label>PRODUCTCODE</design:label>
>> <design:formattingHints>
>> <design:displaySize>15</design:displaySize>
>> </design:formattingHints>
>> </design:usageHints>
>> </design:resultColumnDefinitions>
>> <design:resultColumnDefinitions>
>> <design:attributes>
>> <design:name>QUANTITYORDERED</design:name>
>> <design:position>3</design:position>
>> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
>> <design:precision>10</design:precision>
>> <design:scale>0</design:scale>
>> <design:nullability>Nullable</design:nullability>
>> </design:attributes>
>> <design:usageHints>
>> <design:label>QUANTITYORDERED</design:label>
>> <design:formattingHints>
>> <design:displaySize>11</design:displaySize>
>> </design:formattingHints>
>> </design:usageHints>
>> </design:resultColumnDefinitions>
>> <design:resultColumnDefinitions>
>> <design:attributes>
>> <design:name>PRICEEACH</design:name>
>> <design:position>4</design:position>
>> <design:nativeDataTypeCode>8</design:nativeDataTypeCode>
>> <design:precision>15</design:precision>
>> <design:scale>0</design:scale>
>> <design:nullability>Nullable</design:nullability>
>> </design:attributes>
>> <design:usageHints>
>> <design:label>PRICEEACH</design:label>
>> <design:formattingHints>
>> <design:displaySize>22</design:displaySize>
>> </design:formattingHints>
>> </design:usageHints>
>> </design:resultColumnDefinitions>
>> <design:resultColumnDefinitions>
>> <design:attributes>
>> <design:name>ORDERLINENUMBER</design:name>
>> <design:position>5</design:position>
>> <design:nativeDataTypeCode>5</design:nativeDataTypeCode>
>> <design:precision>5</design:precision>
>> <design:scale>0</design:scale>
>> <design:nullability>Nullable</design:nullability>
>> </design:attributes>
>> <design:usageHints>
>> <design:label>ORDERLINENUMBER</design:label>
>> <design:formattingHints>
>> <design:displaySize>6</design:displaySize>
>> </design:formattingHints>
>> </design:usageHints>
>> </design:resultColumnDefinitions>
>> </design:resultSetColumns>
>> </design:resultSetDefinitions>
>> </design:ResultSets>
>> </model:DesignValues>]]></xml-property>
>> </oda-data-set>
>> </data-sets>
>> <styles>
>> <style name="crosstab" id="4">
>> <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-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="detail" id="57">
>> <property name="backgroundColor">#BACAE2</property>
>> <property name="fontFamily">"Arial"</property>
>> <property name="fontSize">small</property>
>> <property name="paddingTop">0px</property>
>> <property name="paddingLeft">0px</property>
>> <property name="paddingBottom">0px</property>
>> <property name="paddingRight">0px</property>
>> </style>
>> <style name="headerfooter" id="58">
>> <property name="backgroundColor">#004080</property>
>> <property name="fontFamily">"Arial"</property>
>> <property name="fontSize">small</property>
>> <property name="fontWeight">bold</property>
>> <property name="color">#FFFFFF</property>
>> </style>
>> <style name="groupheader" id="59">
>> <property name="backgroundColor">#0080FF</property>
>> <property name="fontFamily">"Arial"</property>
>> <property name="fontSize">small</property>
>> <property name="fontWeight">bold</property>
>> <property name="color">#FFFFFF</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>
>> <table id="9">
>> <property name="width">100%</property>
>> <property name="dataSet">Data Set</property>
>> <list-property name="visibility">
>> <structure>
>> <property name="format">all</property>
>> <expression name="valueExpr">true</expression>
>> </structure>
>> </list-property>
>> <list-property name="boundDataColumns">
>> <structure>
>> <property name="name">ORDERNUMBER</property>
>> <expression
>> name="expression">dataSetRow["ORDERNUMBER"]</expression >
>> <property name="dataType">integer</property>
>> </structure>
>> </list-property>
>> <column id="16"/>
>> <header>
>> <row id="10">
>> <cell id="11">
>> <label id="17">
>> <text-property
>> name="text">ORDERNUMBER</text-property>
>> </label>
>> </cell>
>> </row>
>> </header>
>> <detail>
>> <row id="12">
>> <method name="onCreate"><![CDATA[myopts[ii] =
>> this.getRowData().getColumnValue(0);
>> ii++;]]></method>
>> <cell id="13">
>> <data id="18">
>> <property
>> name="resultSetColumn">ORDERNUMBER</property>
>> </data>
>> </cell>
>> </row>
>> </detail>
>> <footer>
>> <row id="14">
>> <cell id="15"/>
>> </row>
>> </footer>
>> </table>
>> <data id="21">
>> <list-property name="visibility">
>> <structure>
>> <property name="format">all</property>
>> <expression name="valueExpr">true</expression>
>> </structure>
>> </list-property>
>> <list-property name="boundDataColumns">
>> <structure>
>> <property name="name">Column Binding</property>
>> <expression name="expression">"test";</expression>
>> <property name="dataType">any</property>
>> </structure>
>> </list-property>
>> <method name="onCreate"><![CDATA[ss = "";
>> for( i=0; i < myopts.length; i++ ){
>> ss = ss + "sel1.options[" + i + "] = new Option( '" + myopts[i] + "', '" +
>> myopts[i] + "');";
>> }]]></method>
>> <property name="resultSetColumn">Column Binding</property>
>> </data>
>> <text id="19">
>> <property name="contentType">html</property>
>> <text-property name="content"><![CDATA[<html>
>>
>>
>>
>> <form name='frm'>
>> <select name='sel'>
>> <option></option>
>> </select>
>> <INPUT Type="BUTTON" Value="Refresh" onClick="reloadPage(this.form)">
>> </form>
>> </html>
>> <script language="javascript">
>>
>>
>>
>> function reloadPage(form) {
>> var sel1 = document.frm.sel;
>> //alert("Reload Page");
>> var temp = new String(location.href);
>> var targetURL = new String();
>>
>> if(temp.indexOf("__overwrite=") != -1 ){
>> targetURL = temp.substring(0, temp.indexOf("&__overwrite") -1);
>> }else{
>> targetURL = temp;
>> }
>>
>> targetURL += "&__overwrite=true";
>> targetURL += "&ordern=" + form.sel.value;
>>
>>
>>
>> //alert( targetURL );
>> //window.location.href = targetURL;
>> document.location.replace(targetURL);
>>
>>
>> }
>>
>> var sel1 = document.frm.sel;
>>
>>
>>
>> <VALUE-OF>ss;</VALUE-OF>
>> </script>]]></text-property>
>> </text>
>> <table id="23">
>> <property name="width">100%</property>
>> <property name="dataSet">orderdetails</property>
>> <list-property name="boundDataColumns">
>> <structure>
>> <property name="name">ORDERNUMBER</property>
>> <expression
>> name="expression">dataSetRow["ORDERNUMBER"]</expression >
>> <property name="dataType">integer</property>
>> </structure>
>> <structure>
>> <property name="name">PRODUCTCODE</property>
>> <expression
>> name="expression">dataSetRow["PRODUCTCODE"]</expression >
>> <property name="dataType">string</property>
>> </structure>
>> <structure>
>> <property name="name">QUANTITYORDERED</property>
>> <expression
>> name="expression">dataSetRow["QUANTITYORDERED"]</expression >
>> <property name="dataType">integer</property>
>> </structure>
>> <structure>
>> <property name="name">PRICEEACH</property>
>> <expression
>> name="expression">dataSetRow["PRICEEACH"]</expression>
>> <property name="dataType">float</property>
>> </structure>
>> <structure>
>> <property name="name">ORDERLINENUMBER</property>
>> <expression
>> name="expression">dataSetRow["ORDERLINENUMBER"]</expression >
>> <property name="dataType">integer</property>
>> </structure>
>> </list-property>
>> <column id="52"/>
>> <column id="53"/>
>> <column id="54"/>
>> <column id="55"/>
>> <column id="56"/>
>> <header>
>> <row id="24">
>> <property name="style">headerfooter</property>
>> <cell id="25">
>> <label id="26">
>> <text-property
>> name="text">ORDERNUMBER</text-property>
>> </label>
>> </cell>
>> <cell id="27">
>> <label id="28">
>> <text-property
>> name="text">PRODUCTCODE</text-property>
>> </label>
>> </cell>
>> <cell id="29">
>> <label id="30">
>> <text-property
>> name="text">QUANTITYORDERED</text-property>
>> </label>
>> </cell>
>> <cell id="31">
>> <label id="32">
>> <text-property
>> name="text">PRICEEACH</text-property>
>> </label>
>> </cell>
>> <cell id="33">
>> <label id="34">
>> <text-property
>> name="text">ORDERLINENUMBER</text-prop
Re: Showing data set values in a combo box [message #254331 is a reply to message #253710] Tue, 04 September 2007 04:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ruby.boyarski.verix.com

Still, when running the report the "Reload" button doesn't work. It seems
not to recognize the "reloadPage" method.
The combo is populated though...
Any idea?
Ruby

"Jason Weathersby" <jasonweathersby@alltel.net> wrote in message
news:fb1n5s$u6d$1@build.eclipse.org...
> Ruby,
>
> Try this example. I think it will suit your needs and is much simpler as
> well.
>
> Jason
>
> <?xml version="1.0" encoding="UTF-8"?>
> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.7"
> id="1">
> <property name="createdBy">Eclipse BIRT Designer Version
> 2.1.3.v20070705-1847 Build &lt;20070705-1847></property>
> <property name="units">in</property>
> <property name="comments">Copyright (c) 2006 &lt;&lt;Your Company Name
> here>></property>
> <method name="beforeFactory"><![CDATA[scriptstring = "";]]></method>
> <parameters>
> <scalar-parameter name="ordernmbr" id="19">
> <property name="valueType">static</property>
> <property name="dataType">string</property>
> <property name="concealValue">false</property>
> <property name="allowBlank">true</property>
> <property name="allowNull">true</property>
> <property name="controlType">text-box</property>
> <property name="defaultValue">10101</property>
> <structure name="format">
> <property name="category">Unformatted</property>
> </structure>
> </scalar-parameter>
> </parameters>
> <data-sources>
> <oda-data-source
> extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
> id="4">
> <text-property name="displayName"></text-property>
> <property
> name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
> <property name="odaURL">jdbc:classicmodels:sampledb</property>
> <property name="odaUser">ClassicModels</property>
> </oda-data-source>
> </data-sources>
> <data-sets>
> <oda-data-set
> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
> name="Data Set" id="5">
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">Data Source</property>
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="nativeName">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> </list-property>
> <property name="queryText">select distinct ordernumber
> from orderdetails</property>
> </oda-data-set>
> <oda-data-set
> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
> name="orderdetails" id="6">
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">PRODUCTCODE</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">QUANTITYORDERED</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">PRICEEACH</property>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">ORDERLINENUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">Data Source</property>
> <list-property name="parameters">
> <structure>
> <property name="name">param_1</property>
> <property name="paramName">ordernmbr</property>
> <property name="nativeName"></property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> <property name="position">1</property>
> <property name="isOptional">true</property>
> <property name="isInput">true</property>
> </structure>
> </list-property>
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="nativeName">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">PRODUCTCODE</property>
> <property name="nativeName">PRODUCTCODE</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">QUANTITYORDERED</property>
> <property name="nativeName">QUANTITYORDERED</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">PRICEEACH</property>
> <property name="nativeName">PRICEEACH</property>
> <property name="dataType">float</property>
> <property name="nativeDataType">8</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">ORDERLINENUMBER</property>
> <property name="nativeName">ORDERLINENUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">5</property>
> </structure>
> </list-property>
> <property name="queryText">select *
> from orderdetails
> where ordernumber = ?</property>
> <xml-property name="designerValues"><![CDATA[<?xml
> version="1.0" encoding="UTF-8"?>
> <model:DesignValues
> xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
> xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
> <Version>1.0</Version>
> <design:DataSetParameters>
> <design:parameterDefinitions>
> <design:inOutMode>In</design:inOutMode>
> <design:attributes>
> <design:name></design:name>
> <design:position>1</design:position>
> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
> <design:nullability>Unknown</design:nullability>
> <design:uiHints/>
> </design:attributes>
> <design:inputAttributes>
> <design:elementAttributes>
> <design:defaultScalarValue>10101</design:defaultScalarValue >
> <design:optional>true</design:optional>
> <design:masksValue>false</design:masksValue>
> <design:uiHints>
> <design:promptStyle>TextField</design:promptStyle>
> </design:uiHints>
> </design:elementAttributes>
> </design:inputAttributes>
> </design:parameterDefinitions>
> </design:DataSetParameters>
> </model:DesignValues>]]></xml-property>
> </oda-data-set>
> </data-sets>
> <styles>
> <style name="detail" id="54">
> <property name="backgroundColor">#BACAE2</property>
> <property name="fontFamily">Arial</property>
> <property name="fontSize">small</property>
> <property name="paddingTop">0px</property>
> <property name="paddingLeft">0px</property>
> <property name="paddingBottom">0px</property>
> <property name="paddingRight">0px</property>
> </style>
> <style name="headerfooter" id="55">
> <property name="backgroundColor">#004080</property>
> <property name="fontFamily">Arial</property>
> <property name="fontSize">small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFFF</property>
> </style>
> <style name="groupheader" id="56">
> <property name="backgroundColor">#0080FF</property>
> <property name="fontFamily">Arial</property>
> <property name="fontSize">small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFFF</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>
> <table id="7">
> <property name="width">100%</property>
> <property name="dataSet">Data Set</property>
> <list-property name="visibility">
> <structure>
> <property name="format">all</property>
> <expression name="valueExpr">true</expression>
> </structure>
> </list-property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">ORDERNUMBER</property>
> <expression
> name="expression">dataSetRow["ORDERNUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> <column id="16"/>
> <header>
> <row id="8">
> <cell id="9">
> <label id="10">
> <text-property
> name="text">ORDERNUMBER</text-property>
> </label>
> </cell>
> </row>
> </header>
> <detail>
> <row id="11">
> <method name="onCreate"><![CDATA[var colval =
> this.getRowData().getColumnValue(0);
> scriptstring= scriptstring + "<option value='" + colval +
> "'>"+colval+"</option>";]]></method>
> <cell id="12">
> <data id="13">
> <property
> name="resultSetColumn">ORDERNUMBER</property>
> </data>
> </cell>
> </row>
> </detail>
> <footer>
> <row id="14">
> <cell id="15"/>
> </row>
> </footer>
> </table>
> <text id="17">
> <property name="contentType">html</property>
> <text-property name="content"><![CDATA[
> <form name='frm' action="">
> <script language="javascript">
> function rp(form) {
> alert("Reload Page");
> }
>
> function reloadPage(form) {
> var sel1 = form.ordernmbr;
> //alert("Reload Page");
> var temp = new String(location.href);
> var targetURL = new String();
> var xyz = -1;
>
> xyz=temp.indexOf("__overwrite=")
>
> if( xyz != -1 ){
> //alert( xyz );
> targetURL = temp.substring(0, xyz-1);
> //alert(temp.substring(0, xyz-1));
> }else{
> targetURL = temp;
> }
>
> targetURL += "&__overwrite=true";
> targetURL += "&ordernmbr=" + form.ordernmbr.value;
>
>
>
> //alert( targetURL );
> //window.location.href = targetURL;
> document.location.replace(targetURL);
>
>
> }
> </script>
>
>
> <select name='ordernmbr'>
> <VALUE-OF format="HTML">scriptstring;</VALUE-OF>
> </select>
> <INPUT Type="BUTTON" name="mybutton" Value="Refresh"
> onClick='reloadPage(this.form)'></INPUT>
> </form>]]></text-property>
> </text>
> <table id="20">
> <property name="width">100%</property>
> <property name="dataSet">orderdetails</property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">ORDERNUMBER</property>
> <expression
> name="expression">dataSetRow["ORDERNUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="name">PRODUCTCODE</property>
> <expression
> name="expression">dataSetRow["PRODUCTCODE"]</expression >
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="name">QUANTITYORDERED</property>
> <expression
> name="expression">dataSetRow["QUANTITYORDERED"]</expression >
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="name">PRICEEACH</property>
> <expression
> name="expression">dataSetRow["PRICEEACH"]</expression>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="name">ORDERLINENUMBER</property>
> <expression
> name="expression">dataSetRow["ORDERLINENUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> <column id="49"/>
> <column id="50"/>
> <column id="51"/>
> <column id="52"/>
> <column id="53"/>
> <header>
> <row id="21">
> <property name="style">headerfooter</property>
> <cell id="22">
> <label id="23">
> <text-property
> name="text">ORDERNUMBER</text-property>
> </label>
> </cell>
> <cell id="24">
> <label id="25">
> <text-property
> name="text">PRODUCTCODE</text-property>
> </label>
> </cell>
> <cell id="26">
> <label id="27">
> <text-property
> name="text">QUANTITYORDERED</text-property>
> </label>
> </cell>
> <cell id="28">
> <label id="29">
> <text-property
> name="text">PRICEEACH</text-property>
> </label>
> </cell>
> <cell id="30">
> <label id="31">
> <text-property
> name="text">ORDERLINENUMBER</text-property>
> </label>
> </cell>
> </row>
> </header>
> <detail>
> <row id="32">
> <property name="style">detail</property>
> <cell id="33">
> <data id="34">
> <property
> name="resultSetColumn">ORDERNUMBER</property>
> </data>
> </cell>
> <cell id="35">
> <data id="36">
> <property
> name="resultSetColumn">PRODUCTCODE</property>
> </data>
> </cell>
> <cell id="37">
> <data id="38">
> <property
> name="resultSetColumn">QUANTITYORDERED</property>
> </data>
> </cell>
> <cell id="39">
> <data id="40">
> <property
> name="resultSetColumn">PRICEEACH</property>
> </data>
> </cell>
> <cell id="41">
> <data id="42">
> <property
> name="resultSetColumn">ORDERLINENUMBER</property>
> </data>
> </cell>
> </row>
> </detail>
> <footer>
> <row id="43">
> <property name="style">headerfooter</property>
> <cell id="44"/>
> <cell id="45"/>
> <cell id="46"/>
> <cell id="47"/>
> <cell id="48"/>
> </row>
> </footer>
> </table>
> </body>
> </report>
>
>
> news://news.eclipse.org/eclipse.birt wrote:
>> Thanks for the example! It helps a lot.
>> I have a problem though. When running in the "preview" or "View report as
>> HTML" it works well.
>> But, it doesn't work well when running with "View report in Web Viewer"
>> or when publishing it to the iServer.
>> The script code doesn't run (everthing else runs well) and thus the combo
>> is not populated. Any idea why that is and how to solve it?
>> Cheers,
>> Ruby
>>
>> "Jason Weathersby" <jasonweathersby@alltel.net> wrote in message
>> news:fav5lf$49i$1@build.eclipse.org...
>>> Ruby,
>>>
>>> There may be better ways to do what you want, but here is an example
>>> that uses a hidden table (OnCreate script) and a hidden data element to
>>> add script to a report to rerun a report using a combo box.
>>>
>>> Jason
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.14"
>>> id="1">
>>> <property name="createdBy">Eclipse BIRT Designer Version
>>> 2.2.0.v20070620 Build &lt;2.2.0.v20070626-1003></property>
>>> <property name="units">in</property>
>>> <property name="comments">Copyright (c) 2007 &lt;&lt;Your Company
>>> Name here>></property>
>>> <html-property name="description">Creates a blank report with no
>>> predefined content.</html-property>
>>> <method name="beforeFactory"><![CDATA[myopts = new Array();
>>> ii=0;]]></method>
>>> <text-property name="displayName">Blank Report</text-property>
>>> <property name="iconFile">/templates/blank_report.gif</property>
>>> <parameters>
>>> <scalar-parameter name="ordern" id="60">
>>> <property name="valueType">static</property>
>>> <property name="dataType">integer</property>
>>> <property name="isRequired">false</property>
>>> <property name="controlType">text-box</property>
>>> <property name="defaultValue">10101</property>
>>> <structure name="format">
>>> <property name="category">Unformatted</property>
>>> </structure>
>>> </scalar-parameter>
>>> </parameters>
>>> <data-sources>
>>> <oda-data-source
>>> extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
>>> id="6">
>>> <text-property name="displayName"></text-property>
>>> <property
>>> name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
>>> <property
>>> name="odaURL">jdbc:classicmodels:sampledb</property>
>>> <property name="odaUser">ClassicModels</property>
>>> </oda-data-source>
>>> </data-sources>
>>> <data-sets>
>>> <oda-data-set
>>> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
>>> name="Data Set" id="7">
>>> <structure name="cachedMetaData">
>>> <list-property name="resultSet">
>>> <structure>
>>> <property name="position">1</property>
>>> <property name="name">ORDERNUMBER</property>
>>> <property name="dataType">integer</property>
>>> </structure>
>>> </list-property>
>>> </structure>
>>> <property name="dataSource">Data Source</property>
>>> <list-property name="resultSet">
>>> <structure>
>>> <property name="position">1</property>
>>> <property name="name">ORDERNUMBER</property>
>>> <property name="nativeName">ORDERNUMBER</property>
>>> <property name="dataType">integer</property>
>>> <property name="nativeDataType">4</property>
>>> </structure>
>>> </list-property>
>>> <property name="queryText">select ordernumber
>>> from orderdetails</property>
>>> </oda-data-set>
>>> <oda-data-set
>>> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
>>> name="orderdetails" id="22">
>>> <structure name="cachedMetaData">
>>> <list-property name="resultSet">
>>> <structure>
>>> <property name="position">1</property>
>>> <property name="name">ORDERNUMBER</property>
>>> <property name="dataType">integer</property>
>>> </structure>
>>> <structure>
>>> <property name="position">2</property>
>>> <property name="name">PRODUCTCODE</property>
>>> <property name="dataType">string</property>
>>> </structure>
>>> <structure>
>>> <property name="position">3</property>
>>> <property name="name">QUANTITYORDERED</property>
>>> <property name="dataType">integer</property>
>>> </structure>
>>> <structure>
>>> <property name="position">4</property>
>>> <property name="name">PRICEEACH</property>
>>> <property name="dataType">float</property>
>>> </structure>
>>> <structure>
>>> <property name="position">5</property>
>>> <property name="name">ORDERLINENUMBER</property>
>>> <property name="dataType">integer</property>
>>> </structure>
>>> </list-property>
>>> </structure>
>>> <property name="dataSource">Data Source</property>
>>> <list-property name="parameters">
>>> <structure>
>>> <property name="name">param_1</property>
>>> <property name="paramName">ordern</property>
>>> <property name="nativeName"></property>
>>> <property name="dataType">integer</property>
>>> <property name="nativeDataType">4</property>
>>> <property name="position">1</property>
>>> <expression name="defaultValue">10101</expression>
>>> <property name="isOptional">false</property>
>>> <property name="isInput">true</property>
>>> <property name="isOutput">false</property>
>>> </structure>
>>> </list-property>
>>> <list-property name="resultSet">
>>> <structure>
>>> <property name="position">1</property>
>>> <property name="name">ORDERNUMBER</property>
>>> <property name="nativeName">ORDERNUMBER</property>
>>> <property name="dataType">integer</property>
>>> <property name="nativeDataType">4</property>
>>> </structure>
>>> <structure>
>>> <property name="position">2</property>
>>> <property name="name">PRODUCTCODE</property>
>>> <property name="nativeName">PRODUCTCODE</property>
>>> <property name="dataType">string</property>
>>> <property name="nativeDataType">12</property>
>>> </structure>
>>> <structure>
>>> <property name="position">3</property>
>>> <property name="name">QUANTITYORDERED</property>
>>> <property
>>> name="nativeName">QUANTITYORDERED</property>
>>> <property name="dataType">integer</property>
>>> <property name="nativeDataType">4</property>
>>> </structure>
>>> <structure>
>>> <property name="position">4</property>
>>> <property name="name">PRICEEACH</property>
>>> <property name="nativeName">PRICEEACH</property>
>>> <property name="dataType">float</property>
>>> <property name="nativeDataType">8</property>
>>> </structure>
>>> <structure>
>>> <property name="position">5</property>
>>> <property name="name">ORDERLINENUMBER</property>
>>> <property
>>> name="nativeName">ORDERLINENUMBER</property>
>>> <property name="dataType">integer</property>
>>> <property name="nativeDataType">5</property>
>>> </structure>
>>> </list-property>
>>> <property name="queryText">select *
>>> from orderdetails
>>> where ordernumber = ?</property>
>>> <xml-property name="designerValues"><![CDATA[<?xml
>>> version="1.0" encoding="UTF-8"?>
>>> <model:DesignValues
>>> xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
>>> xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
>>> <Version>1.0</Version>
>>> <design:DataSetParameters>
>>> <design:parameterDefinitions>
>>> <design:inOutMode>In</design:inOutMode>
>>> <design:attributes>
>>> <design:name></design:name>
>>> <design:position>1</design:position>
>>> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
>>> <design:nullability>Unknown</design:nullability>
>>> <design:uiHints/>
>>> </design:attributes>
>>> <design:inputAttributes>
>>> <design:elementAttributes>
>>> <design:defaultScalarValue>10101</design:defaultScalarValue >
>>> <design:optional>false</design:optional>
>>> <design:masksValue>false</design:masksValue>
>>> <design:uiHints>
>>> <design:promptStyle>TextField</design:promptStyle>
>>> </design:uiHints>
>>> </design:elementAttributes>
>>> </design:inputAttributes>
>>> </design:parameterDefinitions>
>>> </design:DataSetParameters>
>>> <design:ResultSets derivedMetaData="true">
>>> <design:resultSetDefinitions>
>>> <design:resultSetColumns>
>>> <design:resultColumnDefinitions>
>>> <design:attributes>
>>> <design:name>ORDERNUMBER</design:name>
>>> <design:position>1</design:position>
>>> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
>>> <design:precision>10</design:precision>
>>> <design:scale>0</design:scale>
>>> <design:nullability>Nullable</design:nullability>
>>> </design:attributes>
>>> <design:usageHints>
>>> <design:label>ORDERNUMBER</design:label>
>>> <design:formattingHints>
>>> <design:displaySize>11</design:displaySize>
>>> </design:formattingHints>
>>> </design:usageHints>
>>> </design:resultColumnDefinitions>
>>> <design:resultColumnDefinitions>
>>> <design:attributes>
>>> <design:name>PRODUCTCODE</design:name>
>>> <design:position>2</design:position>
>>> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
>>> <design:precision>15</design:precision>
>>> <design:scale>0</design:scale>
>>> <design:nullability>Nullable</design:nullability>
>>> </design:attributes>
>>> <design:usageHints>
>>> <design:label>PRODUCTCODE</design:label>
>>> <design:formattingHints>
>>> <design:displaySize>15</design:displaySize>
>>> </design:formattingHints>
>>> </design:usageHints>
>>> </design:resultColumnDefinitions>
>>> <design:resultColumnDefinitions>
>>> <design:attributes>
>>> <design:name>QUANTITYORDERED</design:name>
>>> <design:position>3</design:position>
>>> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
>>> <design:precision>10</design:precision>
>>> <design:scale>0</design:scale>
>>> <design:nullability>Nullable</design:nullability>
>>> </design:attributes>
>>> <design:usageHints>
>>> <design:label>QUANTITYORDERED</design:label>
>>> <design:formattingHints>
>>> <design:displaySize>11</design:displaySize>
>>> </design:formattingHints>
>>> </design:usageHints>
>>> </design:resultColumnDefinitions>
>>> <design:resultColumnDefinitions>
>>> <design:attributes>
>>> <design:name>PRICEEACH</design:name>
>>> <design:position>4</design:position>
>>> <design:nativeDataTypeCode>8</design:nativeDataTypeCode>
>>> <design:precision>15</design:precision>
>>> <design:scale>0</design:scale>
>>> <design:nullability>Nullable</design:nullability>
>>> </design:attributes>
>>> <design:usageHints>
>>> <design:label>PRICEEACH</design:label>
>>> <design:formattingHints>
>>> <design:displaySize>22</design:displaySize>
>>> </design:formattingHints>
>>> </design:usageHints>
>>> </design:resultColumnDefinitions>
>>> <design:resultColumnDefinitions>
>>> <design:attributes>
>>> <design:name>ORDERLINENUMBER</design:name>
>>> <design:position>5</design:position>
>>> <design:nativeDataTypeCode>5</design:nativeDataTypeCode>
>>> <design:precision>5</design:precision>
>>> <design:scale>0</design:scale>
>>> <design:nullability>Nullable</design:nullability>
>>> </design:attributes>
>>> <design:usageHints>
>>> <design:label>ORDERLINENUMBER</design:label>
>>> <design:formattingHints>
>>> <design:displaySize>6</design:displaySize>
>>> </design:formattingHints>
>>> </design:usageHints>
>>> </design:resultColumnDefinitions>
>>> </design:resultSetColumns>
>>> </design:resultSetDefinitions>
>>> </design:ResultSets>
>>> </model:DesignValues>]]></xml-property>
>>> </oda-data-set>
>>> </data-sets>
>>> <styles>
>>> <style name="crosstab" id="4">
>>> <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-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="detail" id="57">
>>> <property name="backgroundColor">#BACAE2</property>
>>> <property name="fontFamily">"Arial"</property>
>>> <property name="fontSize">small</property>
>>> <property name="paddingTop">0px</property>
>>> <property name="paddingLeft">0px</property>
>>> <property name="paddingBottom">0px</property>
>>> <property name="paddingRight">0px</property>
>>> </style>
>>> <style name="headerfooter" id="58">
>>> <property name="backgroundColor">#004080</property>
>>> <property name="fontFamily">"Arial"</property>
>>> <property name="fontSize">small</property>
>>> <property name="fontWeight">bold</property>
>>> <property name="color">#FFFFFF</property>
>>> </style>
>>> <style name="groupheader" id="59">
>>> <property name="backgroundColor">#0080FF</property>
>>> <property name="fontFamily">"Arial"</property>
>>> <property name="fontSize">small</property>
>>> <property name="fontWeight">bold</property>
>>> <property name="color">#FFFFFF</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>
>>> <table id="9">
>>> <property name="width">100%</property>
>>> <property name="dataSet">Data Set</property>
>>> <list-property name="visibility">
>>> <structure>
>>> <property name="format">all</property>
>>> <expression name="valueExpr">true</expression>
>>> </structure>
>>> </list-property>
>>> <list-property name="boundDataColumns">
>>> <structure>
>>> <property name="name">ORDERNUMBER</property>
>>> <expression
>>> name="expression">dataSetRow["ORDERNUMBER"]</expression >
>>> <property name="dataType">integer</property>
>>> </structure>
>>> </list-property>
>>> <column id="16"/>
>>> <header>
>>> <row id="10">
>>> <cell id="11">
>>> <label id="17">
>>> <text-property
>>> name="text">ORDERNUMBER</text-property>
>>> </label>
>>> </cell>
>>> </row>
>>> </header>
>>> <detail>
>>> <row id="12">
>>> <method name="onCreate"><![CDATA[myopts[ii] =
>>> this.getRowData().getColumnValue(0);
>>> ii++;]]></method>
>>> <cell id="13">
>>> <data id="18">
>>> <property
>>> name="resultSetColumn">ORDERNUMBER</property>
>>> </data>
>>> </cell>
>>> </row>
>>> </detail>
>>> <footer>
>>> <row id="14">
>>> <cell id="15"/>
>>> </row>
>>> </footer>
>>> </table>
>>> <data id="21">
>>> <list-property name="visibility">
>>> <structure>
>>> <property name="format">all</property>
>>> <expression name="valueExpr">true</expression>
>>> </structure>
>>> </list-property>
>>> <list-property name="boundDataColumns">
>>> <structure>
>>> <property name="name">Column Binding</property>
>>> <expression name="expression">"test";</expression>
>>> <property name="dataType">any</property>
>>> </structure>
>>> </list-property>
>>> <method name="onCreate"><![CDATA[ss = "";
>>> for( i=0; i < myopts.length; i++ ){
>>> ss = ss + "sel1.options[" + i + "] = new Option( '" + myopts[i] + "', '"
>>> + myopts[i] + "');";
>>> }]]></method>
>>> <property name="resultSetColumn">Column Binding</property>
>>> </data>
>>> <text id="19">
>>> <property name="contentType">html</property>
>>> <text-property name="content"><![CDATA[<html>
>>>
>>>
>>>
>>> <form name='frm'>
>>> <select name='sel'>
>>> <option></option>
>>> </select>
>>> <INPUT Type="BUTTON" Value="Refresh" onClick="reloadPage(this.form)">
>>> </form>
>>> </html>
>>> <script language="javascript">
>>>
>>>
>>>
>>> function reloadPage(form) {
>>> var sel1 = document.frm.sel;
>>> //alert("Reload Page");
>>> var temp = new String(location.href);
>>> var targetURL = new String();
>>>
>>> if(temp.indexOf("__overwrite=") != -1 ){
>>> targetURL = temp.substring(0, temp.indexOf("&__overwrite") -1);
>>> }else{
>>> targetURL = temp;
>>> }
>>>
>>> targetURL += "&__overwrite=true";
>>> targetURL += "&ordern=" + form.sel.value;
>>>
>>>
>>>
>>> //alert( targetURL );
>>> //window.location.href = targetURL;
>>> document.location.replace(targetURL);
>>>
>>>
>>> }
>>>
>>> var sel1 = document.frm.sel;
>>>
>>>
>>>
>>> <VALUE-OF>ss;</VALUE-OF>
>>> </script>]]></text-property>
>>> </text>
>>> <table id="23">
>>> <property name="width">100%</property>
>>> <property name="dataSet">orderdetails</property>
>>> <list-property name="boundDataColumns">
>>> <structure>
>>> <property name="name">ORDERNUMBER</property>
>>> <expression
>>> name="expression">dataSetRow["ORDERNUMBER"]</expression >
>>> <property name="dataType">integer</property><
Re: Showing data set values in a combo box [message #254363 is a reply to message #253710] Tue, 04 September 2007 06:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ruby.boyarski.verix.com

Still, when running the report the "Reload" button doesn't work. It seems
not to recognize the "reloadPage" method.
The combo is populated though...
Any idea?
Ruby

"Jason Weathersby" <jasonweathersby@alltel.net> wrote in message
news:fb1n5s$u6d$1@build.eclipse.org...
> Ruby,
>
> Try this example. I think it will suit your needs and is much simpler as
> well.
>
> Jason
>
> <?xml version="1.0" encoding="UTF-8"?>
> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.7"
> id="1">
> <property name="createdBy">Eclipse BIRT Designer Version
> 2.1.3.v20070705-1847 Build &lt;20070705-1847></property>
> <property name="units">in</property>
> <property name="comments">Copyright (c) 2006 &lt;&lt;Your Company Name
> here>></property>
> <method name="beforeFactory"><![CDATA[scriptstring = "";]]></method>
> <parameters>
> <scalar-parameter name="ordernmbr" id="19">
> <property name="valueType">static</property>
> <property name="dataType">string</property>
> <property name="concealValue">false</property>
> <property name="allowBlank">true</property>
> <property name="allowNull">true</property>
> <property name="controlType">text-box</property>
> <property name="defaultValue">10101</property>
> <structure name="format">
> <property name="category">Unformatted</property>
> </structure>
> </scalar-parameter>
> </parameters>
> <data-sources>
> <oda-data-source
> extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
> id="4">
> <text-property name="displayName"></text-property>
> <property
> name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
> <property name="odaURL">jdbc:classicmodels:sampledb</property>
> <property name="odaUser">ClassicModels</property>
> </oda-data-source>
> </data-sources>
> <data-sets>
> <oda-data-set
> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
> name="Data Set" id="5">
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">Data Source</property>
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="nativeName">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> </list-property>
> <property name="queryText">select distinct ordernumber
> from orderdetails</property>
> </oda-data-set>
> <oda-data-set
> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
> name="orderdetails" id="6">
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">PRODUCTCODE</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">QUANTITYORDERED</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">PRICEEACH</property>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">ORDERLINENUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">Data Source</property>
> <list-property name="parameters">
> <structure>
> <property name="name">param_1</property>
> <property name="paramName">ordernmbr</property>
> <property name="nativeName"></property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> <property name="position">1</property>
> <property name="isOptional">true</property>
> <property name="isInput">true</property>
> </structure>
> </list-property>
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="nativeName">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">PRODUCTCODE</property>
> <property name="nativeName">PRODUCTCODE</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">QUANTITYORDERED</property>
> <property name="nativeName">QUANTITYORDERED</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">PRICEEACH</property>
> <property name="nativeName">PRICEEACH</property>
> <property name="dataType">float</property>
> <property name="nativeDataType">8</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">ORDERLINENUMBER</property>
> <property name="nativeName">ORDERLINENUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">5</property>
> </structure>
> </list-property>
> <property name="queryText">select *
> from orderdetails
> where ordernumber = ?</property>
> <xml-property name="designerValues"><![CDATA[<?xml
> version="1.0" encoding="UTF-8"?>
> <model:DesignValues
> xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
> xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
> <Version>1.0</Version>
> <design:DataSetParameters>
> <design:parameterDefinitions>
> <design:inOutMode>In</design:inOutMode>
> <design:attributes>
> <design:name></design:name>
> <design:position>1</design:position>
> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
> <design:nullability>Unknown</design:nullability>
> <design:uiHints/>
> </design:attributes>
> <design:inputAttributes>
> <design:elementAttributes>
> <design:defaultScalarValue>10101</design:defaultScalarValue >
> <design:optional>true</design:optional>
> <design:masksValue>false</design:masksValue>
> <design:uiHints>
> <design:promptStyle>TextField</design:promptStyle>
> </design:uiHints>
> </design:elementAttributes>
> </design:inputAttributes>
> </design:parameterDefinitions>
> </design:DataSetParameters>
> </model:DesignValues>]]></xml-property>
> </oda-data-set>
> </data-sets>
> <styles>
> <style name="detail" id="54">
> <property name="backgroundColor">#BACAE2</property>
> <property name="fontFamily">Arial</property>
> <property name="fontSize">small</property>
> <property name="paddingTop">0px</property>
> <property name="paddingLeft">0px</property>
> <property name="paddingBottom">0px</property>
> <property name="paddingRight">0px</property>
> </style>
> <style name="headerfooter" id="55">
> <property name="backgroundColor">#004080</property>
> <property name="fontFamily">Arial</property>
> <property name="fontSize">small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFFF</property>
> </style>
> <style name="groupheader" id="56">
> <property name="backgroundColor">#0080FF</property>
> <property name="fontFamily">Arial</property>
> <property name="fontSize">small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFFF</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>
> <table id="7">
> <property name="width">100%</property>
> <property name="dataSet">Data Set</property>
> <list-property name="visibility">
> <structure>
> <property name="format">all</property>
> <expression name="valueExpr">true</expression>
> </structure>
> </list-property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">ORDERNUMBER</property>
> <expression
> name="expression">dataSetRow["ORDERNUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> <column id="16"/>
> <header>
> <row id="8">
> <cell id="9">
> <label id="10">
> <text-property
> name="text">ORDERNUMBER</text-property>
> </label>
> </cell>
> </row>
> </header>
> <detail>
> <row id="11">
> <method name="onCreate"><![CDATA[var colval =
> this.getRowData().getColumnValue(0);
> scriptstring= scriptstring + "<option value='" + colval +
> "'>"+colval+"</option>";]]></method>
> <cell id="12">
> <data id="13">
> <property
> name="resultSetColumn">ORDERNUMBER</property>
> </data>
> </cell>
> </row>
> </detail>
> <footer>
> <row id="14">
> <cell id="15"/>
> </row>
> </footer>
> </table>
> <text id="17">
> <property name="contentType">html</property>
> <text-property name="content"><![CDATA[
> <form name='frm' action="">
> <script language="javascript">
> function rp(form) {
> alert("Reload Page");
> }
>
> function reloadPage(form) {
> var sel1 = form.ordernmbr;
> //alert("Reload Page");
> var temp = new String(location.href);
> var targetURL = new String();
> var xyz = -1;
>
> xyz=temp.indexOf("__overwrite=")
>
> if( xyz != -1 ){
> //alert( xyz );
> targetURL = temp.substring(0, xyz-1);
> //alert(temp.substring(0, xyz-1));
> }else{
> targetURL = temp;
> }
>
> targetURL += "&__overwrite=true";
> targetURL += "&ordernmbr=" + form.ordernmbr.value;
>
>
>
> //alert( targetURL );
> //window.location.href = targetURL;
> document.location.replace(targetURL);
>
>
> }
> </script>
>
>
> <select name='ordernmbr'>
> <VALUE-OF format="HTML">scriptstring;</VALUE-OF>
> </select>
> <INPUT Type="BUTTON" name="mybutton" Value="Refresh"
> onClick='reloadPage(this.form)'></INPUT>
> </form>]]></text-property>
> </text>
> <table id="20">
> <property name="width">100%</property>
> <property name="dataSet">orderdetails</property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">ORDERNUMBER</property>
> <expression
> name="expression">dataSetRow["ORDERNUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="name">PRODUCTCODE</property>
> <expression
> name="expression">dataSetRow["PRODUCTCODE"]</expression >
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="name">QUANTITYORDERED</property>
> <expression
> name="expression">dataSetRow["QUANTITYORDERED"]</expression >
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="name">PRICEEACH</property>
> <expression
> name="expression">dataSetRow["PRICEEACH"]</expression>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="name">ORDERLINENUMBER</property>
> <expression
> name="expression">dataSetRow["ORDERLINENUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> <column id="49"/>
> <column id="50"/>
> <column id="51"/>
> <column id="52"/>
> <column id="53"/>
> <header>
> <row id="21">
> <property name="style">headerfooter</property>
> <cell id="22">
> <label id="23">
> <text-property
> name="text">ORDERNUMBER</text-property>
> </label>
> </cell>
> <cell id="24">
> <label id="25">
> <text-property
> name="text">PRODUCTCODE</text-property>
> </label>
> </cell>
> <cell id="26">
> <label id="27">
> <text-property
> name="text">QUANTITYORDERED</text-property>
> </label>
> </cell>
> <cell id="28">
> <label id="29">
> <text-property
> name="text">PRICEEACH</text-property>
> </label>
> </cell>
> <cell id="30">
> <label id="31">
> <text-property
> name="text">ORDERLINENUMBER</text-property>
> </label>
> </cell>
> </row>
> </header>
> <detail>
> <row id="32">
> <property name="style">detail</property>
> <cell id="33">
> <data id="34">
> <property
> name="resultSetColumn">ORDERNUMBER</property>
> </data>
> </cell>
> <cell id="35">
> <data id="36">
> <property
> name="resultSetColumn">PRODUCTCODE</property>
> </data>
> </cell>
> <cell id="37">
> <data id="38">
> <property
> name="resultSetColumn">QUANTITYORDERED</property>
> </data>
> </cell>
> <cell id="39">
> <data id="40">
> <property
> name="resultSetColumn">PRICEEACH</property>
> </data>
> </cell>
> <cell id="41">
> <data id="42">
> <property
> name="resultSetColumn">ORDERLINENUMBER</property>
> </data>
> </cell>
> </row>
> </detail>
> <footer>
> <row id="43">
> <property name="style">headerfooter</property>
> <cell id="44"/>
> <cell id="45"/>
> <cell id="46"/>
> <cell id="47"/>
> <cell id="48"/>
> </row>
> </footer>
> </table>
> </body>
> </report>
>
>
> news://news.eclipse.org/eclipse.birt wrote:
>> Thanks for the example! It helps a lot.
>> I have a problem though. When running in the "preview" or "View report as
>> HTML" it works well.
>> But, it doesn't work well when running with "View report in Web Viewer"
>> or when publishing it to the iServer.
>> The script code doesn't run (everthing else runs well) and thus the combo
>> is not populated. Any idea why that is and how to solve it?
>> Cheers,
>> Ruby
>>
>> "Jason Weathersby" <jasonweathersby@alltel.net> wrote in message
>> news:fav5lf$49i$1@build.eclipse.org...
>>> Ruby,
>>>
>>> There may be better ways to do what you want, but here is an example
>>> that uses a hidden table (OnCreate script) and a hidden data element to
>>> add script to a report to rerun a report using a combo box.
>>>
>>> Jason
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.14"
>>> id="1">
>>> <property name="createdBy">Eclipse BIRT Designer Version
>>> 2.2.0.v20070620 Build &lt;2.2.0.v20070626-1003></property>
>>> <property name="units">in</property>
>>> <property name="comments">Copyright (c) 2007 &lt;&lt;Your Company
>>> Name here>></property>
>>> <html-property name="description">Creates a blank report with no
>>> predefined content.</html-property>
>>> <method name="beforeFactory"><![CDATA[myopts = new Array();
>>> ii=0;]]></method>
>>> <text-property name="displayName">Blank Report</text-property>
>>> <property name="iconFile">/templates/blank_report.gif</property>
>>> <parameters>
>>> <scalar-parameter name="ordern" id="60">
>>> <property name="valueType">static</property>
>>> <property name="dataType">integer</property>
>>> <property name="isRequired">false</property>
>>> <property name="controlType">text-box</property>
>>> <property name="defaultValue">10101</property>
>>> <structure name="format">
>>> <property name="category">Unformatted</property>
>>> </structure>
>>> </scalar-parameter>
>>> </parameters>
>>> <data-sources>
>>> <oda-data-source
>>> extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
>>> id="6">
>>> <text-property name="displayName"></text-property>
>>> <property
>>> name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
>>> <property
>>> name="odaURL">jdbc:classicmodels:sampledb</property>
>>> <property name="odaUser">ClassicModels</property>
>>> </oda-data-source>
>>> </data-sources>
>>> <data-sets>
>>> <oda-data-set
>>> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
>>> name="Data Set" id="7">
>>> <structure name="cachedMetaData">
>>> <list-property name="resultSet">
>>> <structure>
>>> <property name="position">1</property>
>>> <property name="name">ORDERNUMBER</property>
>>> <property name="dataType">integer</property>
>>> </structure>
>>> </list-property>
>>> </structure>
>>> <property name="dataSource">Data Source</property>
>>> <list-property name="resultSet">
>>> <structure>
>>> <property name="position">1</property>
>>> <property name="name">ORDERNUMBER</property>
>>> <property name="nativeName">ORDERNUMBER</property>
>>> <property name="dataType">integer</property>
>>> <property name="nativeDataType">4</property>
>>> </structure>
>>> </list-property>
>>> <property name="queryText">select ordernumber
>>> from orderdetails</property>
>>> </oda-data-set>
>>> <oda-data-set
>>> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
>>> name="orderdetails" id="22">
>>> <structure name="cachedMetaData">
>>> <list-property name="resultSet">
>>> <structure>
>>> <property name="position">1</property>
>>> <property name="name">ORDERNUMBER</property>
>>> <property name="dataType">integer</property>
>>> </structure>
>>> <structure>
>>> <property name="position">2</property>
>>> <property name="name">PRODUCTCODE</property>
>>> <property name="dataType">string</property>
>>> </structure>
>>> <structure>
>>> <property name="position">3</property>
>>> <property name="name">QUANTITYORDERED</property>
>>> <property name="dataType">integer</property>
>>> </structure>
>>> <structure>
>>> <property name="position">4</property>
>>> <property name="name">PRICEEACH</property>
>>> <property name="dataType">float</property>
>>> </structure>
>>> <structure>
>>> <property name="position">5</property>
>>> <property name="name">ORDERLINENUMBER</property>
>>> <property name="dataType">integer</property>
>>> </structure>
>>> </list-property>
>>> </structure>
>>> <property name="dataSource">Data Source</property>
>>> <list-property name="parameters">
>>> <structure>
>>> <property name="name">param_1</property>
>>> <property name="paramName">ordern</property>
>>> <property name="nativeName"></property>
>>> <property name="dataType">integer</property>
>>> <property name="nativeDataType">4</property>
>>> <property name="position">1</property>
>>> <expression name="defaultValue">10101</expression>
>>> <property name="isOptional">false</property>
>>> <property name="isInput">true</property>
>>> <property name="isOutput">false</property>
>>> </structure>
>>> </list-property>
>>> <list-property name="resultSet">
>>> <structure>
>>> <property name="position">1</property>
>>> <property name="name">ORDERNUMBER</property>
>>> <property name="nativeName">ORDERNUMBER</property>
>>> <property name="dataType">integer</property>
>>> <property name="nativeDataType">4</property>
>>> </structure>
>>> <structure>
>>> <property name="position">2</property>
>>> <property name="name">PRODUCTCODE</property>
>>> <property name="nativeName">PRODUCTCODE</property>
>>> <property name="dataType">string</property>
>>> <property name="nativeDataType">12</property>
>>> </structure>
>>> <structure>
>>> <property name="position">3</property>
>>> <property name="name">QUANTITYORDERED</property>
>>> <property
>>> name="nativeName">QUANTITYORDERED</property>
>>> <property name="dataType">integer</property>
>>> <property name="nativeDataType">4</property>
>>> </structure>
>>> <structure>
>>> <property name="position">4</property>
>>> <property name="name">PRICEEACH</property>
>>> <property name="nativeName">PRICEEACH</property>
>>> <property name="dataType">float</property>
>>> <property name="nativeDataType">8</property>
>>> </structure>
>>> <structure>
>>> <property name="position">5</property>
>>> <property name="name">ORDERLINENUMBER</property>
>>> <property
>>> name="nativeName">ORDERLINENUMBER</property>
>>> <property name="dataType">integer</property>
>>> <property name="nativeDataType">5</property>
>>> </structure>
>>> </list-property>
>>> <property name="queryText">select *
>>> from orderdetails
>>> where ordernumber = ?</property>
>>> <xml-property name="designerValues"><![CDATA[<?xml
>>> version="1.0" encoding="UTF-8"?>
>>> <model:DesignValues
>>> xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
>>> xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
>>> <Version>1.0</Version>
>>> <design:DataSetParameters>
>>> <design:parameterDefinitions>
>>> <design:inOutMode>In</design:inOutMode>
>>> <design:attributes>
>>> <design:name></design:name>
>>> <design:position>1</design:position>
>>> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
>>> <design:nullability>Unknown</design:nullability>
>>> <design:uiHints/>
>>> </design:attributes>
>>> <design:inputAttributes>
>>> <design:elementAttributes>
>>> <design:defaultScalarValue>10101</design:defaultScalarValue >
>>> <design:optional>false</design:optional>
>>> <design:masksValue>false</design:masksValue>
>>> <design:uiHints>
>>> <design:promptStyle>TextField</design:promptStyle>
>>> </design:uiHints>
>>> </design:elementAttributes>
>>> </design:inputAttributes>
>>> </design:parameterDefinitions>
>>> </design:DataSetParameters>
>>> <design:ResultSets derivedMetaData="true">
>>> <design:resultSetDefinitions>
>>> <design:resultSetColumns>
>>> <design:resultColumnDefinitions>
>>> <design:attributes>
>>> <design:name>ORDERNUMBER</design:name>
>>> <design:position>1</design:position>
>>> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
>>> <design:precision>10</design:precision>
>>> <design:scale>0</design:scale>
>>> <design:nullability>Nullable</design:nullability>
>>> </design:attributes>
>>> <design:usageHints>
>>> <design:label>ORDERNUMBER</design:label>
>>> <design:formattingHints>
>>> <design:displaySize>11</design:displaySize>
>>> </design:formattingHints>
>>> </design:usageHints>
>>> </design:resultColumnDefinitions>
>>> <design:resultColumnDefinitions>
>>> <design:attributes>
>>> <design:name>PRODUCTCODE</design:name>
>>> <design:position>2</design:position>
>>> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
>>> <design:precision>15</design:precision>
>>> <design:scale>0</design:scale>
>>> <design:nullability>Nullable</design:nullability>
>>> </design:attributes>
>>> <design:usageHints>
>>> <design:label>PRODUCTCODE</design:label>
>>> <design:formattingHints>
>>> <design:displaySize>15</design:displaySize>
>>> </design:formattingHints>
>>> </design:usageHints>
>>> </design:resultColumnDefinitions>
>>> <design:resultColumnDefinitions>
>>> <design:attributes>
>>> <design:name>QUANTITYORDERED</design:name>
>>> <design:position>3</design:position>
>>> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
>>> <design:precision>10</design:precision>
>>> <design:scale>0</design:scale>
>>> <design:nullability>Nullable</design:nullability>
>>> </design:attributes>
>>> <design:usageHints>
>>> <design:label>QUANTITYORDERED</design:label>
>>> <design:formattingHints>
>>> <design:displaySize>11</design:displaySize>
>>> </design:formattingHints>
>>> </design:usageHints>
>>> </design:resultColumnDefinitions>
>>> <design:resultColumnDefinitions>
>>> <design:attributes>
>>> <design:name>PRICEEACH</design:name>
>>> <design:position>4</design:position>
>>> <design:nativeDataTypeCode>8</design:nativeDataTypeCode>
>>> <design:precision>15</design:precision>
>>> <design:scale>0</design:scale>
>>> <design:nullability>Nullable</design:nullability>
>>> </design:attributes>
>>> <design:usageHints>
>>> <design:label>PRICEEACH</design:label>
>>> <design:formattingHints>
>>> <design:displaySize>22</design:displaySize>
>>> </design:formattingHints>
>>> </design:usageHints>
>>> </design:resultColumnDefinitions>
>>> <design:resultColumnDefinitions>
>>> <design:attributes>
>>> <design:name>ORDERLINENUMBER</design:name>
>>> <design:position>5</design:position>
>>> <design:nativeDataTypeCode>5</design:nativeDataTypeCode>
>>> <design:precision>5</design:precision>
>>> <design:scale>0</design:scale>
>>> <design:nullability>Nullable</design:nullability>
>>> </design:attributes>
>>> <design:usageHints>
>>> <design:label>ORDERLINENUMBER</design:label>
>>> <design:formattingHints>
>>> <design:displaySize>6</design:displaySize>
>>> </design:formattingHints>
>>> </design:usageHints>
>>> </design:resultColumnDefinitions>
>>> </design:resultSetColumns>
>>> </design:resultSetDefinitions>
>>> </design:ResultSets>
>>> </model:DesignValues>]]></xml-property>
>>> </oda-data-set>
>>> </data-sets>
>>> <styles>
>>> <style name="crosstab" id="4">
>>> <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-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="detail" id="57">
>>> <property name="backgroundColor">#BACAE2</property>
>>> <property name="fontFamily">"Arial"</property>
>>> <property name="fontSize">small</property>
>>> <property name="paddingTop">0px</property>
>>> <property name="paddingLeft">0px</property>
>>> <property name="paddingBottom">0px</property>
>>> <property name="paddingRight">0px</property>
>>> </style>
>>> <style name="headerfooter" id="58">
>>> <property name="backgroundColor">#004080</property>
>>> <property name="fontFamily">"Arial"</property>
>>> <property name="fontSize">small</property>
>>> <property name="fontWeight">bold</property>
>>> <property name="color">#FFFFFF</property>
>>> </style>
>>> <style name="groupheader" id="59">
>>> <property name="backgroundColor">#0080FF</property>
>>> <property name="fontFamily">"Arial"</property>
>>> <property name="fontSize">small</property>
>>> <property name="fontWeight">bold</property>
>>> <property name="color">#FFFFFF</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>
>>> <table id="9">
>>> <property name="width">100%</property>
>>> <property name="dataSet">Data Set</property>
>>> <list-property name="visibility">
>>> <structure>
>>> <property name="format">all</property>
>>> <expression name="valueExpr">true</expression>
>>> </structure>
>>> </list-property>
>>> <list-property name="boundDataColumns">
>>> <structure>
>>> <property name="name">ORDERNUMBER</property>
>>> <expression
>>> name="expression">dataSetRow["ORDERNUMBER"]</expression >
>>> <property name="dataType">integer</property>
>>> </structure>
>>> </list-property>
>>> <column id="16"/>
>>> <header>
>>> <row id="10">
>>> <cell id="11">
>>> <label id="17">
>>> <text-property
>>> name="text">ORDERNUMBER</text-property>
>>> </label>
>>> </cell>
>>> </row>
>>> </header>
>>> <detail>
>>> <row id="12">
>>> <method name="onCreate"><![CDATA[myopts[ii] =
>>> this.getRowData().getColumnValue(0);
>>> ii++;]]></method>
>>> <cell id="13">
>>> <data id="18">
>>> <property
>>> name="resultSetColumn">ORDERNUMBER</property>
>>> </data>
>>> </cell>
>>> </row>
>>> </detail>
>>> <footer>
>>> <row id="14">
>>> <cell id="15"/>
>>> </row>
>>> </footer>
>>> </table>
>>> <data id="21">
>>> <list-property name="visibility">
>>> <structure>
>>> <property name="format">all</property>
>>> <expression name="valueExpr">true</expression>
>>> </structure>
>>> </list-property>
>>> <list-property name="boundDataColumns">
>>> <structure>
>>> <property name="name">Column Binding</property>
>>> <expression name="expression">"test";</expression>
>>> <property name="dataType">any</property>
>>> </structure>
>>> </list-property>
>>> <method name="onCreate"><![CDATA[ss = "";
>>> for( i=0; i < myopts.length; i++ ){
>>> ss = ss + "sel1.options[" + i + "] = new Option( '" + myopts[i] + "', '"
>>> + myopts[i] + "');";
>>> }]]></method>
>>> <property name="resultSetColumn">Column Binding</property>
>>> </data>
>>> <text id="19">
>>> <property name="contentType">html</property>
>>> <text-property name="content"><![CDATA[<html>
>>>
>>>
>>>
>>> <form name='frm'>
>>> <select name='sel'>
>>> <option></option>
>>> </select>
>>> <INPUT Type="BUTTON" Value="Refresh" onClick="reloadPage(this.form)">
>>> </form>
>>> </html>
>>> <script language="javascript">
>>>
>>>
>>>
>>> function reloadPage(form) {
>>> var sel1 = document.frm.sel;
>>> //alert("Reload Page");
>>> var temp = new String(location.href);
>>> var targetURL = new String();
>>>
>>> if(temp.indexOf("__overwrite=") != -1 ){
>>> targetURL = temp.substring(0, temp.indexOf("&__overwrite") -1);
>>> }else{
>>> targetURL = temp;
>>> }
>>>
>>> targetURL += "&__overwrite=true";
>>> targetURL += "&ordern=" + form.sel.value;
>>>
>>>
>>>
>>> //alert( targetURL );
>>> //window.location.href = targetURL;
>>> document.location.replace(targetURL);
>>>
>>>
>>> }
>>>
>>> var sel1 = document.frm.sel;
>>>
>>>
>>>
>>> <VALUE-OF>ss;</VALUE-OF>
>>> </script>]]></text-property>
>>> </text>
>>> <table id="23">
>>> <property name="width">100%</property>
>>> <property name="dataSet">orderdetails</property>
>>> <list-property name="boundDataColumns">
>>> <structure>
>>> <property name="name">ORDERNUMBER</property>
>>> <expression
>>> name="expression">dataSetRow["ORDERNUMBER"]</expression >
>>> <property name="dataType">integer</property>
Re: Showing data set values in a combo box - solved [message #254377 is a reply to message #254363] Tue, 04 September 2007 07:39 Go to previous message
Eclipse UserFriend
Originally posted by: ruby.boyarski.verix.com

I solved it by changing the code to be as follows (if you have comments -
you are welcomed).
Seems that <script> tag doesn't work for some reason under the "Web viewer"
and "iPortal"...
Thanks very much for your help.
Ruby

<form name='frm' action="">

<span id='ttt' style='visibility:hidden'>

function reloadPage(form) {

var sel1 = form.ordernmbr;

var temp = new String(location.href);

var targetURL = new String();

var xyz = -1;

xyz=temp.indexOf("__overwrite=");

if( xyz != -1 ){

targetURL = temp.substring(0, xyz-1);

}else{

targetURL = temp;

}

targetURL += "&__overwrite=true";

targetURL += "&ordernmbr=" + form.ordernmbr.value;


document.location.replace(targetURL);

}

</span>


<select name='ordernmbr'>

<VALUE-OF format="HTML">scriptstring;</VALUE-OF>

</select>

<INPUT Type="BUTTON" name="mybutton" Value="Refresh"

onClick='eval(document.all.ttt.innerText);reloadPage(this.fo rm)' ></INPUT>

</form>


"news://news.eclipse.org/eclipse.birt" <ruby.boyarski@verix.com> wrote in
message news:fbjcdm$121$1@build.eclipse.org...
> Still, when running the report the "Reload" button doesn't work. It seems
> not to recognize the "reloadPage" method.
> The combo is populated though...
> Any idea?
> Ruby
>
> "Jason Weathersby" <jasonweathersby@alltel.net> wrote in message
> news:fb1n5s$u6d$1@build.eclipse.org...
>> Ruby,
>>
>> Try this example. I think it will suit your needs and is much simpler as
>> well.
>>
>> Jason
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.7"
>> id="1">
>> <property name="createdBy">Eclipse BIRT Designer Version
>> 2.1.3.v20070705-1847 Build &lt;20070705-1847></property>
>> <property name="units">in</property>
>> <property name="comments">Copyright (c) 2006 &lt;&lt;Your Company
>> Name here>></property>
>> <method name="beforeFactory"><![CDATA[scriptstring = "";]]></method>
>> <parameters>
>> <scalar-parameter name="ordernmbr" id="19">
>> <property name="valueType">static</property>
>> <property name="dataType">string</property>
>> <property name="concealValue">false</property>
>> <property name="allowBlank">true</property>
>> <property name="allowNull">true</property>
>> <property name="controlType">text-box</property>
>> <property name="defaultValue">10101</property>
>> <structure name="format">
>> <property name="category">Unformatted</property>
>> </structure>
>> </scalar-parameter>
>> </parameters>
>> <data-sources>
>> <oda-data-source
>> extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
>> id="4">
>> <text-property name="displayName"></text-property>
>> <property
>> name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
>> <property
>> name="odaURL">jdbc:classicmodels:sampledb</property>
>> <property name="odaUser">ClassicModels</property>
>> </oda-data-source>
>> </data-sources>
>> <data-sets>
>> <oda-data-set
>> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
>> name="Data Set" id="5">
>> <structure name="cachedMetaData">
>> <list-property name="resultSet">
>> <structure>
>> <property name="position">1</property>
>> <property name="name">ORDERNUMBER</property>
>> <property name="dataType">integer</property>
>> </structure>
>> </list-property>
>> </structure>
>> <property name="dataSource">Data Source</property>
>> <list-property name="resultSet">
>> <structure>
>> <property name="position">1</property>
>> <property name="name">ORDERNUMBER</property>
>> <property name="nativeName">ORDERNUMBER</property>
>> <property name="dataType">integer</property>
>> <property name="nativeDataType">4</property>
>> </structure>
>> </list-property>
>> <property name="queryText">select distinct ordernumber
>> from orderdetails</property>
>> </oda-data-set>
>> <oda-data-set
>> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
>> name="orderdetails" id="6">
>> <structure name="cachedMetaData">
>> <list-property name="resultSet">
>> <structure>
>> <property name="position">1</property>
>> <property name="name">ORDERNUMBER</property>
>> <property name="dataType">integer</property>
>> </structure>
>> <structure>
>> <property name="position">2</property>
>> <property name="name">PRODUCTCODE</property>
>> <property name="dataType">string</property>
>> </structure>
>> <structure>
>> <property name="position">3</property>
>> <property name="name">QUANTITYORDERED</property>
>> <property name="dataType">integer</property>
>> </structure>
>> <structure>
>> <property name="position">4</property>
>> <property name="name">PRICEEACH</property>
>> <property name="dataType">float</property>
>> </structure>
>> <structure>
>> <property name="position">5</property>
>> <property name="name">ORDERLINENUMBER</property>
>> <property name="dataType">integer</property>
>> </structure>
>> </list-property>
>> </structure>
>> <property name="dataSource">Data Source</property>
>> <list-property name="parameters">
>> <structure>
>> <property name="name">param_1</property>
>> <property name="paramName">ordernmbr</property>
>> <property name="nativeName"></property>
>> <property name="dataType">integer</property>
>> <property name="nativeDataType">4</property>
>> <property name="position">1</property>
>> <property name="isOptional">true</property>
>> <property name="isInput">true</property>
>> </structure>
>> </list-property>
>> <list-property name="resultSet">
>> <structure>
>> <property name="position">1</property>
>> <property name="name">ORDERNUMBER</property>
>> <property name="nativeName">ORDERNUMBER</property>
>> <property name="dataType">integer</property>
>> <property name="nativeDataType">4</property>
>> </structure>
>> <structure>
>> <property name="position">2</property>
>> <property name="name">PRODUCTCODE</property>
>> <property name="nativeName">PRODUCTCODE</property>
>> <property name="dataType">string</property>
>> <property name="nativeDataType">12</property>
>> </structure>
>> <structure>
>> <property name="position">3</property>
>> <property name="name">QUANTITYORDERED</property>
>> <property
>> name="nativeName">QUANTITYORDERED</property>
>> <property name="dataType">integer</property>
>> <property name="nativeDataType">4</property>
>> </structure>
>> <structure>
>> <property name="position">4</property>
>> <property name="name">PRICEEACH</property>
>> <property name="nativeName">PRICEEACH</property>
>> <property name="dataType">float</property>
>> <property name="nativeDataType">8</property>
>> </structure>
>> <structure>
>> <property name="position">5</property>
>> <property name="name">ORDERLINENUMBER</property>
>> <property
>> name="nativeName">ORDERLINENUMBER</property>
>> <property name="dataType">integer</property>
>> <property name="nativeDataType">5</property>
>> </structure>
>> </list-property>
>> <property name="queryText">select *
>> from orderdetails
>> where ordernumber = ?</property>
>> <xml-property name="designerValues"><![CDATA[<?xml
>> version="1.0" encoding="UTF-8"?>
>> <model:DesignValues
>> xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
>> xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
>> <Version>1.0</Version>
>> <design:DataSetParameters>
>> <design:parameterDefinitions>
>> <design:inOutMode>In</design:inOutMode>
>> <design:attributes>
>> <design:name></design:name>
>> <design:position>1</design:position>
>> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
>> <design:nullability>Unknown</design:nullability>
>> <design:uiHints/>
>> </design:attributes>
>> <design:inputAttributes>
>> <design:elementAttributes>
>> <design:defaultScalarValue>10101</design:defaultScalarValue >
>> <design:optional>true</design:optional>
>> <design:masksValue>false</design:masksValue>
>> <design:uiHints>
>> <design:promptStyle>TextField</design:promptStyle>
>> </design:uiHints>
>> </design:elementAttributes>
>> </design:inputAttributes>
>> </design:parameterDefinitions>
>> </design:DataSetParameters>
>> </model:DesignValues>]]></xml-property>
>> </oda-data-set>
>> </data-sets>
>> <styles>
>> <style name="detail" id="54">
>> <property name="backgroundColor">#BACAE2</property>
>> <property name="fontFamily">Arial</property>
>> <property name="fontSize">small</property>
>> <property name="paddingTop">0px</property>
>> <property name="paddingLeft">0px</property>
>> <property name="paddingBottom">0px</property>
>> <property name="paddingRight">0px</property>
>> </style>
>> <style name="headerfooter" id="55">
>> <property name="backgroundColor">#004080</property>
>> <property name="fontFamily">Arial</property>
>> <property name="fontSize">small</property>
>> <property name="fontWeight">bold</property>
>> <property name="color">#FFFFFF</property>
>> </style>
>> <style name="groupheader" id="56">
>> <property name="backgroundColor">#0080FF</property>
>> <property name="fontFamily">Arial</property>
>> <property name="fontSize">small</property>
>> <property name="fontWeight">bold</property>
>> <property name="color">#FFFFFF</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>
>> <table id="7">
>> <property name="width">100%</property>
>> <property name="dataSet">Data Set</property>
>> <list-property name="visibility">
>> <structure>
>> <property name="format">all</property>
>> <expression name="valueExpr">true</expression>
>> </structure>
>> </list-property>
>> <list-property name="boundDataColumns">
>> <structure>
>> <property name="name">ORDERNUMBER</property>
>> <expression
>> name="expression">dataSetRow["ORDERNUMBER"]</expression >
>> <property name="dataType">integer</property>
>> </structure>
>> </list-property>
>> <column id="16"/>
>> <header>
>> <row id="8">
>> <cell id="9">
>> <label id="10">
>> <text-property
>> name="text">ORDERNUMBER</text-property>
>> </label>
>> </cell>
>> </row>
>> </header>
>> <detail>
>> <row id="11">
>> <method name="onCreate"><![CDATA[var colval =
>> this.getRowData().getColumnValue(0);
>> scriptstring= scriptstring + "<option value='" + colval +
>> "'>"+colval+"</option>";]]></method>
>> <cell id="12">
>> <data id="13">
>> <property
>> name="resultSetColumn">ORDERNUMBER</property>
>> </data>
>> </cell>
>> </row>
>> </detail>
>> <footer>
>> <row id="14">
>> <cell id="15"/>
>> </row>
>> </footer>
>> </table>
>> <text id="17">
>> <property name="contentType">html</property>
>> <text-property name="content"><![CDATA[
>> <form name='frm' action="">
>> <script language="javascript">
>> function rp(form) {
>> alert("Reload Page");
>> }
>>
>> function reloadPage(form) {
>> var sel1 = form.ordernmbr;
>> //alert("Reload Page");
>> var temp = new String(location.href);
>> var targetURL = new String();
>> var xyz = -1;
>>
>> xyz=temp.indexOf("__overwrite=")
>>
>> if( xyz != -1 ){
>> //alert( xyz );
>> targetURL = temp.substring(0, xyz-1);
>> //alert(temp.substring(0, xyz-1));
>> }else{
>> targetURL = temp;
>> }
>>
>> targetURL += "&__overwrite=true";
>> targetURL += "&ordernmbr=" + form.ordernmbr.value;
>>
>>
>>
>> //alert( targetURL );
>> //window.location.href = targetURL;
>> document.location.replace(targetURL);
>>
>>
>> }
>> </script>
>>
>>
>> <select name='ordernmbr'>
>> <VALUE-OF format="HTML">scriptstring;</VALUE-OF>
>> </select>
>> <INPUT Type="BUTTON" name="mybutton" Value="Refresh"
>> onClick='reloadPage(this.form)'></INPUT>
>> </form>]]></text-property>
>> </text>
>> <table id="20">
>> <property name="width">100%</property>
>> <property name="dataSet">orderdetails</property>
>> <list-property name="boundDataColumns">
>> <structure>
>> <property name="name">ORDERNUMBER</property>
>> <expression
>> name="expression">dataSetRow["ORDERNUMBER"]</expression >
>> <property name="dataType">integer</property>
>> </structure>
>> <structure>
>> <property name="name">PRODUCTCODE</property>
>> <expression
>> name="expression">dataSetRow["PRODUCTCODE"]</expression >
>> <property name="dataType">string</property>
>> </structure>
>> <structure>
>> <property name="name">QUANTITYORDERED</property>
>> <expression
>> name="expression">dataSetRow["QUANTITYORDERED"]</expression >
>> <property name="dataType">integer</property>
>> </structure>
>> <structure>
>> <property name="name">PRICEEACH</property>
>> <expression
>> name="expression">dataSetRow["PRICEEACH"]</expression>
>> <property name="dataType">float</property>
>> </structure>
>> <structure>
>> <property name="name">ORDERLINENUMBER</property>
>> <expression
>> name="expression">dataSetRow["ORDERLINENUMBER"]</expression >
>> <property name="dataType">integer</property>
>> </structure>
>> </list-property>
>> <column id="49"/>
>> <column id="50"/>
>> <column id="51"/>
>> <column id="52"/>
>> <column id="53"/>
>> <header>
>> <row id="21">
>> <property name="style">headerfooter</property>
>> <cell id="22">
>> <label id="23">
>> <text-property
>> name="text">ORDERNUMBER</text-property>
>> </label>
>> </cell>
>> <cell id="24">
>> <label id="25">
>> <text-property
>> name="text">PRODUCTCODE</text-property>
>> </label>
>> </cell>
>> <cell id="26">
>> <label id="27">
>> <text-property
>> name="text">QUANTITYORDERED</text-property>
>> </label>
>> </cell>
>> <cell id="28">
>> <label id="29">
>> <text-property
>> name="text">PRICEEACH</text-property>
>> </label>
>> </cell>
>> <cell id="30">
>> <label id="31">
>> <text-property
>> name="text">ORDERLINENUMBER</text-property>
>> </label>
>> </cell>
>> </row>
>> </header>
>> <detail>
>> <row id="32">
>> <property name="style">detail</property>
>> <cell id="33">
>> <data id="34">
>> <property
>> name="resultSetColumn">ORDERNUMBER</property>
>> </data>
>> </cell>
>> <cell id="35">
>> <data id="36">
>> <property
>> name="resultSetColumn">PRODUCTCODE</property>
>> </data>
>> </cell>
>> <cell id="37">
>> <data id="38">
>> <property
>> name="resultSetColumn">QUANTITYORDERED</property>
>> </data>
>> </cell>
>> <cell id="39">
>> <data id="40">
>> <property
>> name="resultSetColumn">PRICEEACH</property>
>> </data>
>> </cell>
>> <cell id="41">
>> <data id="42">
>> <property
>> name="resultSetColumn">ORDERLINENUMBER</property>
>> </data>
>> </cell>
>> </row>
>> </detail>
>> <footer>
>> <row id="43">
>> <property name="style">headerfooter</property>
>> <cell id="44"/>
>> <cell id="45"/>
>> <cell id="46"/>
>> <cell id="47"/>
>> <cell id="48"/>
>> </row>
>> </footer>
>> </table>
>> </body>
>> </report>
>>
>>
>> news://news.eclipse.org/eclipse.birt wrote:
>>> Thanks for the example! It helps a lot.
>>> I have a problem though. When running in the "preview" or "View report
>>> as HTML" it works well.
>>> But, it doesn't work well when running with "View report in Web Viewer"
>>> or when publishing it to the iServer.
>>> The script code doesn't run (everthing else runs well) and thus the
>>> combo is not populated. Any idea why that is and how to solve it?
>>> Cheers,
>>> Ruby
>>>
>>> "Jason Weathersby" <jasonweathersby@alltel.net> wrote in message
>>> news:fav5lf$49i$1@build.eclipse.org...
>>>> Ruby,
>>>>
>>>> There may be better ways to do what you want, but here is an example
>>>> that uses a hidden table (OnCreate script) and a hidden data element to
>>>> add script to a report to rerun a report using a combo box.
>>>>
>>>> Jason
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <report xmlns="http://www.eclipse.org/birt/2005/design"
>>>> version="3.2.14" id="1">
>>>> <property name="createdBy">Eclipse BIRT Designer Version
>>>> 2.2.0.v20070620 Build &lt;2.2.0.v20070626-1003></property>
>>>> <property name="units">in</property>
>>>> <property name="comments">Copyright (c) 2007 &lt;&lt;Your Company
>>>> Name here>></property>
>>>> <html-property name="description">Creates a blank report with no
>>>> predefined content.</html-property>
>>>> <method name="beforeFactory"><![CDATA[myopts = new Array();
>>>> ii=0;]]></method>
>>>> <text-property name="displayName">Blank Report</text-property>
>>>> <property name="iconFile">/templates/blank_report.gif</property>
>>>> <parameters>
>>>> <scalar-parameter name="ordern" id="60">
>>>> <property name="valueType">static</property>
>>>> <property name="dataType">integer</property>
>>>> <property name="isRequired">false</property>
>>>> <property name="controlType">text-box</property>
>>>> <property name="defaultValue">10101</property>
>>>> <structure name="format">
>>>> <property name="category">Unformatted</property>
>>>> </structure>
>>>> </scalar-parameter>
>>>> </parameters>
>>>> <data-sources>
>>>> <oda-data-source
>>>> extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
>>>> id="6">
>>>> <text-property name="displayName"></text-property>
>>>> <property
>>>> name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
>>>> <property
>>>> name="odaURL">jdbc:classicmodels:sampledb</property>
>>>> <property name="odaUser">ClassicModels</property>
>>>> </oda-data-source>
>>>> </data-sources>
>>>> <data-sets>
>>>> <oda-data-set
>>>> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
>>>> name="Data Set" id="7">
>>>> <structure name="cachedMetaData">
>>>> <list-property name="resultSet">
>>>> <structure>
>>>> <property name="position">1</property>
>>>> <property name="name">ORDERNUMBER</property>
>>>> <property name="dataType">integer</property>
>>>> </structure>
>>>> </list-property>
>>>> </structure>
>>>> <property name="dataSource">Data Source</property>
>>>> <list-property name="resultSet">
>>>> <structure>
>>>> <property name="position">1</property>
>>>> <property name="name">ORDERNUMBER</property>
>>>> <property name="nativeName">ORDERNUMBER</property>
>>>> <property name="dataType">integer</property>
>>>> <property name="nativeDataType">4</property>
>>>> </structure>
>>>> </list-property>
>>>> <property name="queryText">select ordernumber
>>>> from orderdetails</property>
>>>> </oda-data-set>
>>>> <oda-data-set
>>>> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
>>>> name="orderdetails" id="22">
>>>> <structure name="cachedMetaData">
>>>> <list-property name="resultSet">
>>>> <structure>
>>>> <property name="position">1</property>
>>>> <property name="name">ORDERNUMBER</property>
>>>> <property name="dataType">integer</property>
>>>> </structure>
>>>> <structure>
>>>> <property name="position">2</property>
>>>> <property name="name">PRODUCTCODE</property>
>>>> <property name="dataType">string</property>
>>>> </structure>
>>>> <structure>
>>>> <property name="position">3</property>
>>>> <property
>>>> name="name">QUANTITYORDERED</property>
>>>> <property name="dataType">integer</property>
>>>> </structure>
>>>> <structure>
>>>> <property name="position">4</property>
>>>> <property name="name">PRICEEACH</property>
>>>> <property name="dataType">float</property>
>>>> </structure>
>>>> <structure>
>>>> <property name="position">5</property>
>>>> <property
>>>> name="name">ORDERLINENUMBER</property>
>>>> <property name="dataType">integer</property>
>>>> </structure>
>>>> </list-property>
>>>> </structure>
>>>> <property name="dataSource">Data Source</property>
>>>> <list-property name="parameters">
>>>> <structure>
>>>> <property name="name">param_1</property>
>>>> <property name="paramName">ordern</property>
>>>> <property name="nativeName"></property>
>>>> <property name="dataType">integer</property>
>>>> <property name="nativeDataType">4</property>
>>>> <property name="position">1</property>
>>>> <expression name="defaultValue">10101</expression>
>>>> <property name="isOptional">false</property>
>>>> <property name="isInput">true</property>
>>>> <property name="isOutput">false</property>
>>>> </structure>
>>>> </list-property>
>>>> <list-property name="resultSet">
>>>> <structure>
>>>> <property name="position">1</property>
>>>> <property name="name">ORDERNUMBER</property>
>>>> <property name="nativeName">ORDERNUMBER</property>
>>>> <property name="dataType">integer</property>
>>>> <property name="nativeDataType">4</property>
>>>> </structure>
>>>> <structure>
>>>> <property name="position">2</property>
>>>> <property name="name">PRODUCTCODE</property>
>>>> <property name="nativeName">PRODUCTCODE</property>
>>>> <property name="dataType">string</property>
>>>> <property name="nativeDataType">12</property>
>>>> </structure>
>>>> <structure>
>>>> <property name="position">3</property>
>>>> <property name="name">QUANTITYORDERED</property>
>>>> <property
>>>> name="nativeName">QUANTITYORDERED</property>
>>>> <property name="dataType">integer</property>
>>>> <property name="nativeDataType">4</property>
>>>> </structure>
>>>> <structure>
>>>> <property name="position">4</property>
>>>> <property name="name">PRICEEACH</property>
>>>> <property name="nativeName">PRICEEACH</property>
>>>> <property name="dataType">float</property>
>>>> <property name="nativeDataType">8</property>
>>>> </structure>
>>>> <structure>
>>>> <property name="position">5</property>
>>>> <property name="name">ORDERLINENUMBER</property>
>>>> <property
>>>> name="nativeName">ORDERLINENUMBER</property>
>>>> <property name="dataType">integer</property>
>>>> <property name="nativeDataType">5</property>
>>>> </structure>
>>>> </list-property>
>>>> <property name="queryText">select *
>>>> from orderdetails
>>>> where ordernumber = ?</property>
>>>> <xml-property name="designerValues"><![CDATA[<?xml
>>>> version="1.0" encoding="UTF-8"?>
>>>> <model:DesignValues
>>>> xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
>>>> xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
>>>> <Version>1.0</Version>
>>>> <design:DataSetParameters>
>>>> <design:parameterDefinitions>
>>>> <design:inOutMode>In</design:inOutMode>
>>>> <design:attributes>
>>>> <design:name></design:name>
>>>> <design:position>1</design:position>
>>>> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
>>>> <design:nullability>Unknown</design:nullability>
>>>> <design:uiHints/>
>>>> </design:attributes>
>>>> <design:inputAttributes>
>>>> <design:elementAttributes>
>>>> <design:defaultScalarValue>10101</design:defaultScalarValue >
>>>> <design:optional>false</design:optional>
>>>> <design:masksValue>false</design:masksValue>
>>>> <design:uiHints>
>>>> <design:promptStyle>TextField</design:promptStyle>
>>>> </design:uiHints>
>>>> </design:elementAttributes>
>>>> </design:inputAttributes>
>>>> </design:parameterDefinitions>
>>>> </design:DataSetParameters>
>>>> <design:ResultSets derivedMetaData="true">
>>>> <design:resultSetDefinitions>
>>>> <design:resultSetColumns>
>>>> <design:resultColumnDefinitions>
>>>> <design:attributes>
>>>> <design:name>ORDERNUMBER</design:name>
>>>> <design:position>1</design:position>
>>>> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
>>>> <design:precision>10</design:precision>
>>>> <design:scale>0</design:scale>
>>>> <design:nullability>Nullable</design:nullability>
>>>> </design:attributes>
>>>> <design:usageHints>
>>>> <design:label>ORDERNUMBER</design:label>
>>>> <design:formattingHints>
>>>> <design:displaySize>11</design:displaySize>
>>>> </design:formattingHints>
>>>> </design:usageHints>
>>>> </design:resultColumnDefinitions>
>>>> <design:resultColumnDefinitions>
>>>> <design:attributes>
>>>> <design:name>PRODUCTCODE</design:name>
>>>> <design:position>2</design:position>
>>>> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
>>>> <design:precision>15</design:precision>
>>>> <design:scale>0</design:scale>
>>>> <design:nullability>Nullable</design:nullability>
>>>> </design:attributes>
>>>> <design:usageHints>
>>>> <design:label>PRODUCTCODE</design:label>
>>>> <design:formattingHints>
>>>> <design:displaySize>15</design:displaySize>
>>>> </design:formattingHints>
>>>> </design:usageHints>
>>>> </design:resultColumnDefinitions>
>>>> <design:resultColumnDefinitions>
>>>> <design:attributes>
>>>> <design:name>QUANTITYORDERED</design:name>
>>>> <design:position>3</design:position>
>>>> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
>>>> <design:precision>10</design:precision>
>>>> <design:scale>0</design:scale>
>>>> <design:nullability>Nullable</design:nullability>
>>>> </design:attributes>
>>>> <design:usageHints>
>>>> <design:label>QUANTITYORDERED</design:label>
>>>> <design:formattingHints>
>>>> <design:displaySize>11</design:displaySize>
>>>> </design:formattingHints>
>>>> </design:usageHints>
>>>> </design:resultColumnDefinitions>
>>>> <design:resultColumnDefinitions>
>>>> <design:attributes>
>>>> <design:name>PRICEEACH</design:name>
>>>> <design:position>4</design:position>
>>>> <design:nativeDataTypeCode>8</design:nativeDataTypeCode>
>>>> <design:precision>15</design:precision>
>>>> <design:scale>0</design:scale>
>>>> <design:nullability>Nullable</design:nullability>
>>>> </design:attributes>
>>>> <design:usageHints>
>>>> <design:label>PRICEEACH</design:label>
>>>> <design:formattingHints>
>>>> <design:displaySize>22</design:displaySize>
>>>> </design:formattingHints>
>>>> </design:usageHints>
>>>> </design:resultColumnDefinitions>
>>>> <design:resultColumnDefinitions>
>>>> <design:attributes>
>>>> <design:name>ORDERLINENUMBER</design:name>
>>>> <design:position>5</design:position>
>>>> <design:nativeDataTypeCode>5</design:nativeDataTypeCode>
>>>> <design:precision>5</design:precision>
>>>> <design:scale>0</design:scale>
>>>> <design:nullability>Nullable</design:nullability>
>>>> </design:attributes>
>>>> <design:usageHints>
>>>> <design:label>ORDERLINENUMBER</design:label>
>>>> <design:formattingHints>
>>>> <design:displaySize>6</design:displaySize>
>>>> </design:formattingHints>
>>>> </design:usageHints>
>>>> </design:resultColumnDefinitions>
>>>> </design:resultSetColumns>
>>>> </design:resultSetDefinitions>
>>>> </design:ResultSets>
>>>> </model:DesignValues>]]></xml-property>
>>>> </oda-data-set>
>>>> </data-sets>
>>>> <styles>
>>>> <style name="crosstab" id="4">
>>>> <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-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="detail" id="57">
>>>> <property name="backgroundColor">#BACAE2</property>
>>>> <property name="fontFamily">"Arial"</property>
>>>> <property name="fontSize">small</property>
>>>> <property name="paddingTop">0px</property>
>>>> <property name="paddingLeft">0px</property>
>>>> <property name="paddingBottom">0px</property>
>>>> <property name="paddingRight">0px</property>
>>>> </style>
>>>> <style name="headerfooter" id="58">
>>>> <property name="backgroundColor">#004080</property>
>>>> <property name="fontFamily">"Arial"</property>
>>>> <property name="fontSize">small</property>
>>>> <property name="fontWeight">bold</property>
>>>> <property name="color">#FFFFFF</property>
>>>> </style>
>>>> <style name="groupheader" id="59">
>>>> <property name="backgroundColor">#0080FF</property>
>>>> <property name="fontFamily">"Arial"</property>
>>>> <property name="fontSize">small</property>
>>>> <property name="fontWeight">bold</property>
>>>> <property name="color">#FFFFFF</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>
>>>> <table id="9">
>>>> <property name="width">100%</property>
>>>> <property name="dataSet">Data Set</property>
>>>> <list-property name="visibility">
>>>> <structure>
>>>> <property name="format">all</property>
>>>> <expression name="valueExpr">true</expression>
>>>> </structure>
>>>> </list-property>
>>>> <list-property name="boundDataColumns">
>>>> <structure>
>>>> <property name="name">ORDERNUMBER</property>
>>>> <expression
>>>> name="expression">dataSetRow["ORDERNUMBER"]</expression >
>>>> <property name="dataType">integer</property>
>>>> </structure>
>>>> </list-property>
>>>> <column id="16"/>
>>>> <header>
>>>> <row id="10">
>>>> <cell id="11">
>>>> <label id="17">
>>>> <text-property
>>>> name="text">ORDERNUMBER</text-property>
>>>> </label>
>>>> </cell>
>>>> </row>
>>>> </header>
>>>> <detail>
>>>> <row id="12">
>>>> <method name="onCreate"><![CDATA[myopts[ii] =
>>>> this.getRowData().getColumnValue(0);
>>>> ii++;]
Previous Topic:BIRT CHART spec Drill Down functionality.
Next Topic:Empty Column in Excel Output
Goto Forum:
  


Current Time: Mon Apr 28 03:03:11 EDT 2025

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

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

Back to the top