Jump to content

How to compile a .jrxml report?


caselli

Recommended Posts

 Hi all,

we just discovered JasperSoft Studio: great work!!

A question: with iReport you can compile the report with right-click, "Compile" menu item.

I cannot see the equivalent here in JS Studio; still to be implemented or is somewhere else?

Thank you 

Regards

 

Vincenzo Caselli

RCP Vision



Post Edited by caselli at 02/07/2011 16:33
Link to comment
Share on other sites

  • Replies 12
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

just use standard Eclipse Ctrl+B or in from menu

Project->Build All

you will see in the report folder a compiled .jrxml file

 

you should have JasperReport Nature activated on the project folder

right click on the project folder, JasperReports->Toggle JasperReports Nature

 

Best regards,

Chicu Veaceslav

 

Link to comment
Share on other sites

  • 2 months later...

Not sure if this is a bug or setting problem, I can't compile my main report in Eclipse, other 2 sub reports are fine. The main report uses org.apache.struts2.views.jasperreports.ValueStackDataSource.class, seems like when compiling my main report, Eclipse can't find the struts2 jasperreport plugin jar file in my project classpath, WEB-INF/lib.

Now I have to use iReport and include that struts2 jasperreports plugin to compile my report. I hope the newer version will be able to solve this problem.

Link to comment
Share on other sites

 It is JRXML Problem.

java.lang.ClassNotFoundException: org.apache.struts2.views.jasperreports.ValueStackDataSource

I have "struts2-jasperreports-plugin-2.0.11.2.jar" in my project/WEB-INF/lib not sure why it can't refer to that jar file or my project classpath.

Hope this help.

Link to comment
Share on other sites

Hi,

I created WEB-INF/lib folder in a project, inside I  have struts2-jasperreports-plugin-2.2.1.1.jar

I added this jar to projects classpath

(Right click on project name, Properties->Java BuildPath, Libraries->Add Jars ....,

then Order and Export, select all)  press OK

I run the report, the following error is thrown

java.lang.NoClassDefFoundError: com/opensymphony/xwork2/util/logging/LoggerFactory
    at org.apache.struts2.views.jasperreports.ValueStackDataSource.<clinit>(ValueStackDataSource.java:45)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:157)
    at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:115)
    at net.sf.jasperreports.engine.base.JRBaseField.getValueClass(JRBaseField.java:128)
    at net.sf.jasperreports.engine.design.JRVerifier.verifyFields(JRVerifier.java:999)
    at net.sf.jasperreports.engine.design.JRVerifier.verifyDataset(JRVerifier.java:2901)
    at net.sf.jasperreports.engine.design.JRVerifier.verifyDesign(JRVerifier.java:360)
    at net.sf.jasperreports.engine.design.JRVerifier.verifyDesign(JRVerifier.java:331)
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:255)
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:140)
    at net.sf.jasperreports.eclipse.builder.JasperReportCompiler.compileReport(JasperReportCompiler.java:148)
    at com.jaspersoft.studio.editor.preview.PreviewEditor$1.run(PreviewEditor.java:165)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.ClassNotFoundException: com.opensymphony.xwork2.util.logging.LoggerFactory
    at net.sf.jasperreports.eclipse.util.JavaProjectClassLoader.findClass(JavaProjectClassLoader.java:112)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 15 more

 

so, I added com.opensymphony.xwork   jars, and it works

maybe your classpath is incorect?

 

best regards,

Veaceslav Chicu

Link to comment
Share on other sites

 This is my Eclipse .claspath

<?xml version="1.0" encoding="UTF-8"?>

<classpath>

<classpathentry kind="src" path="src"/>

<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>

<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>

<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v5.5"/>

<classpathentry kind="output" path="build/classes"/>

</classpath>

 

and i have all the jars file inside WEB-INF\lib

alveole-struts2.jar

alveole-tools.jar

antlr-2.7.2.jar

aopalliance-1.0.jar

asm.jar

cglib-2.1.3.jar

classworlds-1.1.jar

commons-beanutils-1.7.0.jar

commons-chain-1.2.jar

commons-collections-3.2.1.jar

commons-digester-2.0.jar

commons-fileupload-1.2.1.jar

commons-io-1.3.2.jar

commons-lang-2.3.jar

commons-logging-api-1.1.jar

commons-validator-1.3.1.jar

dom4j-1.6.1.jar

dwr-1.1.1.jar

ezmorph-1.0.3.jar

freemarker-2.3.16.jar

groovy-all-1.7.5.jar

hibernate3.jar

iText-2.1.7.jar

ent/WEB-INF/lib/jasperreports-4.0.2.jar

jasperreports-fonts-4.0.2.jar

jasperreports-javaflow-4.0.2.jar

