lingogetter Posted November 9, 2012 Share Posted November 9, 2012 I am making a number of labels from several xlsx file sources, and it's working fine except for a single datasource. When I try to do a PDF preview this is the error I see. Any advice as to why this is happening?Error filling print... null java.lang.NullPointerException at net.sf.jasperreports.engine.data.JRXlsxDataSource.getFieldValue(JRXlsxDataSource.java:221) at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:1317) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1218) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1194) at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1544) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:146) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:909) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:841) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:88) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:653) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:569) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:915) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:928) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Print not filled. Try to use an EmptyDataSource... Link to comment Share on other sites More sharing options...
lucianc Posted November 12, 2012 Share Posted November 12, 2012 Looking at thed code, the problem seems to be that the data source expects a data cell at a specific location in the file, and there's no cell there. Could you attach the XLSX file so that we can take a look at it and see the exact source of the problem?Regards,Lucian Link to comment Share on other sites More sharing options...
lingogetter Posted November 14, 2012 Author Share Posted November 14, 2012 Oh! I didn't know I could do that. I attached the spreadsheet. And an image of what my designer page looks like. Link to comment Share on other sites More sharing options...
lucianc Posted November 15, 2012 Share Posted November 15, 2012 The XLSX data source seems to have a problem with empty/missing cells. Please log a bug for that in the trackers. In the meantime, you could export your file as CSV and use a CSV data source. Link to comment Share on other sites More sharing options...
andone93 Posted July 22, 2014 Share Posted July 22, 2014 Is that issue already solved?For some sophisticated reasons, my xls datasource need to have one column ignored.I mean, not all of the columns will be used, i will choose just a few of them to create fields. All the necessary data is visible in the data preview, but i keep on getting nullpointer exception and i cannot generate even the preview in the report.Can anybody help me? Link to comment Share on other sites More sharing options...
mcm Posted September 24, 2018 Share Posted September 24, 2018 Hi,You can get this error because one or more cells in your Excel file are empty, try to fill the empty cells with the any character , "-" for example , and run your report again 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