当我试图通过单击预览选项卡来预览 IReports 中的数据时,它只是闪烁并返回,但我无法看到数据。
下面是我的 XML。
<?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="report5" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="b8a981bc-ae9b-4fcf-8400-f9ecea0567f2">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="Crosstab Data Text" hAlign="Center"/>
<queryString>
<![CDATA[SELECT
`Date assigned` AS Date_assigned,
Units,
`Assigned to PS` AS Assigned_to_PS
FROM
[Sheet1$]
]]>
</queryString>
<field name="Date_assigned" class="java.sql.Timestamp"/>
<field name="Units" class="java.lang.Double"/>
<field name="Assigned_to_PS" class="java.lang.String"/>
<group name="Date_assigned">
<groupExpression><![CDATA[$F{Date_assigned}]]></groupExpression>
</group>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="79" splitType="Stretch"/>
</title>
<pageHeader>
<band height="35" splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="61" splitType="Stretch"/>
</columnHeader>
<detail>
<band height="125" splitType="Stretch">
<crosstab>
<reportElement uuid="db476b5b-d93f-4819-a8f6-174bfc88c9b7" x="0" y="0" width="802" height="125"/>
<rowGroup name="Date_assigned" width="70" totalPosition="End">
<bucket class="java.util.Date">
<bucketExpression><![CDATA[$F{Date_assigned}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement uuid="cb26a0e2-7fa8-4124-be7f-f91e491801f7" style="Crosstab Data Text" x="0" y="0" width="70" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{Date_assigned}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<staticText>
<reportElement uuid="c97deff9-a499-4330-aa84-baf20315a1de" x="0" y="0" width="70" height="25"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Total Date_assigned]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<columnGroup name="Assigned_to_PS" height="30" totalPosition="End">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{Assigned_to_PS}]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement uuid="7e26e7de-b54f-4490-9ea1-b087247e9c06" style="Crosstab Data Text" x="0" y="0" width="50" height="30"/>
<textElement/>
<textFieldExpression><![CDATA[$V{Assigned_to_PS}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<staticText>
<reportElement uuid="86c2ceb5-b2d2-4cc7-953e-0c039e807ec1" x="86" y="0" width="50" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Total Assigned_to_PS]]></text>
</staticText>
</cellContents>
</crosstabTotalColumnHeader>
</columnGroup>
<measure name="UnitssMeasure" class="java.lang.Double" calculation="Sum">
<measureExpression><![CDATA[$F{Unitss}]]></measureExpression>
</measure>
<crosstabCell width="120" height="38">
<cellContents>
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement uuid="7729498a-0309-4052-a002-e58592da972b" style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{UnitssMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="120" height="61" rowTotalGroup="Date_assigned">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement uuid="35ba6c60-5505-4eba-be7b-8627a9516c7d" style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{UnitssMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="136" height="38" columnTotalGroup="Assigned_to_PS">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement uuid="c260e58c-5377-4582-bdfe-59a3f337feee" style="Crosstab Data Text" x="86" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{UnitssMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="136" height="61" rowTotalGroup="Date_assigned" columnTotalGroup="Assigned_to_PS">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement uuid="468233cd-75a6-4278-ba3f-de35032a5459" style="Crosstab Data Text" x="86" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{UnitssMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
</crosstab>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
这实际上是来自 excel 数据源的数据透视表,请告诉我如何预览它。而且我没有收到任何错误。
预期输出是
Amreen Anirudh Anand Total
7/1/2013 158 158
7/2/2013 23 23
7/3/2013 152 748 900
7/4/2013
7/5/2013
7/6/2013 435 435
7/7/2013 170 170
7/8/2013 66 66
7/9/2013 33 33 66
Total 1037 748 33 1818
谢谢