Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Footer at bottom of last page only in BIRT PDF report
Footer at bottom of last page only in BIRT PDF report [message #685934] Mon, 20 June 2011 20:48 Go to next message
Preeti  is currently offline Preeti Friend
Messages: 7
Registered: June 2011
Junior Member
I developed a pdf report in BIRT 2.3.2 and I would like to have Footer only on last page. I tried below script but it works only for report in Web Viewer, I need to generate in PDF format only. I tried the hide visibility option as well but nothing worked.

if(BirtComp.lessThan(pageNumber, totalPage))
{
this.getStyle().display = "NONE";
}

Any suggestion will be appreciated.
Report message to a moderator
Re: Footer at bottom of last page only in BIRT PDF report [message #686079 is a reply to message #685934] Tue, 21 June 2011 15:50 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I just tested this:
if(pageNumber!=totalPage){
this.getStyle().display ="none"
}
with 2.3.2 and it works as long as you are uses two task to create the pdf. A run task then a render task. How are you running the report?

Jason
Re: Footer at bottom of last page only in BIRT PDF report [message #686088 is a reply to message #686079] Tue, 21 June 2011 16:06 Go to previous messageGo to next message
Preeti  is currently offline Preeti Friend
Messages: 7
Registered: June 2011
Junior Member
My requirement is just run as PDF, we do not follow the approach to first run in web viewer and then export it to pdf.
Re: Footer at bottom of last page only in BIRT PDF report [message #686100 is a reply to message #686088] Tue, 21 June 2011 17:45 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Are you using the viewer? or a custom servlet? If you use a custom servlet you can use the api to run task to create a rptdocument and then render it in pdf with a rendertask.

Jason
Re: Footer at bottom of last page only in BIRT PDF report [message #686114 is a reply to message #686100] Tue, 21 June 2011 18:53 Go to previous messageGo to next message
Preeti  is currently offline Preeti Friend
Messages: 7
Registered: June 2011
Junior Member

We are using viewer, and viewing report as PDF only.

I did try the onRender script below but it looks like the totalPage variable is not quite right, its showing result same as pageNumber.
if(pageNumber == totalPage)
{
this.text = "END OF REPORT";
}
else this.text = "";

Is there any way I can get the actual totalPage variable for PDF emitter since totalPage is working in HTML.
Re: Footer at bottom of last page only in BIRT PDF report [message #686663 is a reply to message #686114] Wed, 22 June 2011 17:17 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Are you using the /frameset mapping with __format=pdf?
http://127.0.0.1:52472/viewer/frameset?__report=C%3A%5Cwork%5Cworkspaces%5C2.3.2workspaces%5CBIRT+-+Reports%5CBirtEventHandlersReports%5Cbook%5Cscript%5Cmasterpage%5Cfirstpageonly.rptdesign&__format=pdf&__svg=true&__locale=en&__timezone=US%2FMichigan&__masterpage=true&__rtl=false&__cubememsize=10&__resourceFolder=C%3A%2Fwork%2Fworkspaces%2F2.3.2workspaces%2FBIRT+-+Reports%2FBIRT+Reports%2Fresources%2F&__dpi=96&-1084488416

Jason
Re: Footer at bottom of last page only in BIRT PDF report [message #687600 is a reply to message #686663] Wed, 22 June 2011 20:12 Go to previous messageGo to next message
Preeti  is currently offline Preeti Friend
Messages: 7
Registered: June 2011
Junior Member
Is there any way I can get the actual variable name for totalPage, which i can use in script?

Is there any way I can position my END OF REPORT label(In layout) to at the bottom of the page using style sheet. The postion feature is not working inside birt layout.

We are not running reports through web app, can not use frameset mapping. Evetually we will be having a custom servlet where i need to have seperate run and render task, that might be the last option.

Any help, suggestion, opinion will be greatly appreciated.
Re: Footer at bottom of last page only in BIRT PDF report [message #687705 is a reply to message #687600] Thu, 23 June 2011 03:52 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You could add two computed columns, one that contains current row count and another that has the total number of rows. You could store these values in the oncreate of the table row and check them in you header/footer script. If totalrows-currentrow > pageBreakInterval (for the table) you know you will have more pages.

See attached example.

Jason
Re: Footer at bottom of last page only in BIRT PDF report [message #687712 is a reply to message #687705] Thu, 23 June 2011 04:13 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

besides the last post you could try:
set the report to fixed layout (general properties for the report) and put everything in the report in a two row grid and size the grid to your page size.
Put the last page footer in the second row and size it accordingly. Also set align bottom on second row of grid. See attached example.
Also notice I cleared the header and footer height on master page.

Jason
Re: Footer at bottom of last page only in BIRT PDF report [message #691156 is a reply to message #687712] Thu, 30 June 2011 20:26 Go to previous messageGo to next message
Preeti  is currently offline Preeti Friend
Messages: 7
Registered: June 2011
Junior Member
How do I size the grid to my page size.Where does it show the page size?
Re: Footer at bottom of last page only in BIRT PDF report [message #691515 is a reply to message #691156] Fri, 01 July 2011 16:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Click on the master page tab an you can set the size of the page there.

Jason

On 6/30/2011 4:26 PM, Preeti wrote:
> How do I size the grid to my page size.Where does it show the page size?
icon10.gif  Re: Footer at bottom of last page only in BIRT PDF report [message #1693944 is a reply to message #685934] Wed, 29 April 2015 12:21 Go to previous message
Rob Ducker is currently offline Rob DuckerFriend
Messages: 1
Registered: April 2015
Junior Member
Hi Does anyone have the last posted attachment handy ? the link is dead on the post.
Previous Topic:BIRT 4.2.2 blank PDF pages
Next Topic:Error: Connection is not open.
Goto Forum:
  


Current Time: Fri Apr 26 02:32:09 GMT 2024

Powered by FUDForum. Page generated in 0.03814 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top