TIBCOSoftware / jasperreports

JasperReports® - Free Java Reporting Library
https://community.jaspersoft.com/downloads/community-edition/
GNU Lesser General Public License v3.0
1.07k stars 405 forks source link

NullPointerException at net.sf.jasperreports.engine.fill.JRFillBreak.prepare #100

Open renanregis opened 5 years ago

renanregis commented 5 years ago

I'm having this when I try to put a break element inside a list

net.sf.jasperreports.engine.JRException: java.lang.NullPointerException
    at com.jaspersoft.studio.editor.preview.view.control.ReportControler.fillReport(ReportControler.java:530)
    at com.jaspersoft.studio.editor.preview.view.control.ReportControler.access$20(ReportControler.java:505)
    at com.jaspersoft.studio.editor.preview.view.control.ReportControler$5.run(ReportControler.java:386)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NullPointerException
    at net.sf.jasperreports.engine.fill.JRFillBreak.prepare(JRFillBreak.java:218)
    at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:536)
    at net.sf.jasperreports.engine.fill.JRFillFrame.prepare(JRFillFrame.java:241)
    at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:536)
    at net.sf.jasperreports.components.list.FillListContents.prepare(FillListContents.java:92)
    at net.sf.jasperreports.components.list.VerticalFillList.fillContents(VerticalFillList.java:164)
    at net.sf.jasperreports.components.list.VerticalFillList.prepare(VerticalFillList.java:111)
    at net.sf.jasperreports.engine.fill.JRFillComponentElement.prepare(JRFillComponentElement.java:152)
    at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:536)
    at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:411)
    at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:386)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2056)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:748)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:255)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:115)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:580)
    at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:123)
    at java.lang.Thread.run(Thread.java:745)
teodord commented 5 years ago

The problem comes from the fact that the behaviour of the break elements depends on the state of the containing band. For example, a page break would be inhibited if it is the first element in the first band that renders on the page. And when the break element is placed in a list component, the notion of band is no longer that clear. May I ask what you want to achieve with a break in the list component? Maybe some other technique could be used instead.

afreuDev commented 4 years ago

Hello, Can you explain more about "other technique" please ? Thx in advance !

teodord commented 4 years ago

In order to provide any workaround, we first need to understand what you are trying to achieve. So it is you that need to provide more details first.

froilanmmedina commented 3 years ago

In my case what I am trying to do is print a set of tables. But with the requirement of when one table ends the next you must start on the next page.

note: I put the page break inside the list at the end of a crosstab that I have.