Problem when I run the report

Hello people, I have a big problem. I've a report running from jasper studio ok, but when I execute this from my web application I get this error:

net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : 
Source text : ISODD($V{REPORT_COUNT}).equals(true)
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.3.1.final using JasperReports Library version 6.3.1  -->
<!-- 2017-08-01T20:40:36 -->
<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="dietaAlumno" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="084d528a-5515-4e6a-a086-abe06d202fd8">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="DataAdapter.xml"/>
<style name="estilo">
  <conditionalStyle>
   <conditionExpression><![CDATA[ISODD($V{REPORT_COUNT}).equals(false)]]></conditionExpression>
   <style mode="Opaque" backcolor="#E6F2FF"/>
  </conditionalStyle>
</style>
<parameter name="idAlumno" class="java.lang.String"/>
<parameter name="idDieta" class="java.lang.String"/>
<queryString language="SQL">
  <![CDATA[ SQL ....;]]>
</queryString>
Somebodey knows where is the problem ??
Thanks for all.
dcdacd's picture
40
Joined: Dec 6 2015 - 11:41pm
Last seen: 4 months 2 weeks ago

2 Answers:

Try replacing your condition to ($V{REPORT_COUNT} % 2) == 1

hozawa's picture
190683
Joined: Apr 24 2010 - 4:31pm
Last seen: 4 years 3 months ago
Thanks for your answer, but it not fine: 
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. Invalid digit (valid ones are 0..9)
                value = (((java.lang.Integer)variable_REPORT_COUNT.getValue())%2)==1; //$JR_EXPR_ID=22$
 
I write some as this:

<conditionalStyle>

<conditionExpression><![CDATA[($V{REPORT_COUNT}%2)==1]]></conditionExpression>

<style mode="Opaque" backcolor="#E6F2FF"/>

</conditionalStyle>

 
But I'm reading by the iNet and I try to change the las number 1 by 0 and its works fine.
 
Thanks for all !!!! 
dcdacd's picture
40
Joined: Dec 6 2015 - 11:41pm
Last seen: 4 months 2 weeks ago
Feedback
randomness