2002 JI Open Discussion Posted August 18, 2006 Share Posted August 18, 2006 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> </variable> <group name="Report"> <groupExpression><![CDATA[$V{PrintDate}]]></groupExpression> <groupHeader> <band height="1"> </band> </groupHeader> </group> 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 Hi, 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. Teodor 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. Drummer Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now