[Jasper report] details 得一條row

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <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="MonthlyMemberTotalSales" pageWidth="792" pageHeight="612" orientation="Landscape" columnWidth="752" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="3acf8789-25fe-40e8-8db6-634fee41dc65">
  3.     <property name="ireport.zoom" value="1.0"/>
  4.     <property name="ireport.x" value="0"/>
  5.     <property name="ireport.y" value="0"/>
  6.     <subDataset name="ChartDataSet" uuid="8108e26f-b11d-4ba4-a27f-48af25a186d9">
  7.         <field name="type" class="java.lang.String"/>
  8.         <field name="month" class="java.lang.Integer"/>
  9.         <field name="percent" class="java.lang.Double"/>
  10.         <field name="sales" class="java.lang.Integer"/>
  11.         <field name="total" class="java.lang.Integer"/>
  12.     </subDataset>
  13.     <field name="type" class="java.lang.String"/>
  14.     <field name="month" class="java.lang.Integer"/>
  15.     <field name="sales" class="java.lang.Integer"/>
  16.     <field name="total" class="java.lang.Integer"/>
  17.     <field name="percent" class="java.lang.Double"/>
  18.     <field name="listOfSales" class="java.util.List"/>
  19.     <background>
  20.         <band splitType="Stretch"/>
  21.     </background>
  22.     <title>
  23.         <band height="79" splitType="Stretch">
  24.             <staticText>
  25.                 <reportElement uuid="1dcb5f2b-a4df-450c-96b2-d6030e9b4a33" mode="Opaque" x="0" y="0" width="752" height="79" backcolor="#FFFF00"/>
  26.                 <textElement textAlignment="Center">
  27.                     <font size="48" isUnderline="false"/>
  28.                 </textElement>
  29.                 <text><![CDATA[Monthly Sales Report]]></text>
  30.             </staticText>
  31.         </band>
  32.     </title>
  33.     <pageHeader>
  34.         <band height="35" splitType="Stretch"/>
  35.     </pageHeader>
  36.     <columnHeader>
  37.         <band height="30" splitType="Stretch">
  38.             <staticText>
  39.                 <reportElement uuid="cbc4f3a4-dde4-4535-a4da-42ae2396a394" x="0" y="0" width="100" height="20"/>
  40.                 <textElement/>
  41.                 <text><![CDATA[type]]></text>
  42.             </staticText>
  43.             <staticText>
  44.                 <reportElement uuid="eb7f73ac-ef4b-42c7-af83-c220cb90e7e2" x="100" y="0" width="100" height="20"/>
  45.                 <textElement/>
  46.                 <text><![CDATA[month]]></text>
  47.             </staticText>
  48.             <staticText>
  49.                 <reportElement uuid="140e982e-1a40-4fd9-8b90-04f5ffcf6b48" x="200" y="0" width="100" height="20"/>
  50.                 <textElement/>
  51.                 <text><![CDATA[sales]]></text>
  52.             </staticText>
  53.             <staticText>
  54.                 <reportElement uuid="00024fb5-6d2b-4352-9965-d972097ad16d" x="300" y="0" width="100" height="20"/>
  55.                 <textElement/>
  56.                 <text><![CDATA[percent]]></text>
  57.             </staticText>
  58.         </band>
  59.     </columnHeader>
  60.     <detail>
  61.         <band height="125" splitType="Stretch">
  62.             <textField>
  63.                 <reportElement uuid="f953968e-1da4-4312-9dd0-c89356b2cfd1" x="0" y="0" width="100" height="20"/>
  64.                 <textElement/>
  65.                 <textFieldExpression><![CDATA[$F{type}]]></textFieldExpression>
  66.             </textField>
  67.             <textField>
  68.                 <reportElement uuid="194c193f-1c98-4f6a-a27e-df8620eb9621" x="100" y="0" width="100" height="20"/>
  69.                 <textElement/>
  70.                 <textFieldExpression><![CDATA[$F{month}]]></textFieldExpression>
  71.             </textField>
  72.             <textField>
  73.                 <reportElement uuid="67cb8451-eb97-447d-9eb3-c3bc1026f135" x="200" y="0" width="100" height="20"/>
  74.                 <textElement/>
  75.                 <textFieldExpression><![CDATA[$F{sales}]]></textFieldExpression>
  76.             </textField>
  77.             <textField>
  78.                 <reportElement uuid="570c2d09-90ca-4313-b3f8-84f797d4fc5a" x="300" y="0" width="100" height="20"/>
  79.                 <textElement/>
  80.                 <textFieldExpression><![CDATA[$F{percent}]]></textFieldExpression>
  81.             </textField>
  82.         </band>
  83.     </detail>
  84.     <columnFooter>
  85.         <band height="137" splitType="Stretch">
  86.             <stackedBarChart>
  87.                 <chart>
  88.                     <reportElement uuid="74539c29-04d5-4692-92cd-a400279861d8" x="0" y="0" width="752" height="137"/>
  89.                     <chartTitle/>
  90.                     <chartSubtitle/>
  91.                     <chartLegend/>
  92.                 </chart>
  93.                 <categoryDataset>
  94.                     <dataset>
  95.                         <datasetRun subDataset="ChartDataSet" uuid="39f7f3ab-8979-45ec-af7d-997d6010adce">
  96.                             <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{listOfSales})]]></dataSourceExpression>
  97.                         </datasetRun>
  98.                     </dataset>
  99.                     <categorySeries>
  100.                         <seriesExpression><![CDATA[$F{type}]]></seriesExpression>
  101.                         <categoryExpression><![CDATA[$F{month}]]></categoryExpression>
  102.                         <valueExpression><![CDATA[$F{sales}]]></valueExpression>
  103.                     </categorySeries>
  104.                 </categoryDataset>
  105.                 <barPlot>
  106.                     <plot/>
  107.                     <itemLabel/>
  108.                 </barPlot>
  109.             </stackedBarChart>
  110.         </band>
  111.     </columnFooter>
  112.     <pageFooter>
  113.         <band height="54" splitType="Stretch"/>
  114.     </pageFooter>
  115.     <summary>
  116.         <band height="42" splitType="Stretch"/>
  117.     </summary>
  118. </jasperReport>
複製代碼
已知個JRBeanCollectionDataSource有11隻records
type:"VIP"
month:10
percent:0.0
sales:0.0
total:0.0
listOfSales: has the same data

這條有show出來

type:"Normal"
month:10
percent:0.0
sales:0.0
total:0.0
listOfSales: has the same data

這個沒有....
為什麼呢?
THX