jdt-compiler-3.1.1.jar

json-lib-2.1-jdk15.jar

jta.jar

juli-6.0.18.jar

ldapjdk.jar

log4j-1.2.14.jar

ognl-3.0.jar

org.apache.felix.bundlerepository-1.2.1.jar

org.apache.felix.framework-1.4.1.jar

org.apache.felix.main-1.4.1.jar

org.apache.felix.shell.tui-1.0.2.jar

org.apache.felix.shell-1.0.2.jar

oro-2.0.8.jar

oval-1.31.jar

plexus-container-default-1.0-alpha-10.jar

plexus-utils-1.2.jar

poi-3.7-20101029.jar

poi-ooxml-3.7-20101029.jar

poi-ooxml-schemas-3.7-20101029.jar

sitemesh-2.4.2.jar

spring.jar

spring-beans-2.5.6.jar

spring-context-2.5.6.jar

spring-core-2.5.6.jar

spring-test-2.5.6.jar

spring-web-2.5.6.jar

sqljdbc4.jar

sslext-1.2-0.jar

struts2-codebehind-plugin-2.2.1.1.jar

struts2-config-browser-plugin-2.2.1.1.jar

struts2-convention-plugin-2.2.1.1.jar

struts2-core-2.2.1.1.jar

struts2-dojo-plugin-2.2.1.1.jar

struts2-dwr-plugin-2.2.1.1.jar

struts2-embeddedjsp-plugin-2.2.1.1.jar

struts2-jasperreports-plugin-2.2.1.1.jar

struts2-javatemplates-plugin-2.2.1.1.jar

struts2-jfreechart-plugin-2.2.1.1.jar

struts2-jsf-plugin-2.2.1.1.jar

struts2-json-plugin-2.2.1.1.jar

struts2-junit-plugin-2.2.1.1.jar

struts2-osgi-admin-bundle-2.2.1.1.jar

struts2-osgi-demo-bundle-2.2.1.1.jar

struts2-osgi-plugin-2.2.1.1.jar

struts2-oval-plugin-2.2.1.1.jar

struts2-pell-multipart-plugin-2.2.1.1.jar

struts2-plexus-plugin-2.2.1.1.jar

struts2-portlet-plugin-2.2.1.1.jar

struts2-rest-plugin-2.2.1.1.jar

struts2-sitegraph-plugin-2.2.1.1.jar

struts2-sitemesh-plugin-2.2.1.1.jar

struts2-spring-plugin-2.2.1.1.jar

struts2-struts1-plugin-2.2.1.1.jar

struts2-testng-plugin-2.2.1.1.jar

struts2-tiles-plugin-2.2.1.1.jar

struts-core-1.3.10.jar

testng-5.1-jdk15.jar

tiles-api-2.0.6.jar

tiles-core-2.0.6.jar

tiles-jsp-2.0.6.jar

velocity-1.6.3.jar

velocity-tools-1.3.jar

xalan-2.7.0.jar

xbean.jar

xpp3_min-1.1.3.4.O.jar

xstream-1.2.2.jar

xwork-core-2.2.1.1.jar

 

am i missing any important jar file ?

Link to comment
Share on other sites

Hi,

yes compile with Ctrl+B, but I allways compile before running the report, so it's not mandatory

you should add all your jars from WEB-INF/lib to the classpath, I don't see it inside this classpath entries

<classpath>

<classpathentry kind="src" path="src"/>

<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>

<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>

<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v5.5"/>

<classpathentry kind="output" path="build/classes"/>

</classpath>

 

 

Link to comment
Share on other sites

 isn't all jars in WEB-INF/lib included in

<classpath>

<classpathentry kind="src" path="src"/>

<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>

<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>

<classpathentry kind="con"path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v5.5"/>

<classpathentry kind="output" path="build/classes"/>

</classpath>

 

I have created a new project, just with struts2-jasperreports-plugin-2.2.1.1.jar & xwork-core-2.2.1.1.jar. Still having the same JRXML error. 

 

java.lang.ClassNotFoundException: org.apache.struts2.views.jasperreports.ValueStackDataSource

 

Attached is the new web project that i created, same as yours ?

Link to comment
Share on other sites

  • 3 years later...

Hi. You can compile a .jrxml in Project Explorer window of Jaspersoft Studio. By default, .jrxml report are in MyReports group. Expand this group, find your .jrxml report and rightclick on it. In context menu choose 'Compile report'. Then you get compiled .jasper report.

Link to comment
Share on other sites

Hi

You can compile a .jrxml in Project Explorer window. By default, .jrxml report are in MyReports group. Expand this group, find your .jrxml report and rightclick on it. In context menu choose 'Compile report'. Then you get compiled .jasper report.

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