Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Set Default value of Birt parameter with data from dataset
basami
<p>Hi,</p>
<p> </p>
<p>It is possible to set the default value of a parameter with data provided by a dataset?</p>
<p> </p>
<p>I need that the parameter takes a default value from my dataset in order to use this parameter to select data of another dataset.</p>
<p> </p>
<p>Thanks in advance for any help</p>
<p> </p>
Find more posts tagged with
Comments
Clement Wong
<p>Attached is one solution.</p>
<p> </p>
<p>There's just one line of code in the onFetch of the first data set to set a variable to the output you want to save.</p>
<pre class="_prettyXprint">
myCustomer = row["CUSTOMERNUMBER"];</pre>
<p>Then in the second dataset, the SQL is SELECT * FROM ORDERS WHERE CUSTOMERNUMBER = ?, and we update the Data Set Parameter and set the expression to "myCustomer;".</p>
<p> </p>
<p>I had posted a previous example (<a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/35044-using-the-output-of-one-dataset-as-parameters-to-another-dataset-in-a-chain/?p=129985'>http://developer.actuate.com/community/forum/index.php?/topic/35044-using-the-output-of-one-dataset-as-parameters-to-another-dataset-in-a-chain/?p=129985</a>)
that used a report variable instead to save the value. </p>
<p> </p>