File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes Exception in JasperPrint Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Exception in JasperPrint" Watch "Exception in JasperPrint" New topic

Exception in JasperPrint

Sulaiman Malik

Joined: Apr 12, 2010
Posts: 25
JasperPrint is throwing a null pointer exception when i pass sql connection in its parameter but it runs fine when i pass JRResultSetDatasource. and i am using subreports.

at java.lang.Class.isAssignableFrom(Native Method)
at net.sf.jasperreports.engine.fill.JRFillTextField.getFormat(
at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(
at net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(
at Source)

when i pass connection in jasperPrint it gives exception.

jasperPrint = JasperFillManager.fillReport(jasperReport,map, reportConnection);

I am also using a subreport so that is why i am not using JRResultSetDatasource and using connection. I am just stuck into this. but when i pass JRResultSetDatasource it works fine and when i also pass connection object in a hasmap parameter it gives and error. the above exception.
I agree. Here's the link:
subject: Exception in JasperPrint
jQuery in Action, 3rd edition