Home
Designing Analytics Reports
Using variable for passing values in birt report
Migrateduser
<p>Hello.<br>
I'm creating a report, in which I need to calculate a value of 2 fields, compare it to a 3.rd one. Depending on the values, I need to calculate a value and pass it to the next row and repeat the calculations there.</p>
<p> </p>
<p>I desperately need some help. I already thought I had this solved, but as I ran the report again, the report doesn't produce any result set. Although the main data set preview shows the correct collection of dataset rows..</p>
<p> </p>
<p>I checked the table shouldn't contain any extra bindings and there are no visibility issues.</p>
<p>
Now, I created:</p>
<p>1) global variable "jaannos"</p>
<p>2) I copy the dataSetRow value "SUMMA" to the global variable in Main data sets onFetch -script as follows:</p>
<p>vars["jaannos"] = dataSetRow["SUMMA"].value;</p>
<p>* In the main table I computed the value like this:</p>
<p>if((row["LIIKAMAKSU"].value + row["KULUKORVAUS"].value) < vars["jaannos"].value)<br>
{<br>
(row["LIIKAMAKSU"].value + row["KULUKORVAUS"].value)<br>
}<br>
else {<br>
vars["jaannos"]<br>
}</p>
<p>3) I count the remaining value, if any like this to another dedicated field:</p>
<p>if((row["LIIKAMAKSU"].value + row["KULUKORVAUS"].value) < row["Muuttujan_arvo"].value)<br>
{<br>
row["Muuttujan_arvo"].value - (row["LIIKAMAKSU"].value + row["KULUKORVAUS"].value)<br>
}<br>
else {<br>
0<br>
//vars["jaannos"]<br>
}</p>
<p>4) I replace the global variable value with the remaining value like follows:</p>
<p>vars["jaannos"].value = row["Seur_rivi"].value;</p>
<p> </p>
<p>The points 2-4 are used as data fields expression formulas..</p>
<p> </p>
<p>RESULT:</p>
<p>No values appear in the report.</p>
<p> </p>
<p>Do you have any idea where the problem might be?</p>
<p> </p>
<p>- Elja</p>
Find more posts tagged with
Comments
There are no comments yet