Bonjour,
j'ai construit une barChart avec un statut sur l'axe des abscisse et le nombre de données ayant ce statut en ordonnée.
La legende s'imprime lorsque j'ai plus d'une donnée en ordonnée ou lorsque j'ai plusieurs statuts en abscisse comme le montre les 2 premier print screen ci dessous.
Mais lorsque j'ai un seul statut avec une seule donnée, la légende ne s'imprime pas (voir le troisième print screen ci dessous)
Merci d'avance pour vos réponses
Voici mon fichier JRXML
Code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
|
<?xml version="1.0" encoding="UTF-8"?>
<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="screenStatusReport" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="2.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="416"/>
<style name="Title" fontName="Times New Roman" fontSize="50" isBold="true" pdfFontName="Times-Bold"/>
<style name="SubTitle" forecolor="#736343" fontName="Arial" fontSize="18"/>
<style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
<style name="Detail" fontName="Arial" fontSize="12"/>
<style name="Row" mode="Transparent">
<conditionalStyle>
<conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression>
<style backcolor="#E6DAC3"/>
</conditionalStyle>
</style>
<style name="table">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="Table Dataset 1"/>
<subDataset name="dataset1"/>
<field name="protocolName" class="java.lang.String"/>
<field name="softwareVersion" class="java.lang.String"/>
<field name="sstStatus" class="java.lang.String"/>
<field name="subCenter" class="java.lang.Integer"/>
<field name="scrId" class="java.lang.Integer"/>
<field name="treeContext" class="java.lang.String"/>
<variable name="variable1" class="java.lang.Number" resetType="None" calculation="DistinctCount">
<variableExpression><![CDATA[$F{scrId}]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="70">
<staticText>
<reportElement x="0" y="0" width="204" height="43"/>
<textElement>
<font fontName="Arial" size="18" isBold="true"/>
</textElement>
<text><![CDATA[Screens Status]]></text>
</staticText>
<staticText>
<reportElement x="351" y="25" width="53" height="20"/>
<textElement textAlignment="Right">
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<text><![CDATA[Center:]]></text>
</staticText>
<staticText>
<reportElement x="2" y="25" width="53" height="20"/>
<textElement>
<font fontName="Arial" size="12" isBold="true"/>
</textElement>
<text><![CDATA[Protocol:]]></text>
</staticText>
<textField>
<reportElement x="56" y="25" width="187" height="20"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{protocolName}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="404" y="23" width="112" height="20"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{subCenter}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="3" y="45" width="53" height="20"/>
<textElement>
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<text><![CDATA[Context:]]></text>
</staticText>
<textField>
<reportElement x="56" y="45" width="500" height="20"/>
<textElement>
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{treeContext}]]></textFieldExpression>
</textField>
</band>
</title>
<pageFooter>
<band height="30">
<textField>
<reportElement x="224" y="9" width="39" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}+"/"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="263" y="9" width="40" height="20"/>
<textElement/>
<textFieldExpression><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="ddMMMyyyy HH:mm:ss">
<reportElement style="Column header" x="430" y="5" width="119" height="13" forecolor="#000000"/>
<textElement verticalAlignment="Middle">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="430" y="18" width="31" height="11"/>
<textElement>
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[eN@ble]]></text>
</staticText>
<textField evaluationTime="Report">
<reportElement x="461" y="18" width="88" height="11"/>
<textElement>
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{softwareVersion}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="630" splitType="Stretch">
<barChart>
<chart>
<reportElement x="55" y="15" width="439" height="349"/>
<chartTitle>
<titleExpression><![CDATA[]]></titleExpression>
</chartTitle>
<chartSubtitle/>
<chartLegend position="Bottom"/>
</chart>
<categoryDataset>
<categorySeries>
<seriesExpression><![CDATA[$F{sstStatus}]]></seriesExpression>
<categoryExpression><![CDATA[$F{sstStatus}]]></categoryExpression>
<valueExpression><![CDATA[$V{variable1}]]></valueExpression>
</categorySeries>
</categoryDataset>
<barPlot>
<plot/>
<itemLabel color="#000000" backgroundColor="#FFFFFF"/>
<categoryAxisLabelExpression><![CDATA[]]></categoryAxisLabelExpression>
</barPlot>
</barChart>
<rectangle radius="10">
<reportElement x="156" y="387" width="274" height="186"/>
</rectangle>
<staticText>
<reportElement x="166" y="403" width="41" height="15"/>
<textElement>
<font fontName="Arial" size="10" isBold="true"/>
</textElement>
<text><![CDATA[Legend]]></text>
</staticText>
<line>
<reportElement x="166" y="418" width="254" height="1"/>
</line>
<staticText>
<reportElement x="166" y="422" width="252" height="139"/>
<textElement>
<font fontName="Arial" size="11" isBold="false"/>
</textElement>
<text><![CDATA[999 - Not entered
131 - Completed
133 - Completed with Force validated
132 - Completed with Information Not Available
134 - Pending data
135 - Medical Doctor
111/121 - Marked
113/123 - Marked with Force validation
112/122 -Marked with Information Not Available
]]></text>
</staticText>
</band>
</summary>
</jasperReport> |