Jump to content
Changes to the Jaspersoft community edition download ×

Exception:Jasper reports using Seam


svntdeepak

Recommended Posts

Hi

I am trying to generate jasper reports using seam.for that i have used the following code

InputStream input = this.getClass().getClassLoader().getResourceAsStream(reportName);

JasperDesign design = JRXmlLoader.load(input);

JasperReport report = JasperCompileManager.compileReport(design);

InitialContext initialContext = new InitialContext();

DataSource ds = (DataSource) initialContext.lookup("java:/claims");

conn = ds.getConnection();

JasperPrint print = JasperFillManager.fillReport(report, parameters, conn);

String fileName = "D:/downloads/ireport/" + showType;

OutputStream output = new FileOutputStream(new File(fileName));

JasperExportManager.exportReportToPdfStream(print, output);

FileInputStream fis = new FileInputStream(fileName);

BufferedInputStream bis = new BufferedInputStream(fis);

DataInputStream dis = new DataInputStream(bis);

 

and when i tried to rum i am getting the following exception as

12:18:41,966 INFO [JasperReporter] Exceptionnet.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports

ngine.JRException: Class "net.sf.jasperreports.engine.query.JRJdbcQueryExecuterFactory" should be compatible with "net.sf.jasperreports.engine.query.JRQue

ExecuterFactory"

 

Then i changed the code i tried it by setting jdt-compiler-4.1.1 .jar to the class path

 

FacesContext facesCtx = FacesContext.getCurrentInstance();

Map parameters = new HashMap();

InputStream input = this.getClass().getClassLoader().getResourceAsStream(reportName);

JasperDesign design = JRXmlLoader.load(input);

JasperReport report = JasperCompileManager.compileReport(design);

log.info("jasper design is"+design);

log.info("inputStream is" + input);

// get a database connection

InitialContext initialContext = new InitialContext();

DataSource ds = (DataSource) initialContext.lookup("java:/claims");

conn = ds.getConnection();

JasperPrint print = JasperFillManager.fillReport(report, parameters, conn);

String fileName = "D:/downloads/ireport/" + showType;

OutputStream output = new FileOutputStream(new File(fileName));

//System.setProperty("jasper.reports.compiler.class","org.eclipse.jdt.internal.compiler.Compiler");

//JasperRunManager.runReportToPdfStream(input,facesCtx.getResponseStream(),parameters,conn);

facesCtx.getResponseStream().flush();

facesCtx.getResponseStream().close();

facesCtx.responseComplete();

String destFileNamePdf = "opencclaimdecission.pdf";

 

// create JasperPrint using fillReport() method

JasperPrint print = JasperFillManager.fillReport(reportName, parameters, conn);

JasperExportManager.exportReportToPdfFile(print, destFileNamePdf);*/

 

Even now i am getting the Exception as

 

12:26:30,884 INFO [JasperReporter] Exceptionnet.sf.jasperreports.engine.JRException: Could not instantiate report compiler : net.sf.jasperreports.engine.

sign.JRJavacCompiler

 

So plz help me what s the solution to generate the jasper Reports....NEed to implement in my project so urgently..

 

Thanx in Advance for any type of suggestions

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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