Home
Analytics
Show footer only last Page PDF problem
rachata
Hi
Could you please give me the solution or example for display footer only last page in PDF directly?
I use Birt Report 2.6.2.and php call birt report.
I found some solution in these forum.
Example
use script below at onRender in grid footer
if (BirtComp.lessThan(pageNumber, totalPage))
{
this.getStyle().display = "NONE";
}
It's not work if I view report as PDF.However It's correct when I view in web viewer.
and Export to PDF it'ok.
I would like to know what happen!! How the solution for view direct to PDF?
Find more posts tagged with
Comments
mwilliams
Have you tried deploying it and running it in pdf with the url parameter __format=pdf? The runAndRender vs the runThenRender tasks may be different than just running PDF from the designer.
rachata
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="75344" data-time="1301605766" data-date="31 March 2011 - 02:09 PM"><p>
Have you tried deploying it and running it in pdf with the url parameter __format=pdf? The runAndRender vs the runThenRender tasks may be different than just running PDF from the designer.<br /></p></blockquote>
<br />
I've already run with url parameter __format=pdf It same the result.<br />
Do you have any idea or resolve this issue?
mwilliams
Did you use "frameset" or "run" in your URL?
rachata
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="75371" data-time="1301666307" data-date="01 April 2011 - 06:58 AM"><p>
Did you use "frameset" or "run" in your URL?<br /></p></blockquote>
I use "run" as below <br />
<br />
<a class='bbc_url' href='
http://localhost:8080/birt-viewer/run?__report=report001.rptdesign&__format=pdf&idctrlno=CTRL540300002'>http://localhost:8080/birt-viewer/run?__report=report001.rptdesign&__format=pdf&idctrlno=CTRL540300002</a>
;
mwilliams
Try replacing run with frameset and see what happens then. Let me know.
rachata
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="75378" data-time="1301667630" data-date="01 April 2011 - 07:20 AM"><p>
Try replacing run with frameset and see what happens then. Let me know.<br /></p></blockquote>
<br />
It's work! Thank you for your advice.
mwilliams
Not a problem. Glad to help. Let us know whenever you have questions!
kkan
Hi i have read many posts on this problem and have also implemented the solution
if(BirtComp.lessThan(pageNumber,totalPage))
{
this.getStyle().display="NONE";
}
to display footer text on last page only. However for some weird reason this does not work. also i have an image on grid on master Page and have set condition
if (pageNumber>1)
{
this.getStyle().display = "none";
}
but again this does't work it however it works in the example i downloaded from this forum..it shows image on first page only..
The footer problem is one I need to really understand why it is not working as this is an issue that will crop up once we start actually using BIRT for reports!!
your help is very much appreciated
BIRT11
kkan
Hi,
I forgot to mention I am using version 2_6_2 and am trying to view the report as a PDF
Thanks
kkan
also like to add I noticed that total pages = 0 ?!!
when there are at least 2 pages when shown as PDF
mwilliams
If you set the layout of the report to "fixed" rather than "auto" it works for the last page thing. The show the header image on the first page only doesn't seem to work though. I think this might be fixed in version 3.7 that comes out soon.
kkan
Morning - Thanks for reply -question re: fixed layout..would that not affect the Grid form being displayed in master page..because with auto layout i am able to adjust height/width..will give it go
Thanks
kkan
Morning -
tried the solution as suggested but no change.. could the grouping have something to do with it..also why is total page always 1 (not 0 as i reported yesterday!!)
I have no change in output - could you possibly attach your version with working solution.. ?
thanks
mwilliams
Be sure to run the report in the web viewer and export to PDF from there. This will show you how it will run when you deploy the viewer and use frameset and format=pdf in your report url.
kkan
Hi these PDF will be generate via a Java app.. will the same results be generated as seen by web viewer.. also i found this rpt which shows header on first page only..how come this works here but when i appy same it doesn't..am so confused by different ways of implementation...
mwilliams
It should work when you run from your java app as long as you use separate run and render tasks. Let me take a look at the first page issue. I'll let you know what I see.
kkan
cool - I've just spoken to Java developer and they have confirmed they'l be using run and render tasks.
mwilliams
If I copy your table and paste it under the original one so that there are 2, it extends to a third page and neither works. The other report works because it has a page break interval of 30 set on the table, so the page breaks are guaranteed to work correctly. Yours is based on page size alone and there seems to be a bug with the pageNumber and this setup. I'm going to download the latest stable build of the next version and I'll check it out in that version. I have heard this issue is resolved in it. I'll let you know.
kkan
Morning,
Thanks for reply.. ideally if layout can be auto so that no images are cropped as well as header/footer condition can work that would be PERFECT!!
Thanks again and hope to hear soon re: resolution!!
mwilliams
Good news, both the first page only and the last page only items both work in BIRT 3.7.0 in the watermark.rptdesign file that you attached when exported from the web viewer to PDF.
kkan
wow! that is good news - Will we all be getting 3.7 on 22 June??? is that correct
mwilliams
Right now you can go to the eclipse.org/birt site and download the 3.7.0RC3 if you want to check it out! Then you can just replace it when the final release is put out. It should be soon!