This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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