Содержание
- background
- Use the report function designed by TIBCO Jaspersoft Studio. Error evaluating expression for source text: $P is reported when loading the template. xx is the parameter name set by yourself. I found too little information on the Internet. I found it by myself. This pit
- solution
- Intelligent Recommendation
- org.attoparser.ParseException: Exception evaluating SpringEL expression: «rvo.user.username» (templa
- BUG record: Exception evaluating SpringEL expression
- Error evaluating expression ‘record.productCategoryId != null‘ Cause. NoSuchPropertyException
- Caused by: org.apache.ibatis.builder.BuilderException: Error evaluating expression ‘dept.name
- org.apache.ibatis.builder.BuilderException: Error evaluating expression ‘sid ! =null and sid != ‘‘‘.
- Error evaluating expression source text
- Share this:
- Like this:
- Related
- 9 Responses to Some common errors in Jasper report: SEVERE: Digester.getParser and JRException: Error compiling report java source files
- Error evaluating expression source text
- Intelligent Recommendation
- HTML page DateTime conversion format Anomaly resolution Caused by: org.attoparser.Parsexception: Exception Evaluating Springel EX
- JasperPrint loading template exception Error evaluating expression for source text: $P
- Nested Exception is org.apache.ibatis.builder.Buildrexception: Error Evaluating Expression
- SpringEL Expression Language
- Spring expression SpringEL
- Выражение источника данных вложенного отчета для XML-документа
- 3 ответы
background
Use the report function designed by TIBCO Jaspersoft Studio. Error evaluating expression for source text: $P is reported when loading the template. xx is the parameter name set by yourself. I found too little information on the Internet. I found it by myself. This pit
solution
1. Generally, this exception is reported when loading the template
2. This exception is caused because the data type in the map is inconsistent with the input parameter type of the report designed in Jaspersoft! Just update the types to be consistent.
Intelligent Recommendation
org.attoparser.ParseException: Exception evaluating SpringEL expression: «rvo.user.username» (templa
Point he can visit normally And if he clicks, he will report an error Because the code is not upset, the username is not obtained After checking, I found that the userId in the comment table should be.
BUG record: Exception evaluating SpringEL expression
Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: “page.content” (template: “admin/types” — line 66, col 13) First, let.
Error evaluating expression ‘record.productCategoryId != null‘ Cause. NoSuchPropertyException
Appears in SQL: Caused by: org.apache.ibatis.builder.BuilderException: Error evaluating expression ‘record.productCategoryId != null ‘. Cause: org.apache.ibatis.ognl.NoSuchPropertyException: com.ipuc.
Caused by: org.apache.ibatis.builder.BuilderException: Error evaluating expression ‘dept.name
Caused by: org.apache.ibatis.builder.BuilderException: Error evaluating expression ‘dept.name != null and dept.name != ‘’’. Cause: org.apache.ibatis.ognl.OgnlException: source .
org.apache.ibatis.builder.BuilderException: Error evaluating expression ‘sid ! =null and sid != ‘‘‘.
When we sometimes have an error, we should take a look at the system’s error information. Most of the errors, and the system will give specific code problems. Like my error, the error is as follows: A.
Источник
Error evaluating expression source text
However, I encountered the following problems.
(Please note that when I refer to jasperreport library, I mean my customized library that contains a number of jar files that are necessary to compile and run jasperreport. You can name the library whatever you’d like to.
Feb 15, 2008 4:23:50 PM org.apache.commons.digester.Digester getParser
SEVERE: Digester.getParser:
javax.xml.parsers.ParserConfigurationException: XML document validation is not supported
at com.bluecast.xml.JAXPSAXParserFactory.newSAXParser(JAXPSAXParserFactory.java:103)
I am not sure if I understand it correctly. After several goolging attempts, I’ve found that it’s because there are more than one xml parser libraries in the library path of the project running Jasper. As a result, Jasper report uses the wrong xerces.jar path.
From my understanding is that:
- A project contains several tasks relating to XML documents such as parsing text from XML documents and creating Jasper report.
- Developer of the project add other xml parser libraries in addition to the Jasper report library into the project library class path. For example, the developer adds piccolo.jar and jasperreports–version–.jar and other commons jar libraries.
- The problem is that instead of using its own xerces library, the Jasper report uses xerces of the piccolo.jar library. (It may not be correct, but the idea is Jasper uses the wrong library).
- As a results, when executing the program, the error above is generated.
SOLUTION for ERROR #1
The solution to this error is that we need to put jasperreports library in front of piccolo library in the project library class path. To do this in Netbeans IDE 6.0.1, perform the following steps.
- Right click on the project name in the project window
- Click on Properties
- Click on Libraries
- We will see that the jasper library is below piccolo library.
- To fix the error, click on Jasper library and click “Move up” to move the Jasper library to be above other xml parser libraries such as “Piccolo” or “Jdom”.
- Close the project library window, click Run again on the Netbeans IDE.
After I fixed the ERROR#1 above, I get this error#2. The cause of this error is that it requires jdt-compiler–version–.jar library. This library can be found in the “lib” directory under the jasperreports-project.tar.gz.
net.sf.jasperreports.engine.JRException: Error compiling report java source files : /HelloReportWorld_1203118710653_430914.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.JasperCompileManager.compileReport(JasperCompileManager.java:220)
SOLUTION for ERROR#2
To fix this error, we will add jdt-compiler-version.jar into the jasper library in the Netbeans IDE. Follow the steps below.
- On the Netbeans IDE, Tools–>Libraries
- Click on “Jasper” on the Libraries window. (Note that “Jasper” is the name of Jasper library that contains jasperreports.jar and other commons-.jar libraries. The name of this library can be arbitrary, depending on developer.)
- Then, click “Add Jar”
- Browse the where the jdt-compiler-version.jar is, and add it to the “Jasper” library.
- Close the library window, and run the program again.
Now, the Jasper report should be generated successfully.
ERROR #3: I receive another error when I try to generate pdf document using:
JasperExportManager.exportReportToPdfFile(
jasperPrint, reportDest);
SOLUTION TO ERROR #3: If anyone gets an error when running jasperreports for generating pdf file, to fix this error you have to add itext.jar library to the Jasper library.
Just for a reference, libraries that I’ve added to the Jasper library are:
- commons-beanutils-1.7.jar
- commons-collections-2.1.jar
- commons-digester.jar
- commons-javaflow-20060411.jar
- commons-logging-2.0.1.jar
- jdt-compiler-3.1.1.jar
- jasperreports-2.04.jar
- xercesImpl.jar (This library is required for fixing ERROR#1)
- itext-1.3.1.jar (for printing pdf)
Like this:
9 Responses to Some common errors in Jasper report: SEVERE: Digester.getParser and JRException: Error compiling report java source files
Thanks for suggetion.
great job,dear friend. i also confused by the tutorial, it created long long ago…..
javax.xml.ws.WebServiceException: Unable to create JAXBContext due to the security restriction
i’m getting this error when i’m compile my servlet program which is going to connect into jasper report.
can u plz give me the suggestions to overcome this error
Followed the exact same tutorial, and ran into ERROR#2.
great article, thanks
Thanks buddy ! You made my day …
Hey thanks for your valuable comments
Thanks man you put a smile on my face 😀
Error filling print… Error evaluating expression : Source text : $F
net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : $F at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:195) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:589) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:557) at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:929) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:383) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:368) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:258) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:499) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2036) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:760) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportContent(JRVerticalFiller.java:290) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:132) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:946) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:845) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:58) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:878) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object ‘oracle.sql.TIMESTAMP@16cb856’ with class ‘oracle.sql.TIMESTAMP’ to class ‘oracle.sql.TIMESTAMP’ at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:327) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.castToType(ScriptBytecodeAdapter.java:602) at Reconciliation_execution_status_Report_1318485205281_751615.evaluate(calculator_Reconciliation_execution_status_Report_1318485205281_751615:179) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:182) … 19 more
CAN ANYONE HELP ME OUT TO GET RESOLVE ABOVE ERROR
Источник
Error evaluating expression source text
Reporting error message 1:
Reporting error information 2:
Front End Page Using Thymeleaf Get Value
Change the postcode: session.user? .Name Add a judgment, determine that the user can’t be empty
In the background controller, it can be determined that the user can’t be empty.
Reason for error: Do not affect the use, just start logging in, once the session is emptied, the object Name value is not available, all empty pools, so it is necessary to judge that the object cannot be empty
Intelligent Recommendation
HTML page DateTime conversion format Anomaly resolution Caused by: org.attoparser.Parsexception: Exception Evaluating Springel EX
Page error information is as follows Caused by: org.attoparser.ParseException: Exception evaluating SpringEL expression: “#dates.format(i.milestoneEndDate,‘yyyy-MM-dd HH:mm:ss’)&rdqu.
JasperPrint loading template exception Error evaluating expression for source text: $P
background Use the report function designed by TIBCO Jaspersoft Studio. Error evaluating expression for source text: $P is reported when loading the template. xx is the parameter name set by yours.
Nested Exception is org.apache.ibatis.builder.Buildrexception: Error Evaluating Expression
This exception is usually a dynamic SQL problem. According to the later prompt information, find the corresponding SQL, check the dynamic SQL syntax. Problem Description Abnormal information: nested e.
SpringEL Expression Language
Spring learning summary: expression language Spring Expression Language table of Contents SpEL introduction and features First, why do you need the Spring Expression Language? Second, the SpEL express.
Spring expression SpringEL
Note that Spring expressions use # <«xxx»>instead of $<«xxx»>. $ <«xxx»>is mainly used to parse properties and yml files, and the spring expression # <«xxx»>is .
Источник
Выражение источника данных вложенного отчета для XML-документа
Я пытаюсь заставить подотчет работать с отчетом, используя XML-документ в качестве источника данных.
Когда я сортирую данные основного отчета, подотчету не нужно повторно запрашивать XML-документ. Ожидается JRSortableDataSourceне JRXmlDataSource.
Что я делаю не так?
Я использовал следующее выражение источника данных:
задан 09 марта ’13, 03:03
3 ответы
Ваше выражение источника данных $P).subDataSource(«/B/C»)
Имеет синтаксическую ошибку
Сначала вы пропустили непревзойденный персонаж (
Затем
Если он ожидает JRSortableDataSource
Используйте это выражение
((net.sf.jasperreports.engine.data.JRSortableDataSource)$P).subDataSource(«DefineThat»)
Если он ожидает JRXmlDataSource
Используйте это выражение
((net.sf.jasperreports.engine.data.JRXmlDataSource)$P).subDataSource(«DefineThat»)
ответ дан 11 мар ’13, в 08:03
Я действительно использовал $P.subDataSource(«/person/phone»). Я отсортировал основной отчет по имени. после этого у меня такая же ошибка. Я не знаю, как решить эту ошибку. Если вы не возражаете, пожалуйста, объясните мне шаг за шагом. Потому что я новый пользователь Jasper Report. Спасибо. — шарифа
Вы должны бросить $P параметр к ( JRXmlDataSource type), тогда ваше выражение источника данных должно быть таким ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P).subDataSource(«/person/phone») НЕ $P.subDataSource(«/person/phone») — ахмеднабиль88
Я уже менял просто так. Но ошибка все равно возникает. А также я использовал выражение фильтра в подотчете, передав параметр из основного отчета. В настоящее время номер телефона отображается только один. Я хочу показать многим номер телефона. обладал тот человек. Этот фильтр мне не подходит. Я не знаю, как это сделать. Если вы знаете другой способ, пожалуйста, объясните мне. Спасибо. — шарифа
когда кто-то использует приведенное выше выражение для подключения для создания подотчета в Jasper с использованием источника данных XML, нам нужно установить язык отчета как groovy вместо Java. Я думаю, что subdatasource — это не метод, определенный в Java, а в groovy. Я пытаюсь найти метод, эквивалентный приведенному выше в Java
Источник
net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : en_EN
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Domsense Agile BG OpenERP Addons
|
New |
Undecided |
Unassigned
|
Bug Description
When previewing report account_statement_report/report/jasper_account_statement.jrxml under iReport 4.5.0, the following error is reported:
Error filling print… Error evaluating expression :
Source text : en_EN
net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :
Source text : en_EN
at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:203)
at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:591)
at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:559)
at net.sf.jasperreports.engine.fill.JRFillDataset.setFillParameterValues(JRFillDataset.java:660)
at net.sf.jasperreports.engine.fill.JRFillDataset.setParameterValues(JRFillDataset.java:603)
at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1158)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:802)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:746)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:58)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247)
at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:879)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Caused by: groovy.lang.MissingPropertyException: No such property: en_EN for class: report6_1340955326514_37899
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:49)
at org.codehaus.groovy.runtime.callsite.GetEffectivePogoPropertySite.getProperty(GetEffectivePogoPropertySite.java:86)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:239)
at report6_1340955326514_37899.evaluate(calculator_report6_1340955326514_37899:191)
at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:190)
… 13 more
Permalink
Cannot retrieve contributors at this time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* JasperReports — Free Java Reporting Library. | |
* Copyright (C) 2001 — 2022 TIBCO Software Inc. All rights reserved. | |
* http://www.jaspersoft.com | |
* | |
* Unless you have purchased a commercial license agreement from Jaspersoft, | |
* the following license terms apply: | |
* | |
* This program is part of JasperReports. | |
* | |
* JasperReports is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU Lesser General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* JasperReports is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU Lesser General Public License for more details. | |
* | |
* You should have received a copy of the GNU Lesser General Public License | |
* along with JasperReports. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
package net.sf.jasperreports.engine.fill; | |
import net.sf.jasperreports.engine.JRConstants; | |
import net.sf.jasperreports.engine.JRException; | |
import net.sf.jasperreports.engine.JRExpression; | |
/** | |
* @author Teodor Danciu (teodord@users.sourceforge.net) | |
*/ | |
public class JRExpressionEvalException extends JRException | |
{ | |
private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; | |
public static final String EXCEPTION_MESSAGE_KEY_EVALUATE_EXPRESSION_ERROR = «fill.common.evaluate.expression.error»; | |
/** | |
* | |
*/ | |
private JRExpression expression; | |
/** | |
* | |
*/ | |
public JRExpressionEvalException(JRExpression expr, Throwable throwable) | |
{ | |
super( | |
EXCEPTION_MESSAGE_KEY_EVALUATE_EXPRESSION_ERROR, | |
new Object[]{expr.getText()}, | |
throwable | |
); | |
expression = expr; | |
} | |
/** | |
* | |
*/ | |
public JRExpression getExpression() | |
{ | |
return this.expression; | |
} | |
} |
Я работал в веб-проекте, где клиенту нужно показать отчет, например, идентификационную карту. Я разработал структуру отчета в Illustrator и экспортировал его как SVG, поэтому BatikRenderer обрабатывает файл и показывает его в отчете. И в iReport просто включите поля, которые я собираюсь показать. Так что в основном это работает в iReport Designer 5.5.0.
Когда я скомпилирую его и покажу предварительный просмотр. Кажется, все в порядке.
Вот мой jrxml:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="prueba" whenNoDataType="AllSectionsNoDetail" language="groovy" pageWidth="180" pageHeight="288" columnWidth="180" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="2cedbacf-8972-4cbe-bf07-7d3af62126d5">
<detail>
<band height="288" splitType="Stretch">
<image>
<reportElement x="0" y="0" width="180" height="288" uuid="3c8031c1-70ca-4e47-be8e-735b90b7797a"/>
<imageExpression class="net.sf.jasperreports.engine.JRRenderable"><![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromLocation("svg-design.svg")]]></imageExpression>
</image>
</band>
</detail>
</jasperReport>
Я использовал другой вариант с абсолютным путем, и он тоже работает:
<![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstance(new java.io.File("/Users/RogelioMonge/Dropbox/Adepafut/src/java/com/adepafut/common/reports/svg-design.svg"))]]>
Проблема в том, что я пытаюсь выполнить отчет из своего приложения. Я использую мой отчет с пустым источником данных, только для теста SVG, мне нужно добиться этого первым, чтобы я мог продолжить заполнение отчета с помощью DataSource.
Вот фиктивный код, который я использовал для проверки отчета:
try {
Map<String, Object> parameters = new HashMap<String, Object>();
JRDataSource dataSource = null;
InputStream report = this.getClass().getClassLoader().getResourceAsStream(JugadorReportEnum.PATH_REPORT.getValue());
JasperPrint jasperPrint = JasperFillManager.fillReport(report, parameters, dataSource);
JasperViewer jv = new JasperViewer(jasperPrint, false);
jv.viewReport(jasperPrint, false);
} catch (JRException ex) {
Logger.getLogger(ReportHandler.class.getName()).log(Level.SEVERE, null, ex);
}
Вот Исключение:
ex = (net.sf.jasperreports.engine.fill.JRExpressionEvalException)net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :
Source text : net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromLocation("svg-design.svg")
I’ve followed a tutorial on how to use Jasper report in Netbeans IDE at http://developers.sun.com/jsenterprise/reference/techart/jse8/jasper_reports.html
However, I encountered the following problems.
(Please note that when I refer to jasperreport library, I mean my customized library that contains a number of jar files that are necessary to compile and run jasperreport. You can name the library whatever you’d like to.
ERROR#1:
<code>
Feb 15, 2008 4:23:50 PM org.apache.commons.digester.Digester getParser
SEVERE: Digester.getParser:
javax.xml.parsers.ParserConfigurationException: XML document validation is not supported
at com.bluecast.xml.JAXPSAXParserFactory.newSAXParser(JAXPSAXParserFactory.java:103)
</code>
I am not sure if I understand it correctly. After several goolging attempts, I’ve found that it’s because there are more than one xml parser libraries in the library path of the project running Jasper. As a result, Jasper report uses the wrong xerces.jar path.
From my understanding is that:
- A project contains several tasks relating to XML documents such as parsing text from XML documents and creating Jasper report.
- Developer of the project add other xml parser libraries in addition to the Jasper report library into the project library class path. For example, the developer adds piccolo.jar and jasperreports–version–.jar and other commons jar libraries.
- The problem is that instead of using its own xerces library, the Jasper report uses xerces of the piccolo.jar library. (It may not be correct, but the idea is Jasper uses the wrong library).
- As a results, when executing the program, the error above is generated.
SOLUTION for ERROR #1
The solution to this error is that we need to put jasperreports library in front of piccolo library in the project library class path. To do this in Netbeans IDE 6.0.1, perform the following steps.
- Right click on the project name in the project window
- Click on Properties
- Click on Libraries
- We will see that the jasper library is below piccolo library.
- To fix the error, click on Jasper library and click “Move up” to move the Jasper library to be above other xml parser libraries such as “Piccolo” or “Jdom”.
- Close the project library window, click Run again on the Netbeans IDE.
ERROR#2
After I fixed the ERROR#1 above, I get this error#2. The cause of this error is that it requires jdt-compiler–version–.jar library. This library can be found in the “lib” directory under the jasperreports-project.tar.gz.
<code>
net.sf.jasperreports.engine.JRException: Error compiling report java source files : /HelloReportWorld_1203118710653_430914.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.JasperCompileManager.compileReport(JasperCompileManager.java:220)
</code>
SOLUTION for ERROR#2
===================
To fix this error, we will add jdt-compiler-version.jar into the jasper library in the Netbeans IDE. Follow the steps below.
- On the Netbeans IDE, Tools–>Libraries
- Click on “Jasper” on the Libraries window. (Note that “Jasper” is the name of Jasper library that contains jasperreports.jar and other commons-.jar libraries. The name of this library can be arbitrary, depending on developer.)
- Then, click “Add Jar”
- Browse the where the jdt-compiler-version.jar is, and add it to the “Jasper” library.
- Close the library window, and run the program again.
Now, the Jasper report should be generated successfully.
ERROR #3: I receive another error when I try to generate pdf document using:
<code>
JasperExportManager.exportReportToPdfFile(
jasperPrint, reportDest);
</code>
SOLUTION TO ERROR #3: If anyone gets an error when running jasperreports for generating pdf file, to fix this error you have to add itext.jar library to the Jasper library.
Just for a reference, libraries that I’ve added to the Jasper library are:
- commons-beanutils-1.7.jar
- commons-collections-2.1.jar
- commons-digester.jar
- commons-javaflow-20060411.jar
- commons-logging-2.0.1.jar
- jdt-compiler-3.1.1.jar
- jasperreports-2.04.jar
- xercesImpl.jar (This library is required for fixing ERROR#1)
- itext-1.3.1.jar (for printing pdf)