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)
Wrong value for total per page
QDeca
<p>Hello,</p>
<p> </p>
<p>I've created a report that displays a total per page in the footer of the masterpage. The problem is, the total itself is inconsistent with the displayed columns for a given page.</p>
<p> </p>
<p>I've re-created the issue in a basic report using the Classic Models, and attached this report to the post. </p>
<p>When I run it (in web viewer because in pdf it won't work because of a run+render issue if I've understood that right), the page total of my first page includes 2 rows of the 2nd page.</p>
<p> </p>
<p>Is this a known issue? I use the 4.4.1 version of the BIRT designer.</p>
<p> </p>
<p>Thanks in advance for your answers.</p>
Find more posts tagged with
Comments
Clement Wong
<p>You can use this <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/files/file/421-page-totals-using-page-variables/'>DevShare
</a>as an example to display totals. I've modified your design based on the <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/files/file/421-page-totals-using-page-variables/'>DevShare</a>
, and it is working correctly now.</p>
<pre class="_prettyXprint">
var qtys = this.getInstancesByElementName("qtyInStock"); // This is the column that we will keep a running total of
var tmp = 0; // This is our temp counter
if(qtys != null) { // Make sure that our column has data in it
for(var i=0; i<qtys.length; i++) { // Start looping down the column that we need to total
var qty = qtys[i]; // qty equals the current data in the loop
tmp += parseInt(qty.getValue()); // add qty to our temp counter
}
}
reportContext.setPageVariable("PageQuantity",tmp); // Add our total to the page variable at the footer</pre>
QDeca
<p>I had trouble making the DevShare work but I worked it out thanks to the corrected report you attached, thanks a lot !</p>
<p>The trick was to "Name" the Data object (I was just using the column name in the Data set definition) for the getInstancesByElementName method.</p>