Jump to content
We've recently updated our Privacy Statement, available here ×

Remove blank page generated by JasperReports


mannaii.amira

Recommended Posts

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 disappears

But I can't retrieve the preceding text.

So what do you suggest?

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...