• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Jasper Reports Exception

 
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, can anyone please help me,
I am a newbie in Jasper Reports..


The code Compiles Fine
This code Gives me the following error on running:


Can anyone please tell me how can i solve this...
Thanks a lot
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Sandi,

you need the commons-digester.jar at your library path in order to your java can found the file.

Regards.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This more properly belongs into Other Open Source Projects, so I'm moving it there.
 
Sandeep Chhabra
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Yaddif Medina:
Hey Sandi,

you need the commons-digester.jar at your library path in order to your java can found the file.

Regards.



Ok i gave that to it...
And then it said:


Now What...??
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now you need commons-logging.jar
 
Sandeep Chhabra
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Adeel Ansari:
Now you need commons-logging.jar



Intelligent..!!
So I gave that to it...
and then it asked for some commons-beanutils....
and guess what...i downloaded it and provided the jar file...

all this did not ended my problems..
Now it gives a long list of errors regarding these packages...

If you want i can also post those errors...

 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sandeep Chhabra:
If you want i can also post those errors...



Yes please. Moreover, you can search the same forum with the word "jasper reports". You would definitely get some helping threads I have raised in past.

Thanks.
 
Sandeep Chhabra
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My Code for the jasper4.java file (to connect jasper report)
 
Sandeep Chhabra
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And the Error I Get :
 
Greenhorn
Posts: 16
Oracle Suse Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ..
I too got the same error while trying to create a report from a jrxml file created using iReport tool...This file is placed in the root directory ..
Could someone help me out ...

Heres the code...

public static void main(String[] args)
{
JasperReport jasperReport;
JasperPrint jasperPrint;
try
{
jasperReport = JasperCompileManager.compileReport("jasperreports_demo.jrxml");
jasperPrint = JasperFillManager.fillReport(jasperReport, new HashMap(), new JREmptyDataSource());
JasperExportManager.exportReportToPdfFile(jasperPrint, "simple_report.pdf");
}
catch (JRException e)
{
System.out.println("Error :"+e);
e.printStackTrace();
}
}

and this is the Error that I got...

Error :net.sf.jasperreports.engine.JRException: Error compiling report java source files : C:\NewProj\FirstReport\Simple_Report_1165308653100_379903.java net.sf.jasperreports.engine.JRException: Error compiling report java source files : C:\NewProj\FirstReport\Simple_Report_1165308653100_379903.java
at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:93)
at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileUnits(JRAbstractClassCompiler.java:67)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:190)
at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:144)
at sample.JasperReportsIntro.main(JasperReportsIntro.java:21)
Caused by: java.io.IOException: CreateProcess: javac -classpath "C:\NewProj\FirstReport\bin;C:\Eclipse\jar files\jasperreports-1.2.8.jar;C:\Eclipse\jar files\commons-beanutils-1.7.0.jar;C:\Eclipse\jar files\commons-collections-2.1.1.jar;C:\Eclipse\jar files\commons-digester-1.7.jar;C:\Eclipse\jar files\commons-logging-1.0.2.jar;C:\Eclipse\jar files\itext-1.3.jar;C:\Eclipse\jar files\jdbc2_0-stdext.jar" C:\NewProj\FirstReport\Simple_Report_1165308653100_379903.java error=2
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:62)
... 6 more






Thanks in advance...
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Did you resolve the problem ? I'm having the same.

Thanks in advance.
 
Fadjer One
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I found the solution ! I'm working on Eclipse and the problem is caused by it !

Add these two jars to your classpath : org.eclipse.jdt.core.manipulation_1.0.0.v20060605-1400.jar
org.eclipse.jdt.core_3.2.0.v_671.jar

There are in the plungin directory of Eclipse.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Really it was this , thanks a lot , i can now go one
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
mr. Sandeep Chhabra

i flow to your give step


see my code

public String button2_action() {

JasperDesign jasperDesign = JasperManager.loadXmlDesign("f:/ireport/fahim.jrxml");

JasperReport jasperReport = JasperManager.compileReport(jasperDesign);

Map parameters = new HashMap();

parameters.put("pid", new Integer(19));

Connection conn = null ;
try {
javax.naming.Context ctx = new javax.naming.InitialContext() ;
DataSource ds = (DataSource)ctx.lookup(" java:comp/env/jdbc/Travel" ) ;
conn = ds.getConnection() ;
} catch (Exception ex) {
error(" Error counting rows: " + ex.getMessage() );
}

JasperPrint jasperPrint = JasperManager.fillReport(jasperReport,parameters,conn);

JasperManager.printReportToPdfFile(jasperPrint, "BasicReport.pdf");
return null;
}
}



it only give me light green line where i use JasperManager word not error line

i import this file

import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.design.*;

import java.util.*;


import java.sql.*;
import java.util.HashMap;
import java.util.Map;

import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.xml.JRXmlLoader;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.view.JasperViewer;
//import net.sf.jasperreports.engine.JasperManager;
import net.sf.jasperreports.engine.JasperPrintManager;



and when i build my project then system give me error in output windows


============see my all error


Compiling 3 source files to C:\Documents and Settings\Administrator\My Documents\Creator\Projects\WebApplication13\build\web\WEB-INF\classes
C:\Documents and Settings\Administrator\My Documents\Creator\Projects\WebApplication13\src\webapplication13\Page1.java:306: unreported exception net.sf.jasperreports.engine.JRException; must be caught or declared to be thrown


JasperDesign jasperDesign = JasperManager.loadXmlDesign("f:/ireport/fahim.jrxml");


C:\Documents and Settings\Administrator\My Documents\Creator\Projects\WebApplication13\src\webapplication13\Page1.java:307: unreported exception net.sf.jasperreports.engine.JRException; must be caught or declared to be thrown

JasperReport jasperReport = JasperManager.compileReport(jasperDesign);

C:\Documents and Settings\Administrator\My Documents\Creator\Projects\WebApplication13\src\webapplication13\Page1.java:318: unreported exception net.sf.jasperreports.engine.JRException; must be caught or declared to be thrown


JasperPrint jasperPrint = JasperManager.fillReport(jasperReport,parameters,conn);


C:\Documents and Settings\Administrator\My Documents\Creator\Projects\WebApplication13\src\webapplication13\Page1.java:319: unreported exception net.sf.jasperreports.engine.JRException; must be caught or declared to be thrown


JasperManager.printReportToPdfFile(jasperPrint, "BasicReport.pdf");

Note: C:\Documents and Settings\Administrator\My Documents\Creator\Projects\WebApplication13\src\webapplication13\Page1.java uses or overrides a deprecated API.
Note: Recompile with -Xlint eprecation for details.

4 errors
C:\Documents and Settings\Administrator\My Documents\Creator\Projects\WebApplication13\nbproject\build-impl.xml:233: The following error occurred while executing this line:
C:\Documents and Settings\Administrator\My Documents\Creator\Projects\WebApplication13\nbproject\build-impl.xml:122: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)






please give me idea how i create pdf file

thank's

aamir
 
muhammad fahim
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sir i use jasperviewer and get right result but only in server browser
when i use my in client browser then jasperviewer open in server browser
not open in client browser

some body i use inputstreem
but sir i not have any idea of inputstreem how i opasss through streem to client browser

please give me idea how i use inputstreem in jsp page

thank's


aamir
 
Where does a nanny get ground to air missles? Protect this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic