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)
Report Footer text
Mikey71
<p>Hi,</p>
<p> </p>
<p>I need to output a block of text on the <u>bottom</u> of the last page of a report. This would normally be implemented as a report footer text block aligned with the bottom of the page. How can I implement this in BIRT as I cant seem to find a report footer option?</p>
<p> </p>
<p>I would like the output to be PDF and we would not be using the BIRT viewer to present the report. BIRT version is 371.</p>
<p> </p>
<p>Many thanks for you help.</p>
<p>Mike</p>
Find more posts tagged with
Comments
micajblock
<p>You are correct, there is no OOTB report footer. However with a simple piece of code you can create one. On the label on the bottom of my master page I have this code:</p>
<div>
<pre class="_prettyXprint">
if (pageNumber == totalPage) {
this.text = "Report Footer";
}</pre>
<p>I am attaching the sample I built using Classic Models</p>
</div>
<p> </p>
Mikey71
<p>Thanks for your reply. We did some testing and it appears that <span>pageNumber and</span><span> totalPage always returns the same value driven by the current page number. So:</span></p>
<p> </p>
<p><span>page1 : pageNumber=1 totalPage=1</span></p>
<p><span><span>page2 : pageNumber=2 totalPage=2</span></span></p>
<p><span>...</span></p>
<p> </p>
<p><span>Also, in some cases a PDF page can be thrown but the pageNumber and totalPage variables do not increment as expected. </span><span>So for us we cant use this logic as the statement you provided is always true.</span></p>
<p> </p>
<p><span>Maybe there is a difference in how this is implemented in BIRT versions. We are using v3.7.1.</span></p>
<p> </p>
<p><span>So are there any other methods of implementing a report footer text block in PDF?</span></p>
micajblock
<p>A few questions.</p>
<ol><li>Did you try the example I sent?</li>
<li>How are you running the report?</li>
<li>Did you put the code in the onRender event?</li>
</ol>
Mikey71
<ol><li>Did you try the example I sent? <strong><em>I couldnt as it was not compatible with the BIRT version that we have, I did look at the XML code though so I understand what you did.</em></strong></li>
<li>How are you running the report? <strong><em>From within the developer gui. Exported to PDF.</em></strong></li>
<li>Did you put the code in the onRender event? <strong><em>Yes.</em></strong></li>
</ol><p>The autoText method of handling the page numbers does work correctly so is it possible to reference these variables either directly or via assignments?</p>
micajblock
<p>Please run the report to the web viewer and export to PDF from the viewer and tell me if that works.</p>
micajblock
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;font-size:14.4444446563721px;">BTW, you can open my design by making this change, Open one of your designs in XML Source and my report in a text editor copy the 2nd and 3rd line from your design and replace these 2 lines:</p>
<div style="margin:0px;color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;font-size:14.4444446563721px;">
<pre class="_prettyXprint">
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23" id="1">
<property name="createdBy">Eclipse BIRT Designer Version 4.2.3.v20131216-0430 Build <4.2.3.v20131216-0430></property></pre>
<p><span style="font-size:14.4444446563721px;">Then you should be able to open the report.</span></p>
</div>
Mikey71
<p>Hi, Yes the report footer works ok from the web viewer. Seems like its an issue with the BIRT developer execution. Also, thanks for the info on using different BIRT versions.</p>
micajblock
<p>From the designer some use the runandrender task which will not work with my code. You need to use the run task then the render task (recommended anyway). Hence I asked web viewer first then PDF to force the 2 separate tasks. </p>