2005 IR Help Posted August 11, 2006 Share Posted August 11, 2006 By: tim hatzenbeler - timhatz page # variables 2001-11-20 22:47 2 questions, and the first answer should answer the second.. What variable of formula would I use to print Page 1 of 7 or If the total # of pages is not know durring runtime, how about just the simple, Page #5 variable? Thanks, tim By: Teodor Danciu - teodord RE: page # variables 2001-11-21 01:44 Hi, Tim, For the page number there is a predefined variable called "PAGE_NUMBER". You can use it in any expression. As for the total number of pages, we use the same variable but in a text field for witch we have to set the attribute "evaluationTime". (see "Quick Reference" for details) Check the page footer section in the FirstJasper.XML file supplied in the sample to see how it is done there. I think I'll explain that in the "Tips & Tricks". Here are the sequences you can use: Current page number: Code:<textField> <reportElement x="200" y="10" width="75" height="20"/> <textElement textAlignment="Right"> <font fontName="Helvetica" size="14"/> </textElement> <textFieldExpression class="java.lang.Integer"> $V{PAGE_NUMBER} </textFieldExpression> </textField> Total number of pages: Code:[code]<textField evaluationTime="Report"> <reportElement x="280" y="10" width="75" height="20"/> <textElement textAlignment="Left"> <font fontName="Helvetica" size="14"/> </textElement> <textFieldExpression class="java.lang.Integer"> $V{PAGE_NUMBER} </textFieldExpression> </textField> I hope it helps. Teodor By: tim hatzenbeler - timhatz How about this...RE: page # variables 2001-11-21 14:07 It worked.... But.... Can I do this? Can I create a formula, similar to: Code:[code]<textFieldExpression> $F{FirstName} + " " + $F{LastName} </textFieldExpression> But using 2 runtime versions of Page Number? Code:[code]<textFieldExpression> "Page "+$V{Current_Page) + " of " + $V{Total_Pages} </textFieldExpression> In other words, and I set, the Page_number Variable to another variable, durring the report? Also, last week, I attempted to send you some cross-tab examples... I was wondering if that e-mail made it to you? I had 3 other out going e-mails fail that day... Thanks, timPost edited by: tcloonan, at: 2006/08/12 18:06 Link to comment Share on other sites More sharing options...
dekorus Posted October 19, 2009 Share Posted October 19, 2009 Hi,I have the same problem,i tried to use your solution but my code still not workingIn my page footer I don't see anything Code: thanks a lotPost Edited by dekorus at 10/19/2009 12:54 Link to comment Share on other sites More sharing options...
dekorus Posted October 20, 2009 Share Posted October 20, 2009 I found a strange behaviourwith the same jrxml:-if I use a Swap virtualizer the page number disappear-without the virtualize my code works well Can anybody help me? Link to comment Share on other sites More sharing options...
lucianc Posted November 30, 2009 Share Posted November 30, 2009 dekorusWrote: -if I use a Swap virtualizer the page number disappear Are you setting the virtualizer as read-only before filling the report?Regards,Lucian Link to comment Share on other sites More sharing options...
dekorus Posted December 1, 2009 Share Posted December 1, 2009 "Are you setting the virtualizer as read-only before filling the report?"Yes, now works wellthanks a lot 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