Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
data item vs dynamic text
mcnamara7
I have this code in a dynamic text box that works fine:
var tot = cof_org_oct_subtotal;
cof_org_oct_subtotal = 0;
tot.toFixed(2);
where cof_org_oct_subtotal is a global variable. The variable tot gets a copy of cof_org_oct_subtotal and then resets it to zero.
When I put the same code in a data item, the variable tot then gets a reference to cof_org_tot_subtotal rather than a copy and of course displays 0.
Why does a data box treat it as a reference and dynamic text treat it as a value? I would like to use a data box so that when I output to Excel, the value will be a number instead of text. I am using version 2.3.1.
Find more posts tagged with
Comments
mwilliams
Hi mcnamara7,
Where are you setting/incrementing the global variable? It may be easiest to see what the issue is if you attach a report design created with the sample database with this issue in it so I can see how you have everything set up and be able to run it. Or at least attach your report design so I can just see how you did everything so I can try to reproduce it.
mcnamara7
The report lists monthly costs of projects and lists direct costs and co-funded costs which are subtotaled by organization and category.
The variable cof_org_oct_subtotal is being incremented in a subreport table (cofund_table) in the field cof_oct_data. The value is then displayed in the footer of a group (org_group) in the field cof_oct_subtotal_text and reset.
I have a test data field called cof_oct_subtotal_data with the same code as cof_oct_subtotal_text (of course editing one or the other depending on which you are going to use so that cof_org_oct_subtotal is only reset in one of the fields).
mwilliams
mcnamara7,
For some reason I am unable to open your report design in BIRT 2.3.1. It will show me the XML with errors in it, but will not open the design layout.
mcnamara7
maybe this is better.