Ireport+eclipse+SCRIPTLET works only in Ireport

2
Hi to all,

I build a report that worked fine in Ireport and in eclipse/tomcat, but as soon i've added a scriptlet in the group expression it does not work no more in eclipse/tomcat(but works OK in ireport)
I've created a class qdettaglioscheda_cat_opScriptlet in eclipse, but it seems like class qdettaglioscheda_cat_opScriptlet could not be found in eclipse/tomcat

-----------------------------------------
------ This is the tomcat error log:
-----------------------------------------
e.getStackTrace[Ljava.lang.StackTraceElement;@e73783 it.ssssss.bbbbbb.oooooo.segnalazione.JasperReportsIntro - <init>
e.getMessage()Errors were encountered when compiling report expressions class file:


1. The method diverso() is undefined for the type JRAbstractScriptlet
value = (java.lang.Object)(((net.sf.jasperreports.engine.JRAbstractScriptlet) parameter_REPORT_SCRIPTLET.getValue()).diverso());
<----->


2. The method diverso() is undefined for the type JRAbstractScriptlet
value = (java.lang.Object)(((net.sf.jasperreports.engine.JRAbstractScriptlet) parameter_REPORT_SCRIPTLET.getValue()).diverso());
<----->


3. The method diverso() is undefined for the type JRAbstractScriptlet
value = (java.lang.Object)(((net.sf.jasperreports.engine.JRAbstractScriptlet) parameter_REPORT_SCRIPTLET.getValue()).diverso());
<----->




-----------------------------------------------------
---- Ireport Group expression
-----------------------------------------------------
$P{REPORT_SCRIPTLET}.diverso()



-------------------------------------------------
------- This is the scriptlet (i have also created in eclipse in default package)
----------------------------------------------------
import net.sf.jasperreports.engine.*;

public class qdettaglioscheda_cat_opScriptlet extends it.businesslogic.ireport.IReportScriptlet {

String CODICE_PRECEDENTE = new String("CD");

/** Creates a new instance of JRIreportDefaultScriptlet */
public qdettaglioscheda_cat_opScriptlet() {
}

public Boolean diverso() throws JRScriptletException
{
String CODICE_PARAGRAFO_FIELD = (String)this.getFieldValue("CODICE_PARAGRAFO");
String STRINGA_RITORNO = new String(" ");

if (CODICE_PRECEDENTE.equals(CODICE_PARAGRAFO_FIELD))
{
CODICE_PRECEDENTE = CODICE_PARAGRAFO_FIELD;
return Boolean.FALSE;
}
else
{
CODICE_PRECEDENTE = CODICE_PARAGRAFO_FIELD;
return Boolean.TRUE;
}
}

}




-----------------------------------------
----- JRXML file
-----------------------------------------

<?xml version="1.0" encoding="UTF-8" ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
name="qdettaglioscheda_cat_op"
columnCount="1"
printOrder="Vertical"
orientation="Portrait"
pageWidth="595"
pageHeight="842"
columnWidth="535"
columnSpacing="0"
leftMargin="30"
rightMargin="30"
topMargin="20"
bottomMargin="20"
whenNoDataType="NoPages"
scriptletClass="qdettaglioscheda_cat_opScriptlet"
isTitleNewPage="false"
isSummaryNewPage="false">
<property name="ireport.scriptlethandling" value="1" />
<property name="ireport.encoding" value="UTF-8" />
<import value="java.util.*" />
<import value="net.sf.jasperreports.engine.*" />
<import value="net.sf.jasperreports.engine.data.*" />

<parameter name="SECONDO_IND" isForPrompting="false" class="java.lang.String"/>
<parameter name="CODICE_DEL_PARAGRAFO_PRECEDENTE" isForPrompting="false" class="java.lang.String"/>
<parameter name="CODICE_APPO" isForPrompting="false" class="java.lang.String"/>
<parameter name="NumeroScheda" isForPrompting="false" class="java.lang.String">
<defaultValueExpression ><![CDATA["CROP4362"]]></defaultValueExpression>
</parameter>
<queryString><![CDATA[SELECT
*
FROM
XXXXXXXXX
WHERE
XXXXXXXXXXXXXXXXXXXXXXXXX
ORDER BY
XXXXXXXXXXXXXXXXXXXXXXXXXXXX
></queryString>

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

<group name="CODICE_DEL_CAMPO" isReprintHeaderOnEachPage="true" >
<groupExpression><![CDATA[$P{REPORT_SCRIPTLET}.diverso()]]></groupExpression>
<groupHeader>
<band height="15" isSplitAllowed="true" >
<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
mode="Opaque"
x="2"
y="2"
width="175"
height="13"
forecolor="#000000"
backcolor="#CCCCCC"
key="textField-1"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement>
<font pdfFontName="Helvetica-BoldOblique" size="10" isBold="true" isItalic="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[" " + $F{CODICE_PARAGRAFO}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
mode="Opaque"
x="178"
y="2"
width="354"
height="13"
forecolor="#000000"
backcolor="#CCCCCC"
key="textField-4"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement>
<font pdfFontName="Helvetica-BoldOblique" size="10" isBold="true" isItalic="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[" " + $F{DESCRIZIONEPARAGRAFO}]]></textFieldExpression>
</textField>
.................................................................................................... .........................................................................
.................................................................................................... .........................................................................
.................................................................................................... .........................................................................
....................................................................................................

Post edited by: jprohaska, at: 2007/03/20 11:45
Post edited by: jprohaska, at: 2007/03/20 11:48
jprohaska's picture
Joined: Feb 20 2007 - 6:14pm
Last seen: 12 years 2 months ago

2 Answers:

0
Problem FIXED by moving jasper*.jar from tomcat/lib to application/lib

John
jprohaska's picture
Joined: Feb 20 2007 - 6:14pm
Last seen: 12 years 2 months ago
0

Hi, sorry but can i ask u something?....please......

i have a problem with tomcat, cause in Ireport and in eclipse everything's works fine but in tomcat says File not found but the position it's right.

Can u help me plzzz

marlui89's picture
Joined: Nov 11 2014 - 1:28am
Last seen: 3 years 1 month ago
Feedback
randomness