Jump to content
Changes to the Jaspersoft community edition download ×

CompileReport temp file compile problem


lilyjung

Recommended Posts

I am trying to write a sample report. The temp java file seems to be able to compile from the command line.

 

Here is my code:

 

public static void main(String[] args) {

// TODO Auto-generated method stub

 

JasperReport jasperReport;

JasperPrint jasperPrint;

System.setProperty("jasper.reports.compile.keep.java.file", "true" );

 

try

{

jasperReport = JasperCompileManager.compileReport( "helloWorld/reportdemo.jrxml");

 

// jasperReport = JasperCompileManager.compileReport( "C:/Documents and Settings/lilyj2/workspace/HelloWorld/helloWorld/reportdemo.jrxml");

 

jasperPrint = JasperFillManager.fillReport(jasperReport, new HashMap(), new JREmptyDataSource());

JasperExportManager.exportReportToPdfFile(jasperPrint, "reports/simple_report.pdf");

}

catch (JRException e)

{

e.printStackTrace();

}

 

}

 

}

 

HERE is my JRXML:

 

<?xml version="1.0"?>

<!DOCTYPE jasperReport

PUBLIC "-//JasperReports//DTD Report Design//EN"

"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

 

<jasperReport name="Simple_Report">

<detail>

<band height="20">

<staticText>

<reportElement x="180" y="0" width="200" height="20"/>

<text><![CDATA[Hello World!]]></text>

</staticText>

</band>

</detail>

</jasperReport>

 

HERE is my ERROR:

 

net.sf.jasperreports.engine.JRException: Error compiling report java source files : C:Documents and Settingslilyj2workspaceHelloWorldSimple_Report_1169046274468_913994.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 helloWorld.JasperFirst.main(JasperFirst.java:25)

Caused by: java.io.IOException: CreateProcess: javac -classpath "C:Documents and Settingslilyj2workspaceHelloWorld;C:Program FilesJasperReportsJakartacommons-digester-1.8.zip;C:Program FilesJasperReportsjasperreports-1.3.0.jar;C:Program FilesJasperReportsjasperreports-1.3.0-project.zip;C:Program FilesJasperReportsjasperreports-1.3.0-javaflow.jar;C:Program FilesJasperReportscommons-beanutils.jar;C:Program FilesJasperReportscommons-beanutils-bean-collections.jar;C:Program FilesJasperReportscommons-beanutils-core.jar;C:Program FilesJasperReportscommons-logging-1.1.jar;C:Program FilesJasperReportsJakartacommons-collections-3.2.jar;C:Program FilesJasperReportsJakartacommons-digester-1.8.jar;C:Program FilesJasperReportsJakartaitext-1.4.8.zip" "C:Documents and Settingslilyj2workspaceHelloWorldSimple_Report_1169046274468_913994.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

Code:
Code:
[code]
Code:
[code]
Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

I am trying to write a sample report. The temp java file seems to be able to compile from the command line.

 

 

 

Here is my code:

 

 

 

public static void main(String[] args) {

 

// TODO Auto-generated method stub

 

 

 

JasperReport jasperReport;

 

JasperPrint jasperPrint;

 

System.setProperty("jasper.reports.compile.keep.java.file", "true" );

 

 

 

try

 

{

 

jasperReport = JasperCompileManager.compileReport( "helloWorld/reportdemo.jrxml");

 

 

 

// jasperReport = JasperCompileManager.compileReport( "C:/Documents and Settings/lilyj2/workspace/HelloWorld/helloWorld/reportdemo.jrxml");

 

 

 

jasperPrint = JasperFillManager.fillReport(jasperReport, new HashMap(), new JREmptyDataSource());

 

JasperExportManager.exportReportToPdfFile(jasperPrint, "reports/simple_report.pdf");

 

}

 

catch (JRException e)

 

{

 

e.printStackTrace();

 

}

 

 

 

}

 

 

 

}

 

 

 

HERE is my JRXML:

 

 

 

<?xml version="1.0"?>

 

<!DOCTYPE jasperReport

 

PUBLIC "-//JasperReports//DTD Report Design//EN"

 

"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

 

 

 

<jasperReport name="Simple_Report">

 

<detail>

 

<band height="20">

 

<staticText>

 

<reportElement x="180" y="0" width="200" height="20"/>

 

<text><![CDATA[Hello World!]]></text>

 

</staticText>

 

</band>

 

</detail>

 

</jasperReport>

 

 

 

HERE is my ERROR:

 

 

 

net.sf.jasperreports.engine.JRException: Error compiling report java source files : C:Documents and Settingslilyj2workspaceHelloWorldSimple_Report_1169046274468_913994.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 helloWorld.JasperFirst.main(JasperFirst.java:25)

 

Caused by: java.io.IOException: CreateProcess: javac -classpath "C:Documents and Settingslilyj2workspaceHelloWorld;C:Program FilesJasperReportsJakartacommons-digester-1.8.zip;C:Program FilesJasperReportsjasperreports-1.3.0.jar;C:Program FilesJasperReportsjasperreports-1.3.0-project.zip;C:Program FilesJasperReportsjasperreports-1.3.0-javaflow.jar;C:Program FilesJasperReportscommons-beanutils.jar;C:Program FilesJasperReportscommons-beanutils-bean-collections.jar;C:Program FilesJasperReportscommons-beanutils-core.jar;C:Program FilesJasperReportscommons-logging-1.1.jar;C:Program FilesJasperReportsJakartacommons-collections-3.2.jar;C:Program FilesJasperReportsJakartacommons-digester-1.8.jar;C:Program FilesJasperReportsJakartaitext-1.4.8.zip" "C:Documents and Settingslilyj2workspaceHelloWorldSimple_Report_1169046274468_913994.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

-------------------------------------

I got same problem above mentioned.

You told one solution

I tried including the Eclipse jdt core jar and that seemed to solve my problem.

where can i find that eclipse jdt core jar..please telme exact location where can i get and what i have to do with that?Please... its very

urgent ..

 

 

Thanks in advance

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