Solved LAST_PAGE in Report Builder

Discussion forum about all things Report Builder (all versions).
pnkFloyd

LAST_PAGE in Report Builder

Post by pnkFloyd » 15 Mar 2016, 13:16

I want to print PageFooter block only on the last page of report. If I use LAST_PAGE variable (I just put it in Conditional display formula) it does not always work correctly - sometimes it works OK, sometimes it does not print PageFooter block on any page, even on the last one. As a workaround I use PageNumber() and TotalPages() functions which works more correctly:

NumberIFF( 1-TotalPages(), NumberIFF( PageNumber()-TotalPages() , 0, 1, 1), 1, 1) - that formula returns 1 for the last page, and 0 otherwise.

So, I wanted to ask why LAST_PAGE does not always work as expected? Or maybe I am using it wrong way?

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2370
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: LAST_PAGE in Report Builder

Post by Jeff Luther » 15 Mar 2016, 18:01

I am confused, so let me comment to help clarify:
** You wrote:
I want to print PageFooter block only on the last page of report.
As I am sure you know, PageFooter is for the foot of every page, with one clarification:
>> If there is no ReportFooter defined in your report, then PageFooter is also printed on the last page, otherwise the ReportFooter section is printed on the last page.

** ReportRooter - this is the section where you would have any line(s) of items you want printed on the last page.

** You wrote:
I use LAST_PAGE variable
You mean you defined a formula whose name is "LAST_PAGE"? If so, what is that formula? There is no LAST_PAGE variable in RB. Maybe you mean you defined LAST_PAGE as an Input Variable? If so, how do you set it in your TD appl?
Or... is
NumberIFF( 1-TotalPages(), NumberIFF( PageNumber()-TotalPages() , 0, 1, 1), 1, 1)
the formula for your LAST_PAGE item?
Jeff Luther @ PC Design
Palm Springs, California

pnkFloyd

Re: LAST_PAGE in Report Builder

Post by pnkFloyd » 16 Mar 2016, 08:01

Thank you very much for your very informative reply. I do not have much experience with Report Builder because I only support support some reports made by third company. And in all of them I saw that variable LAST_PAGE, so it made me think it was build-in variable. After your post I realized it was created by that third company. So it must be some mistake in their code but I can't find how to edit it. Whenever I select this variable in input variables list and right click, it shows only three options - New, Delete and Properties. So I select Properties and it just opens Format Variables window where you can only select OK, Cancel, Reset, New, Apply and Delete - I can't see any possibility to edit it. Is there any possibility to edit it?

And thank you for the info about footers. Actually I didn't know about the difference between PageFooter and ReportFooter. On the most of our reports (made by that third company) there is a PageFooter defined with almost all fields defined as StrIff(LAST_PAGE, "", "", "some info"). And there is no Report Footer defined (it is just empty). So I need to just move all the info from PageFooter to ReportFooter, removing that StrIff(LAST_PAGE...).

Is there any good tutorial on Report Builder? Because the one I found (Team Developer 6.2 In-Build Help) does not supply much info - only very general.
Thank you in advance.

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2370
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: LAST_PAGE in Report Builder

Post by Jeff Luther » 16 Mar 2016, 17:17

I can't find how to edit it. Whenever I select this variable in input variables
There's the clue right there: If it's listed in Input Variables then it's a value that's coming from their application which is calling the report. Assuming you don't have the TD source, maybe the best thing is to ignore LAST_PAGE and use your own formula. Be sure not to delete the L_P input var; otherwise, it will break the interface between the appl. and the QRP file!

I also have a v6.2 copy of the report.pdf book I've attached. It looks to the a PDF version of the online "Documentation" in my link just above. The topic on Input Variables is on pg. 16 of the PDF file.
You do not have the required permissions to view the files attached to this post.
Jeff Luther @ PC Design
Palm Springs, California

pnkFloyd

Re: LAST_PAGE in Report Builder

Post by pnkFloyd » 18 Mar 2016, 13:27

Thank you, Jeff! Now I understand why this variable is listed together with database variables. So I will ignore this variable and use my own formula which I mentioned on a first post.
And thank you for the documentation.

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests