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)
Problems Using GlobalVars in Report - Really important and urgent : (
smgomes
Hi,
in script report at initiliaze method i had :
reportContext.setGlobalVariable("total",0);
My report contains a Table grouping by article code.
In GroupHeader i had two labels, one to show the Article code (Label#1) and another to show Article description (Label #2).
In Label#1 in Visibility (fx) i had this code:
false;
reportContext.setGlobalVariable("total",0);
For each Group i want the total variable reset to 0. and it works fine.
In my Table Details i had 3 columns:
Column#1 : Number of Article's IN
Column#2 : Number of Article's OUT
Column#3 : Acumulator (Data component)
Example:
row#1: In:0 Out: 3 Acumulator: -3
row#2: In:0 Out: 5 Acumulator: -5
row#3: In:4 Out: 0 Acumulator: -1
Acumulator is a Data Component in fx i had this:
var temp1 = dataSetRow["in"] - dataSetRow["out"];
var temp2 = parseFloat(reportContext.getGlobalVariable("total") + temp1);
reportContext.setGlobalVariable("total", temp2);
//show the actual value of total
reportContext.getGlobalVariable("total");
My problem is:
Acumulator always show -3 as value!! Why ? Can u help me solve this problem? Or give me another way to do this report.
Thanks.
Version BIRT:2.3
Find more posts tagged with
Comments
mwilliams
Hi smgomes,
Can you recreate this issue with the sample database or with a flat file database with your own sample data? I don't see the same the way I set it up. Are you using 2.3.0 or 2.3.something else?
smgomes
Thanks mwilliams, i solve my problem : ) !
I don't need more help for this problem, it's solved.
BIRT: 2.3.2 Eclipse plugins
Just one question.. what's the diference using: datasetRow["x1"] or row["x1"], can u explain me?
Thanks
johnw
Its a scoping question. Datasetrow is a reference to the dataset itself. Typically this should only be used when creating a binding.
row["x1"] refers to a column binding in the container (table, list, etc) called x1. This could be a reference to a datasetrow, an aggregation, computed column, etc.
In either case, if your are using a table and just iterating through results, you "should" be able to use either with no penalty.
Or do I have that backwards in my head...