Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
renanregis opened this issue Aug 23, 2019 · 4 comments

Comments

@renanregis
Copy link

renanregis commented Aug 23, 2019

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)

@renanregis renanregis changed the title java.lang.NullPointerException at net.sf.jasperreports.engine.fill.JRFillBreak.prepare NullPointerException at net.sf.jasperreports.engine.fill.JRFillBreak.prepare Aug 23, 2019
@teodord
Copy link
Collaborator

teodord commented Nov 14, 2019

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
Copy link

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

@teodord
Copy link
Collaborator

teodord commented Jan 17, 2020

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants