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

Crosstab computeOffsets NullPointerException


bence.gyongyossy

Recommended Posts

I have a complex jrxml template (version 6.6.0) with a detail band containing several frames, one of which contains a list element which contains a crosstab element.
The height of the detail band changes dynamically depending on the data used to fill the template so it can appear on a page 1-3 times.


I believe in some cases it can't calculate where to place the crosstabs of the 2nd or 3rd detail band on the page because it would be out of the page and it gives an exception.
Here is the exception: 

java.lang.NullPointerException: null   at net.sf.jasperreports.engine.fill.JRFillCrosstab$CrosstabFiller.computeOffsets(JRFillCrosstab.java:1407) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.JRFillCrosstab$CrosstabFiller.initCrosstab(JRFillCrosstab.java:1377) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.JRFillCrosstab.rewind(JRFillCrosstab.java:1149) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.JRFillElementContainer.rewind(JRFillElementContainer.java:1127) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.components.list.FillListContents.rewind(FillListContents.java:118) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.components.list.VerticalFillList.rewind(VerticalFillList.java:187) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.JRFillComponentElement.rewind(JRFillComponentElement.java:225) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.JRFillElementContainer.rewind(JRFillElementContainer.java:1127) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.JRFillFrame.rewind(JRFillFrame.java:176) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.JRFillElementContainer.rewind(JRFillElementContainer.java:1127) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.JRFillBand.refill(JRFillBand.java:381) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2642) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:813) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportContent(JRVerticalFiller.java:285) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:114) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:615) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:413) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:120) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:103) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:482) ~[jasperreports-6.6.0.jar:6.6.0]   at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:443) ~[jasperreports-6.6.0.jar:6.6.0]   [/code]

I guess the problem is that because there can be several crosstabs in several list points it cannot tell in advance wheter a band will fit on a page or not.
The only way I could fully fix it is if I force it to put each detail band on its own page which is unacceptable for our client.
Any way I could make it so that if a band can't fit on a page because of the crosstabs it just places the band on the next page?
 

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...