Page footer on the last page

By: Victor Gieci - drummer
Page footer on the last page
2003-04-23 01:06
Hello, can anyone help me with this problem?

I would like to display page footer ONLY on the very last page of the report. Summary does not do the job as it is displayed right after the detail section (not always at the bottom). I did some experiments with printWhenExpression element, but I wasn't able to get what I need. In fact, I guess it is not even possible, but if I'm wrong, I would really like to know the solution. Thanx ahead.

By: Chuck Deal - cdeal
RE: Page footer on the last page
2003-04-23 05:25
I use the following snippet of XML to create a dummy group. If you changed the groupHeader tags to be groupFooter tags, then you should get what you desire.

<variable name="PrintDate" class="java.util.Date" calculation="System">
<initialValueExpression><![CDATA[new java.util.Date()]]></initialValueExpression>
<group name="Report">
<band height="1">

By: Victor Gieci - drummer
RE: Page footer on the last page
2003-04-24 01:11
Well, I've not been using groups so far (I just did not need them), and I'm afraid, I did not catch your point. Yesterday, I spent few hours experimeting with groups as well as reading the tutorial, but I wasn't able to find a clue. I'm sorry. Please, give me more details on this if you can.

Thanx for you response.

By: Chuck Deal - cdeal
RE: Page footer on the last page
2003-04-24 05:49
The XML definition that I posted is for a variable called PrintDate. This is just a convenience. I use that variable elsewhere in the report to display the print time and date.

However, I also use it as the groupExpression because the value will not change during the report filling process. This guarantees that there will only ever be one instance of this group in the report. Groups "wrap" around the detail section. So, if you define this as your first group of the report and define it's groupFooter, then whatever is contained in the groupFooter section will appear at the end of the report.

I'm sure some of the examples deal with grouping, perhaps you could take a look at one of those to get a feel for the syntax.

By: Teodor Danciu - teodord
RE: Page footer on the last page
2003-04-24 06:34


A group without a group expression behaves
the same. It will break only once per report as
the group expression stays null during the iteration.

The only way I can figure out for knowing that we
have reached the last page is to signal somehow
that this last group footer was printed.

This can be achieved using the <printWhenExpression> of an element placed on this group footer.
In this expression we could call a method on the scriptlet object that will put a boolean report variable to "true".
Then, the page footer will print or not depending on
the value of this report variable that we should declare as calculation="System".

I hope this helps.

By: Victor Gieci - drummer
RE: Page footer on the last page
2003-04-25 15:11
Great,cool,yes,excellent :)

Thank you both guys for your instructions. At the end, I did exactly what Teodor said and it worked great. Thanks for your help and efforts.

2002 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:28am
Last seen: 8 years 2 weeks ago


No answers yet