dgmanu Posted February 15, 2007 Share Posted February 15, 2007 hi every one, [p] i want total pages in a report, because i want to print continued.. at a page footer if report has more then one page this text doesn't come if it has only one page and not to repeat in last page, this can be achived if able to get the total pages in first page only, please help me on this matter,[/p][p] $V{PAGE_NUMBER} gives the current page number if i change this variable evaluation time to report then i wil get the total page number but the problem is i can print this number by putting it on report by changing its evalution time but i want it in variable because in my case i have to use this variable in print value expression when? so any one know how to get total pages please help me[/p] Post edited by: dgmanu, at: 2007/02/15 04:54Post edited by: dgmanu, at: 2007/02/15 04:54 Link to comment Share on other sites More sharing options...
Teodor Danciu Posted February 19, 2007 Share Posted February 19, 2007 Hi, The evaluationTime attribute is only a rendering/display feature and not a calculation engine feature.We cannot use late evaluation in variables, so you cannot use the total number of pages the way you mentioned. Thank you,Teodor Link to comment Share on other sites More sharing options...
xtia004 Posted November 19, 2007 Share Posted November 19, 2007 Shit, but how? Link to comment Share on other sites More sharing options...
mauricio Posted December 11, 2007 Share Posted December 11, 2007 hi do the jasperrepors masters have some idea of how to solve this issue?? I mean, it's a very usefull skill to perform actions or take decisions at outer levels of report (headers), based on whats going on with detail report data, not just to be able of draw things based on it I've tried to solve it playing with subreports and retrieving values from them, but always face the same problem: variables placed at headers can't to react based on detail data please let me know if there's some way to bypass this issue Link to comment Share on other sites More sharing options...
Teodor Danciu Posted December 13, 2007 Share Posted December 13, 2007 Hi, Maybe I don't fully understand what you are talking about and a better example of what you need to achieve would be more appropriate. But I just wanted to let you know that scriptlets are a very flexible way of implementing a complex data processing.You could have a scriptlet that with every detail make the appropriate modifications of some internal data that you can then leverage at higher levels. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
kasiopi Posted December 18, 2007 Share Posted December 18, 2007 http://www.jasperforge.org/jaspersoft/opensource/business_intelligence/jasperreports/faq.html The "Page i of n" trick section offers one solution. Hope this helps. Link to comment Share on other sites More sharing options...
jbedell Posted February 5, 2010 Share Posted February 5, 2010 I have what I think is a similar problem to the original poster here. And it's not one that can be solved with the "Page i of n" trick.I have a static set of lines that I want to draw on the background of every page... EXCEPT the last (summary) page. It would be extraordinarily useful to just set the "print when expression" to something like "$V{page_number} < $V{total_pages}" or the equivalent.The best solution I have so far is to simply draw white lines over top of the background lines in the summary band.... which is, of course, a horrible solution.Does anyone have anything better?Post Edited by jbedell at 02/05/2010 19:37 Link to comment Share on other sites More sharing options...
jrechter Posted February 18, 2010 Share Posted February 18, 2010 I've gotten around this problem by adding a column to my query that calculates the total number of rows in the recordset, then divide by the number of rows on a typical page. This gives me a good estimate of the total number of pages. I then use this field ($V{total_pages} = $F{cnt}.intValue() / 25) in my 'print when expression' (ie: print such 'n such if total_pages >10)The query is similar to the following:with t2 as (SELECT count(acc.account_id) as cnt FROM account acc where amt>10000) Select id, name, cnt from t2, account where amt >10000 Link to comment Share on other sites More sharing options...
mailmrsujan Posted February 20, 2011 Share Posted February 20, 2011 The following thread might help you.http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=46357 ThanksSujan Link to comment Share on other sites More sharing options...
jjcapa Posted April 9, 2017 Share Posted April 9, 2017 Hi!I know this thread is a bit (well, quite) old, but just in case someone is searching for this issue. The easiest way to get the number of total pages is by defining a variable with the next attributes:Name: total_pages (or any other)Variable class: IntegerCalculation: highestReset type: reportIncrement type: pageVariable expression: ${PAGE_NUMBER}[/code]I hope this may help. Link to comment Share on other sites More sharing options...
riodavid Posted July 9, 2018 Share Posted July 9, 2018 Has anyone tried method from @jjcapa? Is it working? I got null values only. 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