首页 > 解决方案 > jasper Excel 报告中动态更改单元格颜色

问题描述

我正在使用 TIBCO jasper studio 生成 Excel 报告。我无法根据条件更改单元格的背景颜色。我在 PDF 中给出了相同的条件,它工作正常,但对于 Excel,颜色没有显示。谁能帮我?

下面给出的是给定的条件:

<style name="highlight1">
    <conditionalStyle>
        <conditionExpression><![CDATA[$F{associateDetectors}.get("assoDet1").equals(new java.lang.Integer(1))]]></conditionExpression>
        <style mode="Opaque" backcolor="#FFFF00"/>
    </conditionalStyle>
</style>
<style name="highlight2">
    <conditionalStyle>
        <conditionExpression><![CDATA[$F{associateDetectors}.get("assoDet2").equals(new java.lang.Integer(2))]]></conditionExpression>
        <style mode="Opaque" backcolor="#FFFF00"/>
    </conditionalStyle>
</style>

在这里,我从 HashMap (associateDetectors) 获取值(键是字符串,值是整数)

以下是我的整个 jrxml:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.2.2.final using JasperReports Library version 6.2.2  -->
<!-- 2018-12-13T11:59:19 -->
<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="DetectorStatusReport" pageWidth="992" pageHeight="595" orientation="Landscape" columnWidth="952" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="ced95029-b569-4027-895c-af2843a4e088">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
    <property name="com.jaspersoft.studio.unit." value="pixel"/>
    <property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
    <property name="net.sf.jasperreports.export.xls.create.custom.palette" value="true"/>
    <property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true"/>
    <property name="net.sf.jasperreports.export.xls.ignore.cell.background" value="false"/>
    <style name="Title" fontSize="50" isBold="true"/>
    <style name="SubTitle" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
    <style name="Column header" forecolor="#666666" fontName="Arial" fontSize="30" isBold="true"/>
    <style name="Detail" fontName="Arial" fontSize="12"/>
    <style name="highlight1">
        <conditionalStyle>
            <conditionExpression><![CDATA[$F{associateDetectors}.get("assoDet1").equals(new java.lang.Integer(1))]]></conditionExpression>
            <style mode="Opaque" backcolor="#FFFF00"/>
        </conditionalStyle>
    </style>
    <style name="highlight2">
        <conditionalStyle>
            <conditionExpression><![CDATA[$F{associateDetectors}.get("assoDet2").equals(new java.lang.Integer(2))]]></conditionExpression>
            <style mode="Opaque" backcolor="#FFFF00"/>
        </conditionalStyle>
    </style>
    <style name="highlight3">
        <conditionalStyle>
            <conditionExpression><![CDATA[$F{associateDetectors}.get("assoDet3").equals(new java.lang.Integer(3))]]></conditionExpression>
            <style mode="Opaque" backcolor="#FFFF00"/>
        </conditionalStyle>
    </style>
    <style name="highlight4">
        <conditionalStyle>
            <conditionExpression><![CDATA[$F{associateDetectors}.get("assoDet4").equals(new java.lang.Integer(4))]]></conditionExpression>
            <style mode="Opaque" backcolor="#FFFF00"/>
        </conditionalStyle>
    </style>
    <style name="highlight5">
        <conditionalStyle>
            <conditionExpression><![CDATA[$F{associateDetectors}.get("assoDet5").equals(new java.lang.Integer(5))]]></conditionExpression>
            <style mode="Opaque" backcolor="#FFFF00"/>
        </conditionalStyle>
    </style>
    <style name="highlight6">
        <conditionalStyle>
            <conditionExpression><![CDATA[$F{associateDetectors}.get("assoDet6").equals(new java.lang.Integer(6))]]></conditionExpression>
            <style mode="Opaque" backcolor="#FFFF00"/>
        </conditionalStyle>
    </style>
    <style name="highlight7">
        <conditionalStyle>
            <conditionExpression><![CDATA[$F{associateDetectors}.get("assoDet7").equals(new java.lang.Integer(7))]]></conditionExpression>
            <style mode="Opaque" backcolor="#FFFF00"/>
        </conditionalStyle>
    </style>
    <style name="highlight8">
        <conditionalStyle>
            <conditionExpression><![CDATA[$F{associateDetectors}.get("assoDet8").equals(new java.lang.Integer(8))]]></conditionExpression>
            <style mode="Opaque" backcolor="#FFFF00"/>
        </conditionalStyle>
    </style>
    <style name="highlight9">
        <conditionalStyle>
            <conditionExpression><![CDATA[$F{associateDetectors}.get("assoDet9").equals(new java.lang.Integer(9))]]></conditionExpression>
            <style mode="Opaque" backcolor="#FFFF00"/>
        </conditionalStyle>
    </style>
    <style name="highlight10">
        <conditionalStyle>
            <conditionExpression><![CDATA[$F{associateDetectors}.get("assoDet10").equals(new java.lang.Integer(10))]]></conditionExpression>
            <style mode="Opaque" backcolor="#FFFF00"/>
        </conditionalStyle>
    </style>
    <parameter name="junctionName" class="java.lang.String">
        <parameterDescription><![CDATA[]]></parameterDescription>
    </parameter>
    <parameter name="frm_date" class="java.lang.String"/>
    <parameter name="to_date" class="java.lang.String"/>
    <queryString>
        <![CDATA[]]>
    </queryString>
    <field name="rtc" class="java.sql.Timestamp">
        <fieldDescription><![CDATA[rtc]]></fieldDescription>
    </field>
    <field name="health" class="java.lang.String">
        <fieldDescription><![CDATA[health]]></fieldDescription>
    </field>
    <field name="planNo" class="java.lang.Integer">
        <fieldDescription><![CDATA[planNo]]></fieldDescription>
    </field>
    <field name="phaseTime" class="java.lang.Integer">
        <fieldDescription><![CDATA[phaseTime]]></fieldDescription>
    </field>
    <field name="phaseNo" class="java.lang.Integer">
        <fieldDescription><![CDATA[phaseNo]]></fieldDescription>
    </field>
    <field name="phaseColour" class="java.lang.String">
        <fieldDescription><![CDATA[phaseColour]]></fieldDescription>
    </field>
    <field name="cycleTime" class="java.lang.Integer">
        <fieldDescription><![CDATA[cycleTime]]></fieldDescription>
    </field>
    <field name="totalVehicleCount" class="java.lang.String">
        <fieldDescription><![CDATA[totalVehicleCount]]></fieldDescription>
    </field>
    <field name="detectorStatusVal" class="java.util.HashMap">
        <fieldDescription><![CDATA[detectorStatusVal]]></fieldDescription>
    </field>
    <field name="associateDetectors" class="java.util.HashMap">
        <fieldDescription><![CDATA[associateDetectors]]></fieldDescription>
    </field>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="97" splitType="Stretch">
            <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
            <frame>
                <reportElement mode="Opaque" x="-10" y="-30" width="862" height="50" forecolor="#9C6444" uuid="b87c1b65-3be3-42ce-885f-21b7d1f29a17">
                    <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
                </reportElement>
                <box>
                    <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#0F0B0B"/>
                    <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#0F0B0B"/>
                    <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#0F0B0B"/>
                    <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#0F0B0B"/>
                </box>
                <staticText>
                    <reportElement style="Title" positionType="Float" mode="Opaque" x="130" y="11" width="231" height="30" forecolor="#0F0B0B" backcolor="#FFFFFF" uuid="bbd2692e-1dc1-49c7-b2a1-632af2ef9f16">
                        <property name="com.jaspersoft.studio.unit.width" value="pixel"/>
                    </reportElement>
                    <box>
                        <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    </box>
                    <textElement textAlignment="Left" verticalAlignment="Middle">
                        <font fontName="Times New Roman" size="16" isItalic="false" isUnderline="false"/>
                    </textElement>
                    <text><![CDATA[Detector Status Report  of ]]></text>
                </staticText>
                <textField>
                    <reportElement style="Title" x="365" y="11" width="263" height="30" forecolor="#0A0100" uuid="dcb43670-d7cf-4f90-86a7-c309c36f294a">
                        <property name="com.jaspersoft.studio.unit.width" value="pixel"/>
                    </reportElement>
                    <box>
                        <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    </box>
                    <textElement verticalAlignment="Middle">
                        <font fontName="Times New Roman" size="16"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$P{junctionName}]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement x="641" y="1" width="36" height="21" forecolor="#1A0606" uuid="ba7b5931-84f5-450e-aac8-9df1a0284ea0"/>
                    <box>
                        <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    </box>
                    <textElement textAlignment="Right" verticalAlignment="Middle">
                        <font fontName="Times New Roman"/>
                    </textElement>
                    <text><![CDATA[From:  ]]></text>
                </staticText>
                <staticText>
                    <reportElement x="641" y="26" width="37" height="21" forecolor="#1C0606" uuid="255a4119-bc96-4b89-ad3f-5bdec46a0d12"/>
                    <box>
                        <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    </box>
                    <textElement textAlignment="Right" verticalAlignment="Middle">
                        <font fontName="Times New Roman"/>
                    </textElement>
                    <text><![CDATA[To:  ]]></text>
                </staticText>
                <textField>
                    <reportElement x="681" y="1" width="176" height="20" forecolor="#0F0404" uuid="fd0e002e-6e43-429e-aca3-a55ed00b3ec3"/>
                    <box>
                        <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    </box>
                    <textElement verticalAlignment="Middle">
                        <font fontName="Times New Roman"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$P{frm_date}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="682" y="25" width="176" height="22" forecolor="#140403" uuid="03165034-543c-4a51-bc54-004105ecc771"/>
                    <box>
                        <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                        <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    </box>
                    <textElement verticalAlignment="Middle">
                        <font fontName="Times New Roman"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$P{to_date}]]></textFieldExpression>
                </textField>
                <image>
                    <reportElement x="10" y="1" width="100" height="40" uuid="6f12bfe4-d88f-4d55-838d-d8831093e18e"/>
                    <imageExpression><![CDATA["jasper-image/cms_logo_report.png"]]></imageExpression>
                </image>
            </frame>
            <staticText>
                <reportElement style="SubTitle" mode="Opaque" x="230" y="47" width="612" height="23" forecolor="#736343" uuid="1d03c566-7b02-4426-8a43-d8982c8f0c09">
                    <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
                </reportElement>
                <box>
                    <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                </box>
                <textElement>
                    <font size="9"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <text><![CDATA[                              Vehicle Counts in associated detectors  D1 to D24]]></text>
            </staticText>
            <staticText>
                <reportElement style="Column header" x="-10" y="47" width="60" height="47" forecolor="#736343" uuid="1efdf153-1c41-4210-b107-3f0e99414553"/>
                <box>
                    <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                </box>
                <textElement textAlignment="Center">
                    <font size="9"/>
                </textElement>
                <text><![CDATA[RTC]]></text>
            </staticText>
            <staticText>
                <reportElement style="Column header" x="50" y="47" width="60" height="47" forecolor="#736343" uuid="9208779c-c577-4c54-813d-a18ed0c2adca"/>
                <box>
                    <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                </box>
                <textElement textAlignment="Center">
                    <font size="9"/>
                </textElement>
                <text><![CDATA[Health status]]></text>
            </staticText>
        </band>
    </title>
    <pageHeader>
        <band splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band height="35" splitType="Stretch">
            <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/>
            <frame>
                <reportElement x="0" y="10" width="960" height="17" uuid="8c3a60a6-57fa-48a1-9109-985db3a2e591"/>
                <box>
                    <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <staticText>
                    <reportElement style="Column header" x="140" y="-60" width="30" height="47" forecolor="#736343" uuid="d0d08877-0cf0-4d59-a4d0-ea9f1d0a453a"/>
                    <box>
                        <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    </box>
                    <textElement textAlignment="Center">
                        <font size="9"/>
                    </textElement>
                    <text><![CDATA[Ph]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" x="170" y="-60" width="30" height="47" forecolor="#736343" uuid="baafc3c5-6c6a-4d4a-89e0-b88b092bf587"/>
                    <box>
                        <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    </box>
                    <textElement textAlignment="Center">
                        <font size="9"/>
                    </textElement>
                    <text><![CDATA[Ph Time]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" x="230" y="-36" width="20" height="23" forecolor="#736343" backcolor="#FFFFFF" uuid="fdcef03f-006c-4d0d-9832-9ac5ae2435ed"/>
                    <box>
                        < some deleted in edit as oversize >
                    </box>
                    <textElement textAlignment="Center">
                        <font size="9"/>
                    </textElement>
                    <text><![CDATA[D1]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" x="250" y="-36" width="20" height="23" forecolor="#736343" uuid="b7f27902-1822-4b8c-97ff-1950ffd20e2b"/>
                    <box>
                        < some deleted in edit as oversize >
                    </box>
                    <textElement textAlignment="Center">
                        <font size="9"/>
                    </textElement>
                    <text><![CDATA[D2]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" x="290" y="-36" width="20" height="23" forecolor="#736343" uuid="8dc2acaa-41ae-4bf3-812b-8faca40d1a5e"/>
                    <box>
                        < some deleted in edit as oversize >
                    </box>
                    <textElement textAlignment="Center">
                        <font size="9"/>
                    </textElement>
                    <text><![CDATA[D4]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" x="270" y="-36" width="20" height="23" forecolor="#736343" uuid="77ee6179-60e7-4650-9457-ad5e42dc8fb1"/>
                    <box>
                        < some deleted in edit as oversize >
                    </box>
                    <textElement textAlignment="Center">
                        <font size="9"/>
                    </textElement>
                    <text><![CDATA[D3]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" x="310" y="-36" width="20" height="23" forecolor="#736343" uuid="e1d52452-653d-4c1f-a57a-917b584e430b"/>
                    <box>
                        < some deleted in edit as oversize >
                    </box>
                    <textElement textAlignment="Center">
                        <font size="9"/>
                    </textElement>
                    <text><![CDATA[D5]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" x="330" y="-36" width="20" height="23" forecolor="#736343" uuid="b30c88bf-476d-42f0-84fb-01a8cb9e4361"/>
                    <box>
                        < some deleted in edit as oversize >
                    </box>
                    <textElement textAlignment="Center">
                        <font size="9"/>
                    </textElement>
                    <text><![CDATA[D6]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" x="350" y="-36" width="20" height="23" forecolor="#736343" uuid="53ac3ac3-0d06-43bb-a926-6bbd03a2eeaf"/>
                    <box>
                        <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    </box>
                    <textElement textAlignment="Center">
                        <font size="9"/>
                    </textElement>
                    <text><![CDATA[D7]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" x="390" y="-36" width="20" height="23" forecolor="#736343" uuid="70ed7e49-44d6-4993-ad19-cd538fbfa8d3"/>
                    <box>
                        <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    </box>
                    <textElement textAlignment="Center">
                        <font size="9" isBold="true"/>
                    </textElement>
                    <text><![CDATA[D9]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" x="370" y="-36" width="20" height="23" forecolor="#736343" uuid="7485dd94-1a68-4b36-8d7b-9f53d3134b2c"/>
                    <box>
                        <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    </box>
                    <textElement textAlignment="Center">
                        <font size="9" isBold="true"/>
                    </textElement>
                    <text><![CDATA[D8]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" x="410" y="-36" width="30" height="23" forecolor="#736343" uuid="1688d564-e5ad-4932-b47e-53945aebdc47"/>
                    <box>
                        <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    </box>
                    <textElement textAlignment="Center">
                        <font size="9" isBold="true"/>
                    </textElement>
                    <text><![CDATA[D10]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" x="200" y="-60" width="30" height="47" forecolor="#736343" uuid="45aefc4a-25fc-4a9b-a485-1f21a8561b60"/>
                    <box>
                        <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    </box>
                    <textElement textAlignment="Center">
                        <font size="9"/>
                    </textElement>
                    <text><![CDATA[Total Count]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" x="110" y="-60" width="30" height="47" forecolor="#736343" uuid="7000449c-8ee3-4f51-809d-e1d152be4907"/>
                    <box>
                        <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                        <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
                    </box>
                    <textElement textAlignment="Center">
                        <font size="9"/>
                    </textElement>
                    <text><![CDATA[Pl]]></text>
                </staticText>
            </frame>
        </band>
    </columnHeader>
    <detail>
        <band height="30" splitType="Stretch">
            <frame>
                <reportElement mode="Opaque" x="0" y="0" width="880" height="30" uuid="a98495d8-3c8d-4fa0-81f5-30c3efc2f766"/>
                <textField>
                    <reportElement x="50" y="0" width="60" height="30" uuid="be06dc78-bda6-4cdc-9c51-df4f7674e9b9">
                        <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
                    </reportElement>
                    <box>
                        <topPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
                        <leftPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
                        <bottomPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
                        <rightPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
                    </box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font fontName="Times New Roman" size="8"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{health}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="110" y="0" width="30" height="30" uuid="62f70610-dcef-428a-9178-6f63338cc343">
                        <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
                    </reportElement>
                    <box>
                        <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
                        <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
                        <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
                        <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
                    </box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font fontName="Times New Roman" size="8"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{planNo}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="140" y="0" width="30" height="30" uuid="5baf4df3-1679-4957-99ce-3a8670d0e2c5">
                        <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
                    </reportElement>
                    <box>
                        <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
                        <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
                        <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
                        <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
                    </box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font fontName="Times New Roman" size="8"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{phaseNo}]]></textFieldExpression>
                </textField>

                    <textFieldExpression><![CDATA[$F{phaseTime}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="-10" y="0" width="60" height="30" uuid="fbb602fd-2ed8-4f8f-80e0-5980741a94f1">
                        <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
                    </reportElement>
                    <box>
                        <topPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
                        <leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
                        <bottomPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
                        <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
                    </box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font fontName="Times New Roman" size="8"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{rtc}.toString()]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement style="highlight1" x="230" y="0" width="20" height="30" uuid="c3f6b5dc-6652-4d8f-8fb1-7120817e0efa">
                        <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
                    </reportElement>
                    <box>
                        < some deleted in edit as oversize >
                    </box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font fontName="Times New Roman" size="8"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{detectorStatusVal}.get("D1")]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement style="highlight2" x="250" y="0" width="20" height="30" uuid="4f90c811-1b09-4399-aaca-6dc89564e055">
                        <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
                    </reportElement>
                    <box>
                        < some deleted in edit as oversize >
                    </box>
                    <textElement textAlignment="Center" verticalAlignment="Middle">
                        <font fontName="Times New Roman" size="8"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{detectorStatusVal}.get("D2")]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement style="highlight3" x="270" y="0" width="20" height="30" uuid="c5a9cdca-e6a8-4e95-be49-4a9670feaad2">
                        <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
                    </reportElement>
                    <box>
                        < some deleted in edit as oversize >
                    </box>
            </frame>
        </band>
    </detail>
</jasperReport>

标签: jasper-reports

解决方案


推荐阅读