aspose file tools*
The moose likes Other Open Source Projects and the fly likes Jasper Reports Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Jasper Reports Exception" Watch "Jasper Reports Exception" New topic
Author

Jasper Reports Exception

Sandeep Chhabra
Ranch Hand

Joined: Aug 28, 2005
Posts: 340
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


Regards<br />Sandy<br />[SCJP 5.0 - 75%]<br />[SCWCD 1.4 - 85%]<br />------------------<br />Tiger, Tiger burning bright,<br />Like a geek who works all night,<br />What new-fangled bit or byte,<br />Could ease the hacker's weary plight?
Yaddif Medina
Greenhorn

Joined: Oct 05, 2005
Posts: 23
Hey Sandi,

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

Regards.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42944
    
  68
This more properly belongs into Other Open Source Projects, so I'm moving it there.
Sandeep Chhabra
Ranch Hand

Joined: Aug 28, 2005
Posts: 340
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...??
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Now you need commons-logging.jar
Sandeep Chhabra
Ranch Hand

Joined: Aug 28, 2005
Posts: 340
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

Joined: Aug 15, 2004
Posts: 2874
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

Joined: Aug 28, 2005
Posts: 340
My Code for the jasper4.java file (to connect jasper report)
Sandeep Chhabra
Ranch Hand

Joined: Aug 28, 2005
Posts: 340
And the Error I Get :
AMAR PATIL
Greenhorn

Joined: Feb 14, 2006
Posts: 16

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


cheers:
Amar
Fadjer One
Greenhorn

Joined: Mar 14, 2006
Posts: 10
Hi,

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

Thanks in advance.
Fadjer One
Greenhorn

Joined: Mar 14, 2006
Posts: 10
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.
Mourad Hmimida
Greenhorn

Joined: Feb 28, 2007
Posts: 1
Really it was this , thanks a lot , i can now go one
muhammad fahim
Ranch Hand

Joined: Dec 17, 2006
Posts: 45
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

Joined: Dec 17, 2006
Posts: 45
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jasper Reports Exception