[#13326] - ClassCastException when using default conditional style and List/Table elements

Category:
Bug report
Priority:
High
Status:
New
Project: Severity:
Minor
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:
0

I always reproduce this bug when have a list/table element and default conditional style.
Tool: TIBCO Jaspersoft® Studio 6.13.0

Example:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.16.0.final using JasperReports Library version 6.16.0-48579d909b7943b64690c65c71e07e0b80981928 -->
<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="conditional_style" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="67f2117f-0f6b-48b6-8e5f-25f9d66f0328">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<style name="Style1" isDefault="true">
<conditionalStyle>
<conditionExpression><![CDATA[true]]></conditionExpression>
<style/>
</conditionalStyle>
</style>
<subDataset name="Dataset1" uuid="c58649df-5337-4bd1-87e8-d7f4baed16d5">
<queryString>
<![CDATA[]]>
</queryString>
</subDataset>
<queryString>
<![CDATA[]]>
</queryString>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="84" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="555" height="84" uuid="518787f3-3b91-49fa-8ce3-435b3cf5a85f"/>
<textFieldExpression><![CDATA["Title"]]></textFieldExpression>
</textField>
</band>
</title>
<summary>
<band height="76">
<componentElement>
<reportElement x="0" y="0" width="555" height="76" uuid="742725a2-d1b3-445f-870d-ef7c77af9315"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="Dataset1" uuid="9e3653cc-5b98-497b-9b1a-0e5f7fddae28">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource()]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="76" width="555">
<staticText>
<reportElement x="0" y="0" width="555" height="76" uuid="e9ee1e15-e3fc-4475-b214-94376b037d4e"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[LIST]]></text>
</staticText>
</jr:listContents>
</jr:list>
</componentElement>
</band>
</summary>
</jasperReport>

Error text:
net.sf.jasperreports.engine.JRException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean
at com.jaspersoft.studio.editor.preview.view.control.ReportController.fillReport(ReportController.java:551)
at com.jaspersoft.studio.editor.preview.view.control.ReportController.access$18(ReportController.java:526)
at com.jaspersoft.studio.editor.preview.view.control.ReportController$1.run(ReportController.java:444)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean
at net.sf.jasperreports.engine.fill.JRFillElementContainer.buildConsolidatedStyle(JRFillElementContainer.java:1267)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluateConditionalStyle(JRFillElementContainer.java:1228)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluateConditionalStyles(JRFillElementContainer.java:1216)
at net.sf.jasperreports.components.list.FillListContents.evaluateContents(FillListContents.java:84)
at net.sf.jasperreports.components.list.VerticalFillList.prepare(VerticalFillList.java:110)
at net.sf.jasperreports.engine.fill.JRFillComponentElement.prepare(JRFillComponentElement.java:152)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:542)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:453)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:428)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillBandNoOverflow(JRVerticalFiller.java:450)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnHeader(JRVerticalFiller.java:498)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:262)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:110)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:621)
at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:135)
at java.lang.Thread.run(Thread.java:748)

I want to use "Times New Roman" font for all output formats except PDF. For PDF I want to use embedded "Times New Roman CP1251 (Cyrillic)".
The problem is that "Times New Roman CP1251 (Cyrillic)" font makes XLSX output "ugly".

I want to solve this problem globally by using conditional default styles based on checking the current output format. But reports containing "List" and "Table" elements throw "java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean".

What am I doing wrong? Please, help me.

AttachmentSize
Binary Data classcastexceptionexample.jrxml2.36 KB
v 6.13.0
JasperReports
virtualfun's picture
Joined: Jan 20 2020 - 10:19am
Last seen: 3 weeks 4 days ago
Feedback