开发者社区> 问答> 正文

请教jasperReport生成交叉表问题 - jasperReport报错

"

<img alt="""" src=""http://static.oschina.net/uploads/space/2011/0707/145600_nPpc_161198.gif"" />

您好:

我现在做个报表,是交叉表,如上图所示,查询结果中有一行前三个值为空,我怎么能把这行无效数据去掉呢,仍然保留第一行也就是蓝底的表头,因为“版本”后面的数据动态生成的。JRXML文件格式如下所示:

 

 

<?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="enterprisescount_day" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isIgnorePagination="true">
	<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"/>
	<subDataset name="ds1">
		<parameter name="province" class="java.lang.String"/>
		<queryString>
			<![CDATA[SELECT (CASE WHEN ($P{province}!='') THEN GROUP_CONCAT(PROVINCE_TABLE.PROVINCE_NAME) ELSE '' END )AS PROVINCE_NAME
				FROM
				(SELECT distinct(PROVINCE_NAME)  FROM DIM_E_CITY
				WHERE DIM_E_CITY.EFF_DATE<= CURRENT_TIMESTAMP AND DIM_E_CITY.EXP_DATE>=CURRENT_TIMESTAMP
				 AND CASE WHEN ($P{province}!='')
				 THEN INSTR(CONCAT(',',$P{province},',') , concat(PROVINCE_ID, ',')) > 0
				 ELSE 1=1 END)AS PROVINCE_TABLE]]>
		</queryString>
		<field name="PROVINCE_NAME" class="java.lang.String"/>
	</subDataset>
	<parameter name="startDate" class="java.lang.Integer"/>
	<parameter name="endDate" class="java.lang.Integer"/>
	<parameter name="province" class="java.lang.String">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<parameter name="version_id" class="java.lang.Integer"/>
	<queryString>
		<![CDATA[
			select (CASE WHEN(a.DAY_ID!='') THEN a.day_id else 99999999 end) as day_id,E.KPI_NAME,a.KPI_VALUE,
					(CASE WHEN(a.PROVINCE_NAME!='') then a.province_name else '' end) AS PROVINCE_NAME,
					(CASE WHEN(a.VERSION_NAME!='') then a.version_name else '' end) as version_name
				from(
					SELECT D.DAY_ID,D.KPI_ID,SUM(D.KPI_VALUE)AS KPI_VALUE,
					(CASE WHEN ($P{province}!='') THEN B.PROVINCE_NAME ELSE '全国' END) AS PROVINCE_NAME,C.VERSION_NAME
					 FROM DIM_E_CITY B,RPT_E_VCORPNUM_DAILY D,DIM_E_VERSION C
					 WHERE B.CITY_ID=D.CITY_ID AND C.VERSION_ID=D.VERSION_ID
					 AND DATEDIFF(B.EFF_DATE,CURRENT_TIMESTAMP)<=0 AND DATEDIFF(B.EXP_DATE,CURRENT_TIMESTAMP)>=0
					 AND DATEDIFF(C.EFF_DATE,CURRENT_TIMESTAMP)<=0 AND DATEDIFF(C.EXP_DATE,CURRENT_TIMESTAMP)>=0
					 AND D.DAY_ID>=$P{startDate} AND D.DAY_ID<=$P{endDate}
					 AND D.VERSION_ID=$P{version_id}
					 AND CASE WHEN ($P{province}!='')
					 THEN INSTR(CONCAT(',',$P{province},',') , concat(B.PROVINCE_ID, ',')) > 0
					 ELSE 1=1 END
					 GROUP BY D.DAY_ID,D.KPI_ID, CASE WHEN ($P{province}!='') THEN B.PROVINCE_ID END ,D.VERSION_ID
				) a
				right join DIM_E_KPI E ON a.KPI_ID=E.KPI_ID 
				 where E.KPI_ID IN (192301,192302,192303,192304,192305,192306)
					 AND DATEDIFF(E.EFF_DATE,CURRENT_TIMESTAMP)<=0 AND DATEDIFF(E.EXP_DATE,CURRENT_TIMESTAMP)>=0
				order by a.day_id 
		]]>
	</queryString>
	<field name="DAY_ID" class="java.lang.Integer"/>
	<field name="KPI_NAME" class="java.lang.String"/>
	<field name="KPI_VALUE" class="java.math.BigDecimal"/>
	<field name="PROVINCE_NAME" class="java.lang.String"/>
	<field name="VERSION_NAME" class="java.lang.String"/>
	<pageHeader>
		<band height="60">
			<textField>
				<reportElement mode="Opaque" x="1" y="0" width="801" height="40" forecolor="#69ABE8"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="zysong" size="15" isBold="false" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["企业数日报表"]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="0" y="40" width="80" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="zysong" size="12" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
				</textElement>
				<text><![CDATA[查询日期: 从 ]]></text>
			</staticText>
			<textField pattern="">
				<reportElement x="80" y="40" width="69" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Top">
					<font fontName="zysong" size="12" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$P{startDate}.toString().substring(0,4)+"-"+$P{startDate}.toString().substring(4,6)+"-"+$P{startDate}.toString().substring(6,8)]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="149" y="40" width="22" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="zysong" size="12" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
				</textElement>
				<text><![CDATA[至]]></text>
			</staticText>
			<textField pattern="">
				<reportElement x="171" y="40" width="69" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Top">
					<font fontName="zysong" size="12" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$P{endDate}.toString().substring(0,4)+"-"+$P{endDate}.toString().substring(4,6)+"-"+$P{endDate}.toString().substring(6,8)]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="516" y="40" width="80" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="zysong" size="12" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
				</textElement>
				<text><![CDATA[已选择省份:]]></text>
			</staticText>
			<componentElement>
				<reportElement x="596" y="40" width="206" height="20"/>
				<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="Horizontal">
					<datasetRun subDataset="ds1">
						<datasetParameter name="province">
							<datasetParameterExpression><![CDATA[$P{province}]]></datasetParameterExpression>
						</datasetParameter>
						<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
					</datasetRun>
					<jr:listContents height="20" width="206">
						<textField>
							<reportElement x="0" y="0" width="206" height="20"/>
							<textElement textAlignment="Left" verticalAlignment="Top">
								<font fontName="zysong" size="12" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
							</textElement>
							<textFieldExpression class="java.lang.String"><![CDATA[($F{PROVINCE_NAME}.length()>14)?$F{PROVINCE_NAME}.substring(0,14)+"......":$F{PROVINCE_NAME}]]></textFieldExpression>
						</textField>
					</jr:listContents>
				</jr:list>
			</componentElement>
		</band>
	</pageHeader>
	<summary>
		<band height="42" splitType="Stretch">
			<crosstab>
				<reportElement x="0" y="0" width="802" height="42"/>
				<crosstabHeaderCell>
					<cellContents backcolor="#68ABE8" mode="Opaque">
						<box>
							<pen lineWidth="0.5" lineColor="#C7C7C7"/>
							<topPen lineWidth="0.5" lineColor="#C7C7C7"/>
							<leftPen lineWidth="0.5" lineColor="#C7C7C7"/>
							<bottomPen lineWidth="0.5" lineColor="#C7C7C7"/>
							<rightPen lineWidth="0.5" lineColor="#C7C7C7"/>
						</box>
						<staticText>
							<reportElement x="0" y="0" width="70" height="25" forecolor="#003333"/>
							<box>
								<pen lineWidth="0.0" lineColor="#C7C7C7"/>
								<topPen lineWidth="0.0" lineColor="#C7C7C7"/>
								<leftPen lineColor="#C7C7C7"/>
								<bottomPen lineWidth="0.0" lineColor="#C7C7C7"/>
								<rightPen lineWidth="0.5" lineColor="#C7C7C7"/>
							</box>
							<textElement textAlignment="Center" verticalAlignment="Middle">
								<font fontName="zysong" size="12" isBold="true" isStrikeThrough="false" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
							</textElement>
							<text><![CDATA[日期]]></text>
						</staticText>
						<staticText>
							<reportElement x="70" y="0" width="74" height="25" forecolor="#003333"/>
							<box>
								<pen lineWidth="0.0" lineColor="#C7C7C7"/>
								<topPen lineWidth="0.0" lineColor="#C7C7C7"/>
								<leftPen lineColor="#C7C7C7"/>
								<bottomPen lineWidth="0.0" lineColor="#C7C7C7"/>
								<rightPen lineWidth="0.5" lineColor="#C7C7C7"/>
							</box>
							<textElement textAlignment="Center" verticalAlignment="Middle">
								<font fontName="zysong" size="12" isBold="true" isStrikeThrough="false" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
							</textElement>
							<text><![CDATA[省份]]></text>
						</staticText>
						<staticText>
							<reportElement x="144" y="0" width="76" height="25" forecolor="#003333"/>
							<box>
								<pen lineWidth="0.0" lineColor="#C7C7C7"/>
								<topPen lineWidth="0.0" lineColor="#C7C7C7"/>
								<leftPen lineColor="#C7C7C7"/>
								<bottomPen lineWidth="0.0" lineColor="#C7C7C7"/>
								<rightPen lineWidth="0.5" lineColor="#C7C7C7"/>
							</box>
							<textElement textAlignment="Center" verticalAlignment="Middle">
								<font fontName="zysong" size="12" isBold="true" isStrikeThrough="false" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
							</textElement>
							<text><![CDATA[版本]]></text>
						</staticText>
					</cellContents>
				</crosstabHeaderCell>
				<rowGroup name="DAY_ID" width="70" totalPosition="End">
					<bucket>
						<bucketExpression class="java.lang.Integer"><![CDATA[$F{DAY_ID}]]></bucketExpression>
					</bucket>
					<crosstabRowHeader>
						<cellContents backcolor="#F8FCFF" mode="Opaque">
							<box>
								<pen lineWidth="0.5" lineStyle="Solid" lineColor="#C7C7C7"/>
								<topPen lineColor="#C7C7C7"/>
								<leftPen lineColor="#C7C7C7"/>
								<bottomPen lineColor="#C7C7C7"/>
								<rightPen lineColor="#C7C7C7"/>
							</box>
							<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="false">
								<reportElement style="Crosstab Data Text" x="0" y="0" width="70" height="25"/>
								<textElement verticalAlignment="Middle">
									<font fontName="zysong" size="12" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
								</textElement>
								<textFieldExpression class="java.lang.String"><![CDATA[($V{DAY_ID}.toString()!="99999999")?$V{DAY_ID}.toString().substring(0,4)+"-"+$V{DAY_ID}.toString().substring(4,6)+"-"+$V{DAY_ID}.toString().substring(6,8):""]]></textFieldExpression>
							</textField>
						</cellContents>
					</crosstabRowHeader>
					<crosstabTotalRowHeader>
						<cellContents backcolor="#005FB3" mode="Opaque">
							<box>
								<pen lineWidth="0.5" lineStyle="Solid" lineColor="#C7C7C7"/>
								<topPen lineColor="#C7C7C7"/>
								<leftPen lineColor="#C7C7C7"/>
								<bottomPen lineColor="#C7C7C7"/>
								<rightPen lineColor="#C7C7C7"/>
							</box>
						</cellContents>
					</crosstabTotalRowHeader>
				</rowGroup>
				<rowGroup name="PROVINCE_NAME" width="74" totalPosition="End">
					<bucket>
						<bucketExpression class="java.lang.String"><![CDATA[$F{PROVINCE_NAME}]]></bucketExpression>
					</bucket>
					<crosstabRowHeader>
						<cellContents backcolor="#F8FCFF" mode="Opaque">
							<box>
								<pen lineWidth="0.5" lineStyle="Solid" lineColor="#C7C7C7"/>
								<topPen lineColor="#C7C7C7"/>
								<leftPen lineColor="#C7C7C7"/>
								<bottomPen lineColor="#C7C7C7"/>
								<rightPen lineColor="#C7C7C7"/>
							</box>
							<textField isStretchWithOverflow="true">
								<reportElement style="Crosstab Data Text" x="1" y="0" width="73" height="25"/>
								<textElement verticalAlignment="Middle">
									<font fontName="zysong" size="12" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
								</textElement>
								<textFieldExpression class="java.lang.String"><![CDATA[$V{PROVINCE_NAME}]]></textFieldExpression>
							</textField>
						</cellContents>
					</crosstabRowHeader>
					<crosstabTotalRowHeader>
						<cellContents backcolor="#F8FCFF" mode="Opaque">
							<box>
								<pen lineWidth="0.5" lineStyle="Solid" lineColor="#C7C7C7"/>
								<topPen lineColor="#C7C7C7"/>
								<leftPen lineColor="#C7C7C7"/>
								<bottomPen lineColor="#C7C7C7"/>
								<rightPen lineColor="#C7C7C7"/>
							</box>
							<staticText>
								<reportElement x="1" y="0" width="149" height="25"/>
								<textElement textAlignment="Center" verticalAlignment="Middle">
									<font fontName="zysong" size="12" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
								</textElement>
								<text><![CDATA[小计]]></text>
							</staticText>
						</cellContents>
					</crosstabTotalRowHeader>
				</rowGroup>
				<rowGroup name="VERSION_NAME" width="76">
					<bucket>
						<bucketExpression class="java.lang.String"><![CDATA[$F{VERSION_NAME}]]></bucketExpression>
					</bucket>
					<crosstabRowHeader>
						<cellContents backcolor="#F8FCFF" mode="Opaque">
							<box>
								<pen lineWidth="0.5" lineColor="#C7C7C7"/>
								<topPen lineWidth="0.5" lineColor="#C7C7C7"/>
								<leftPen lineWidth="0.5" lineColor="#C7C7C7"/>
								<bottomPen lineWidth="0.5" lineColor="#C7C7C7"/>
								<rightPen lineWidth="0.5" lineColor="#C7C7C7"/>
							</box>
							<textField isStretchWithOverflow="true">
								<reportElement style="Crosstab Data Text" x="0" y="0" width="76" height="25"/>
								<textElement verticalAlignment="Middle">
									<font fontName="zysong" size="12" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
								</textElement>
								<textFieldExpression class="java.lang.String"><![CDATA[$V{VERSION_NAME}]]></textFieldExpression>
							</textField>
						</cellContents>
					</crosstabRowHeader>
					<crosstabTotalRowHeader>
						<cellContents>
							<box>
								<pen lineWidth="0.5" lineColor="#C7C7C7"/>
								<topPen lineWidth="0.5" lineColor="#C7C7C7"/>
								<leftPen lineWidth="0.5" lineColor="#C7C7C7"/>
								<bottomPen lineWidth="0.5" lineColor="#C7C7C7"/>
								<rightPen lineWidth="0.5" lineColor="#C7C7C7"/>
							</box>
						</cellContents>
					</crosstabTotalRowHeader>
				</rowGroup>
				<columnGroup name="KPI_NAME" height="25">
					<bucket>
						<bucketExpression class="java.lang.String"><![CDATA[$F{KPI_NAME}]]></bucketExpression>
					</bucket>
					<crosstabColumnHeader>
						<cellContents backcolor="#68ABE8" mode="Opaque">
							<box>
								<pen lineWidth="0.5" lineStyle="Solid" lineColor="#C7C7C7"/>
								<topPen lineColor="#C7C7C7"/>
								<leftPen lineColor="#C7C7C7"/>
								<bottomPen lineColor="#C7C7C7"/>
								<rightPen lineColor="#C7C7C7"/>
							</box>
							<textField isStretchWithOverflow="true">
								<reportElement style="Crosstab Data Text" mode="Transparent" x="0" y="0" width="97" height="25" forecolor="#003333"/>
								<box>
									<pen lineWidth="0.0" lineColor="#C7C7C7"/>
									<topPen lineWidth="0.0" lineColor="#C7C7C7"/>
									<leftPen lineWidth="0.0" lineColor="#C7C7C7"/>
									<bottomPen lineWidth="0.0" lineColor="#C7C7C7"/>
									<rightPen lineWidth="0.0" lineColor="#C7C7C7"/>
								</box>
								<textElement verticalAlignment="Middle">
									<font fontName="zysong" size="12" isBold="true" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
								</textElement>
								<textFieldExpression class="java.lang.String"><![CDATA[$V{KPI_NAME}]]></textFieldExpression>
							</textField>
						</cellContents>
					</crosstabColumnHeader>
					<crosstabTotalColumnHeader>
						<cellContents>
							<box>
								<pen lineWidth="0.5" lineColor="#C7C7C7"/>
								<topPen lineWidth="0.5" lineColor="#C7C7C7"/>
								<leftPen lineWidth="0.5" lineColor="#C7C7C7"/>
								<bottomPen lineWidth="0.5" lineColor="#C7C7C7"/>
								<rightPen lineWidth="0.5" lineColor="#C7C7C7"/>
							</box>
						</cellContents>
					</crosstabTotalColumnHeader>
				</columnGroup>
				<measure name="KPI_VALUEMeasure" class="java.math.BigDecimal" calculation="Sum">
					<measureExpression><![CDATA[$F{KPI_VALUE}]]></measureExpression>
				</measure>
				<crosstabCell width="97" height="25">
					<cellContents backcolor="#F8FCFF" mode="Opaque">
						<box>
							<pen lineWidth="0.5" lineStyle="Solid" lineColor="#C7C7C7"/>
							<topPen lineColor="#C7C7C7"/>
							<leftPen lineColor="#C7C7C7"/>
							<bottomPen lineColor="#C7C7C7"/>
							<rightPen lineColor="#C7C7C7"/>
						</box>
						<textField isStretchWithOverflow="true">
							<reportElement style="Crosstab Data Text" x="0" y="0" width="97" height="25"/>
							<textElement verticalAlignment="Middle">
								<font fontName="zysong" size="12" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
							</textElement>
							<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{KPI_VALUEMeasure}]]></textFieldExpression>
						</textField>
					</cellContents>
				</crosstabCell>
				<crosstabCell width="97" height="0" rowTotalGroup="DAY_ID">
					<cellContents backcolor="#005FB3" mode="Opaque">
						<box>
							<pen lineWidth="0.5" lineStyle="Solid" lineColor="#C7C7C7"/>
							<topPen lineColor="#C7C7C7"/>
							<leftPen lineColor="#C7C7C7"/>
							<bottomPen lineColor="#C7C7C7"/>
							<rightPen lineColor="#C7C7C7"/>
						</box>
					</cellContents>
				</crosstabCell>
				<crosstabCell width="50" columnTotalGroup="KPI_NAME">
					<cellContents backcolor="#BFE1FF" mode="Opaque">
						<box>
							<pen lineWidth="0.5" lineStyle="Solid" lineColor="#C7C7C7"/>
							<topPen lineColor="#C7C7C7"/>
							<leftPen lineColor="#C7C7C7"/>
							<bottomPen lineColor="#C7C7C7"/>
							<rightPen lineColor="#C7C7C7"/>
						</box>
						<textField>
							<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>
							<textElement/>
							<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{KPI_VALUEMeasure}]]></textFieldExpression>
						</textField>
					</cellContents>
				</crosstabCell>
				<crosstabCell rowTotalGroup="DAY_ID" columnTotalGroup="KPI_NAME">
					<cellContents backcolor="#005FB3" mode="Opaque">
						<box>
							<pen lineWidth="0.5" lineStyle="Solid" lineColor="#C7C7C7"/>
							<topPen lineColor="#C7C7C7"/>
							<leftPen lineColor="#C7C7C7"/>
							<bottomPen lineColor="#C7C7C7"/>
							<rightPen lineColor="#C7C7C7"/>
						</box>
						<textField>
							<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25" forecolor="#FFFFFF"/>
							<textElement/>
							<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{KPI_VALUEMeasure}]]></textFieldExpression>
						</textField>
					</cellContents>
				</crosstabCell>
				<crosstabCell width="97" height="25" rowTotalGroup="PROVINCE_NAME">
					<cellContents backcolor="#F8FCFF" mode="Opaque">
						<box>
							<pen lineWidth="0.5" lineStyle="Solid" lineColor="#C7C7C7"/>
							<topPen lineColor="#C7C7C7"/>
							<leftPen lineColor="#C7C7C7"/>
							<bottomPen lineColor="#C7C7C7"/>
							<rightPen lineColor="#C7C7C7"/>
						</box>
						<textField isStretchWithOverflow="true">
							<reportElement style="Crosstab Data Text" x="0" y="0" width="97" height="25"/>
							<textElement verticalAlignment="Middle">
								<font fontName="zysong" size="12" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
							</textElement>
							<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{KPI_VALUEMeasure}]]></textFieldExpression>
						</textField>
					</cellContents>
				</crosstabCell>
				<crosstabCell rowTotalGroup="PROVINCE_NAME" columnTotalGroup="KPI_NAME">
					<cellContents backcolor="#BFE1FF" mode="Opaque">
						<box>
							<pen lineWidth="0.5" lineStyle="Solid" lineColor="#C7C7C7"/>
							<topPen lineColor="#C7C7C7"/>
							<leftPen lineColor="#C7C7C7"/>
							<bottomPen lineColor="#C7C7C7"/>
							<rightPen lineColor="#C7C7C7"/>
						</box>
						<textField>
							<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>
							<textElement/>
							<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{KPI_VALUEMeasure}]]></textFieldExpression>
						</textField>
					</cellContents>
				</crosstabCell>
				<crosstabCell rowTotalGroup="VERSION_NAME">
					<cellContents>
						<box>
							<pen lineWidth="0.5" lineColor="#C7C7C7"/>
							<topPen lineWidth="0.5" lineColor="#C7C7C7"/>
							<leftPen lineWidth="0.5" lineColor="#C7C7C7"/>
							<bottomPen lineWidth="0.5" lineColor="#C7C7C7"/>
							<rightPen lineWidth="0.5" lineColor="#C7C7C7"/>
						</box>
					</cellContents>
				</crosstabCell>
				<crosstabCell rowTotalGroup="VERSION_NAME" columnTotalGroup="KPI_NAME">
					<cellContents>
						<box>
							<pen lineWidth="0.5" lineColor="#C7C7C7"/>
							<topPen lineWidth="0.5" lineColor="#C7C7C7"/>
							<leftPen lineWidth="0.5" lineColor="#C7C7C7"/>
							<bottomPen lineWidth="0.5" lineColor="#C7C7C7"/>
							<rightPen lineWidth="0.5" lineColor="#C7C7C7"/>
						</box>
					</cellContents>
				</crosstabCell>
			</crosstab>
		</band>
	</summary>
</jasperReport>
"

展开
收起
montos 2020-06-03 17:19:21 967 0
1 条回答
写回答
取消 提交回答
  • "妈呀,这让人怎么看啊,自力更生吧~######

    爱莫能助了。。。。

    ######

    我只把JasperReport作为导出各种文档格式的工具, 他关键的 “报表” 功能没怎么用过。

    其实,我也没看懂你要干什么。  还有就是交叉报表应该是二维的吧, 左侧相当于纵向维度,怎么会空。

    见笑了

     

    ######

    因为我查询的结果内就有空的,我是想问,能不能控制如果为空就不显示相应空的单元格的值。

    ######

    因为我查询的结果内就有空的,我是想问,能不能控制如果为空就不显示相应空的单元格。

    ######“Print When Expression ” ######为啥不用ireport?这样太难了吧。"
    2020-06-03 17:27:36
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载