mannaii.amira Posted October 18, 2013 Share Posted October 18, 2013 I need to remove report pages when it contains nothing.I have a page that contains blanks, so I want to remove it. I tried everything but the problem persists.I tried this code: private void removeBlankPage(List<JRPrintPage> pages) { for (Iterator<JRPrintPage> i = pages.iterator(); i.hasNext(); ) { JRPrintPage page = i.next(); if (page.getElements().size() == 0) i.remove(); }}[/code]But it never reaches the if (page.getElements().size() == 0)because the element exists and it's blank.(size always!=0)Now I'm trying to write a Print When Expression attribute, so I want to retrieve the preceding text if it's a blank then I'm sure that the page is all blank and in this case I don't print the blank text. So the blank pages disappearsBut I can't retrieve the preceding text.So what do you suggest? 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