Jump to content
Changes to the Jaspersoft community edition download ×

JasperReports as Oracle 10g reporting tool


Recommended Posts

By: NeroN - ilijaa

JasperReports as Oracle 10g reporting tool

2006-08-14 07:03

I would like to use JasperReports as Oracle reporting tool. I have made a java pl-sql procedure to run an existing report. I have load all necessary jars with loadjava tool, then succesfuly compile procedure, and publish it! Using Oracle Form Builder 6i i have been create a form with a button. On click I call the pl-sql with specified .jrxml file. I am getting errors when compiling report. This is a stack trace:

 

net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:231)

net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105)

net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)

util.ExecuteReport.runReport(ExecuteReport.java:73)

 

When I try to compile and execute java class with Netbeans, everything is ok, and report is showing.

 

Please, if anyone had the same problem, or have any idea what can be wrong, HELP!!!

 

This is the java class that can't compile a report from oracle:

 

public class ExecuteReport {

 

public static Connection connectDB(String databaseName, String userName, String password) {

Connection jdbcConnection = null;

try{

Class.forName("oracle.jdbc.driver.OracleDriver");

jdbcConnection = DriverManager.getConnection(databaseName,userName,password);

}catch(Exception ex) {

String connectMsg = "Konekcija na bazu neuspjesna: " + ex.getMessage() + " " + ex.getLocalizedMessage();

System.out.println(connectMsg);

}

return jdbcConnection;

}

 

public static void runReport(String databaseName, String userName, String password,String reportFile, Map parameters) throws Exception{

try{

JasperDesign jasperDesign = JRXmlLoader.load(reportFile);

JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);

Connection jdbcConnection = connectDB(databaseName, userName, password);

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, jdbcConnection);

JasperViewer.viewReport(jasperPrint);

}catch(Exception ex) {

String connectMsg = "Kreiranje izvjestaja neuspjesno " + ex.getMessage() + " " + ex.getLocalizedMessage();

System.out.println(connectMsg);

throw ex;

}

}

public static void main(String[] args) {

// TODO code application logic here

try{

HashMap parameters=new HashMap();

parameters.put("ADPUNKTR","2413");

parameters.put("GODR","2006");

parameters.put("BROJRP","13");

runReport("jdbc:oracle:thin:@poliklinika.iqnet.co.yu:1521:POLI9I","kc","kc","C:\Ilija\IZVESTAJLEKARASPECIJALISTE.jrxml",parameters);

}catch(Exception e){System.out.println(e);}

}

Link to comment
Share on other sites

  • 10 months later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

hi,

i have similar problem:

Code:

java.lang.NoSuchMethodError
at net.sf.jasperreports.engine.fill.JRAbstractExtendedIncrementerFactory.getIncrementer(JRAbstractExtendedIncrementerFactory.java:43)
at net.sf.jasperreports.engine.fill.JRFillVariable.getIncrementer(JRFillVariable.java:296)
at net.sf.jasperreports.engine.fill.JRCalculator.estimateVariables(JRCalculator.java:174)
at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:779)
at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1106)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:111)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:763)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:669)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:363)
at TestReport3.exportReportToBlob(TestReport3.java:71)

 

I use Jasper Reports version 1.3.4.

 

Did you solve your problem?

Can you post your loadjava progress to loading jars?

 

Thanks.

nagy

Link to comment
Share on other sites

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