![](http://content.invisioncic.com/i328763/set_resources_3/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
msarmc
-
Posts
3 -
Joined
-
Last visited
Content Type
Forum
Downloads
Featured Visualizations
Knowledge Base
Documentation (PDF Downloads)
Blog
Documentation (Test Area)
Documentation
Dr. Jaspersoft Webinar Series
Security Advisories
Events
Profiles
Posts posted by msarmc
-
-
Thanks for the suggestion but unfortunately I still get the same error. There evidently was some internal change from 4.1.2 to 4.5 that no longer correctly handles how the data is arranged. I use that same expression in many other jrxml files and it works fine in 4.5. I've attached a pdf of how the report is supposed to look. I have determined that the first set of data (Resource By Activity) processes correctly. However, when it gets to Resource By Entity (which is a separate data source and jrxml file) I get the error. I determined that the Period Name Week1 (a String) was returned from the expression evaluation instead of a Boolean.
Thanks again for your suggestion. I'll keep investigating.
Mike
-
Hi,
I have a condition expression in a conditional style that worked fine with JasperReports 4.1.2 but no longer works in 4.5. I have a group called PeriodGroup defined. Here is the xml.
<style name="alternateStyle" backcolor="white" forecolor="black" fontSize="8">
<conditionalStyle>
<conditionExpression>new Boolean($V{PeriodGroup_COUNT}.intValue() % 2 == 0)</conditionExpression>
<style backcolor="yellow"/>
</conditionalStyle>
</style>I am getting a class cast exception. It appears the PeriodName (which is a String and is the variable that groups the items) is being returned instead of a boolean. Here is the stack trace.
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
at net.sf.jasperreports.engine.fill.JRFillElementContainer.buildConsolidatedStyle(JRFillElementContainer.java:769)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluateConditionalStyle(JRFillElementContainer.java:730)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluateConditionalStyles(JRFillElementContainer.java:718)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:472)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2021)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:755)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:265)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:128)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:836)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:765)
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:644)
at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)
at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRunner.java:205)
at java.lang.Thread.run(Thread.java:619)
Do I need to change something? I use this same conditional style in other reports with no issue. I've attached the jrxml file.
Thanks, Mike
Condition expression
in Products
Posted
Thank you Lucian.
Mike