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)
Master page footer is written before Page Variable calculated in PDF
bryan@osp
<p>Hi all,</p>
<p>I am new to the BIRT Report.</p>
<p>I am writing a payment report that can show the total payment counts and the total amount of each page.</p>
<p>Also, the total amount of each group will be displayed as well when the group has ended.</p>
<p>Therefore, at the footer goes like</p>
<div>Seq | Client | Client's Name | Amount</div>
<div>1 078954390 JACQUELINE 48.95</div>
<div> Total: 1 Payment(s): 48.95</div>
<div> Total Payment of Page: 1 Payment(s): 48.95</div>
<div> </div>
<div>For the first total (count by group), I used aggregation to the sum all the rows.</div>
<div>The second total (count by page), I use page variable to gather the sum of the number in the table and showing in the master page footer.</div>
<div> </div>
<div>I put the script in onPageEnd like below:</div>
<div> </div>
<div><br><div>var amounts = this.getInstancesByElementName("AMOUNT");</div>
<div>var amount_total = 0;</div>
<div>if(amounts != null){</div>
<div>for(var i=0; i < amounts.length; i++){</div>
<div> <span> </span>var amount = amounts
;</div>
<div> <span> </span>amount_total += parseFloat(amount.getValue());</div>
<div>}</div>
<div> </div>
<div>reportContext.setPageVariable("total_page_amount", amount_total);</div>
<div>}</div>
<div> </div>
<div> </div>
<div>Everything looks fine in the Web Browser preview.</div>
<div>However, when I exporting to PDF, the number of master page footer get postponed.</div>
<div>Therefore, the first page footer is like: </div>
<div> </div>
<div><br><div>Total Page: Paiement(s):</div>
<div> </div>
<div>And the second page will show the totals of the first page:</div>
<div> </div>
<div><br><div>Total Page: 1 Paiement(s): 48.95</div>
</div>
</div>
<div> </div>
<div> </div>
<div>It seems like, in PDF format, the footer is written before the amount has been calculated.</div>
<div> </div>
<div>Is there any alternative solution that I could solve this?</div>
<div> </div>
<div> </div>
<div>Thank you in advance,</div>
<div>Bryan</div>
<div> </div>
</div>
Find more posts tagged with
Comments
There are no comments yet