5 Replies - 8792 Views - Last Post: 05 May 2012 - 09:58 AM Rate Topic: -----

#1 khaa_khay  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 03-July 09

How I can calling iReport from Java Class ?

Posted 20 July 2009 - 10:48 PM

Hii,, aLL,,
please help Me,, :crazy:

I used JDK 1.6

I have done design report with iReport (iReport-nb-3.1.2-windows-installer.exe)


but I still confuse with the way calling iReport from java class
As I get, it should add this code :
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.design.*;
import net.sf.jasperreports.engine.xml.*;
import net.sf.jasperreports.view.*;



but it should getting error

EmployeeJava.java:1: package net.sf.jasperreports.engine does not exist


I try to add : commons-beanutils, commons-collections, commons-digester, commons-javaflow, commons-logging-api, jasperreports-3.1.2.jar
into C:\Program Files\Java\jdk1.6.0_01\lib
but it still not worked

Still I'm wrong place that file ?
how i can calling iReport from java class ?

thx,,

Is This A Good Question/Topic? 0
  • +

Replies To: How I can calling iReport from Java Class ?

#2 khaa_khay  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 03-July 09

Re: How I can calling iReport from Java Class ?

Posted 20 July 2009 - 10:51 PM

Hii,, aLL,,
please help Me,, :crazy:

I used JDK 1.6

I have done design report with iReport (iReport-nb-3.1.2-windows-installer.exe)


but I still confuse with the way calling iReport from java class
As I get, it should add this code :
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.design.*;
import net.sf.jasperreports.engine.xml.*;
import net.sf.jasperreports.view.*;



but it should getting error

EmployeeJava.java:1: package net.sf.jasperreports.engine does not exist


I try to add : commons-beanutils, commons-collections, commons-digester, commons-javaflow, commons-logging-api, jasperreports-3.1.2.jar
into C:\Program Files\Java\jdk1.6.0_01\lib
but it still not worked

Still I'm wrong place that file ?
how i can calling iReport from java class ?

thx,,
Was This Post Helpful? 0
  • +
  • -

#3 khaa_khay  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 03-July 09

Re: How I can calling iReport from Java Class ?

Posted 20 July 2009 - 11:54 PM

It's should work..
i copy to jdk/jre/lib/ext
and
jre/lib/ext

but when program running it show some error
null, null]net.sf.jasperreports.engine.JRException: Error executing SQL statemen
t for : MemberReport
		at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasourc
e(JRJdbcQueryExecuter.java:141)
		at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(
JRFillDataset.java:668)
		at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillD
ataset.java:588)
		at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFil
ler.java:1212)
		at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:
842)
		at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:
791)
		at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63
)
		at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillMa
nager.java:402)
		at Member$9.actionPerformed(Member.java:1174)
		at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
		at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
		at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
		at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
		at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
		at java.awt.Component.processMouseEvent(Unknown Source)
		at javax.swing.JComponent.processMouseEvent(Unknown Source)
		at java.awt.Component.processEvent(Unknown Source)
		at java.awt.Container.processEvent(Unknown Source)
		at java.awt.Component.dispatchEventImpl(Unknown Source)
		at java.awt.Container.dispatchEventImpl(Unknown Source)
		at java.awt.Component.dispatchEvent(Unknown Source)
		at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
		at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
		at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
		at java.awt.Container.dispatchEventImpl(Unknown Source)
		at java.awt.window.dispatchEventImpl(Unknown Source)
		at java.awt.Component.dispatchEvent(Unknown Source)
		at java.awt.EventQueue.dispatchEvent(Unknown Source)
		at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
		at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
		at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
		at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
		at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
		at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Connection
is busy with results for another hstmt
		at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
		at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
		at sun.jdbc.odbc.JdbcOdbc.SQLExecute(Unknown Source)
		at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(Unknown Source)
		at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery(Unknown Source)
		at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasourc
e(JRJdbcQueryExecuter.java:135)



???
Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8376
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: How I can calling iReport from Java Class ?

Posted 21 July 2009 - 05:40 PM

How do you connect to your SQL Database ?
Was This Post Helpful? 0
  • +
  • -

#5 Imby  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 05-May 12

Re: How I can calling iReport from Java Class ?

Posted 05 May 2012 - 09:07 AM

i found the following java program How to call Jasper Report
Its very good and helpful.

Call Jasper Report / Ireport From Java Application
Was This Post Helpful? 0
  • +
  • -

#6 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8376
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: How I can calling iReport from Java Class ?

Posted 05 May 2012 - 09:57 AM

Imby don't necropost a more than 2 years old post.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1