Home
Analytics
Scripting BIRT
kosta
Hello BIRT community,<br />
<br />
I have several question.<br />
<br />
<strong class='bbc'><span style='font-size: 12px;'>Setting parameter value</span></strong><br />
<br />
I know I can read the report parameter value in the "Script" view like the following code: <pre class='_prettyXprint _lang-auto _linenums:0'>params["myparam"].value</pre> I have also tried to set the value with <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>params["myparam"].value = "test"</pre> in the "open"-method of the data set, but that doesn't work. <br />
<br />
1. Can the paramater value be modified in the script view?<br />
<br />
<br />
<strong class='bbc'><span style='font-size: 12px;'>Java object to access a data source</span></strong><br />
<br />
On the page 269 of the book "Extending and Integrating BIRT" I saw that an object can be instantiated and pass to the reporting engine. <br />
<br />
2. Does that means that the methods to get the data from the java object to pass them to the script object can be non-static?<br />
<br />
3. Can the data structure of the returned data to the script be more complex like nested arrays or a combination of some strings and arrays. <br />
The example in the book (p. 226) is an array of self made objects but I want to return more complex data structures.<br />
<br />
Thanks in advance,<br />
Kosta
Find more posts tagged with
Comments
JasonW
Kosta,
You can set the parameter in the open but the change will only show up after a table/list/chart actually uses the dataset. See attached example.
2 - yes.
3 - yes, but you will need to use the importPackage line to manipulate the complex objects. ie
importPackage(Packages.org.eclipse.birt.samples.scripted.hibernate)
var tst = new MyTestObject();
Jason
kosta
Hi Jason,
I 've tried to output the parameter values before the table (which uses the data set). That's why it hasn't worked for me. :huh:
Thank you,
Kosta