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)
Table Grouping Totals with auto Page Break
ATirumalas
The attached report covers the following aspects.
- Displays Name, CreditLimit, and "Percent of Grand Total"
- There is a Group on the table, the aim is to display the "Grand Total" at the end on Every page.
- The same is displayed in all formats, except when exported to Excel, the Grouped Grand Total should be displayed only at the last.
The Grouping is done by restricting the number of lines at "30" records in a table and then Grouped condition "rownum" Interval as 30. (Output_01.pdf)
Issue ((Output02.pdf):
- There are some records which extend more than one line and hence exceeds the number of lines to more than 30 in a single page.
- This is causing the "Grand Totals" to slip to next pages, and everything is disturbed.
Please suggest a logic where I can get the "Grand Totals" on every page, without having to put a restriction on number of rows for the grouped item.
* PS: I want the "Grand Totals " as part of the table and not within the footer.
Please let me know if you need any more information.
BIRT VERSION : Juno - 4.2
Thanks!!
Find more posts tagged with
Comments
ATirumalas
Or in Simple Words - (Slightly Different Report)
A Table contains multiple pages results.
The data in each row might extend for more than one line. (so no clue on how many rows in a page to group them up)
The Sum Total of all records should be displayed at the end of each pages - as part of the table. (not as fotter)
kclark
I downloaded your rptdesign, I double clicked your aggregate and changed it from TABLE to GROUP.
ATirumalas
<blockquote class='ipsBlockquote' data-author="'kclark'" data-cid="109849" data-time="1348689495" data-date="26 September 2012 - 12:58 PM"><p>
I downloaded your rptdesign, I double clicked your aggregate and changed it from TABLE to GROUP.<br /></p></blockquote>
<br />
Sorry, I am not sure of the solution provided.<br />
1. If you edit the Table Group, I mention that the Grouping is interval at 30 records. I set the Page Break on the Table at 30. <br />
<br />
Does your solution remove the dependency of mentioning 30 as interval and provide the totals at the end - @ page end - irrespective of number of records in each page?<br />
<br />
I do not want to set the Group Interval as 30. To make it simple, I removed the Visibility part from the report design attached now. I made a small amendment to show my requirment, please run the report now and you will notice that since I mentioned 30 as Grouping and Page-break and the record extends more than one line sometimes, the Grouped Totals slip and get distorted. So the totals should be appearing as part of the table, and at the end of everypage.<br />
<br />
Please let me know if you need any more information.<br />
<br />
Cheers!!
kclark
I'm sorry I must have misunderstood the question
I used <a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1247-page-totals-using-page-variables/'>this
devshare</a> to display the total at the bottom of each page.<br />
<br />
I used the following code to loop through each row in amtElement and add it to my total.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var qtys = this.getInstancesByElementName("amtElement"); // 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("pageqty",tmp); // Add our total to the page variable at the footer
</pre>
<br />
That needs to go in onPageEnd for the master page. Now you said you don't want it to be in the footer, why's that? If you run the attached report in web viewer it should display how you were wanting it to.
ATirumalas
Thanks for your response.
Sorry, but this is not "MY" requirement. I am just a developer :blink:
I already provided following 3 solutions:
1) Totals as Footor at end of the Page
2) Totals in the Header of the Page
3) Totals in the "Group Header" within the Table.
The requirement is to have the Totals at the "end of Table" on each page. So to have the number within the table (as part of the table), I have to use the "Group Footer". The only way to tell the "Group Footer" is by giving an Interval set using rownum and pagebreak. This is causing all pages to have limited number of rows and huge empty space when records are not multilined.
Since, the number of records in each page are different, I am stuck with no logical solution in hand.