Chart error when using Bean Collection data source

Hi All,

I have a written java code in Eclipse to create a pdf report.

Here is my code:-

         
        
       

I can get the results to output in the detail band but the chart does not have any values apart from a percentage which is calculated from the field values.

 

Code:
JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(jobAuditBeanList);
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("CUSTOMER",custName);
        parameters.put("FILENAME",fileName);
        parameters.put("ACCOUNT",account);
        parameters.put("STARTED_AT", dateStarted);
        parameters.put("JOB_ID",jobId);
        parameters.put("SIZE", size);
        parameters.put("SUBREPORT_DIR", "/tmp/templates/");
        JasperCompileManager.compileReportToFile("/tmp/templates/isAuditData.jrxml", "/tmp/templates/isAuditData.jasper");
        JasperCompileManager.compileReportToFile("/tmp/templates/notAuditData.jrxml", "/tmp/templates/notAuditData.jasper");
        JasperReport jasperReport = JasperCompileManager.compileReport("/tmp/templates/ProcessingResultsTemplate.jrxml");
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters , dataSource);
        JasperExportManager.exportReportToPdfFile(jasperPrint, "/tmp/templates/report.pdf");
 
 
 
               </td></tr></tbody></table>
chr15athome's picture
Joined: Apr 17 2009 - 6:32am
Last seen: 14 years 5 months ago

17 Answers:

Here is my JRXML:-

 

 

Code:
<?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="AuditReportTemplate" pageWidth="595" pageHeight="842" columnWidth="585" leftMargin="5" rightMargin="5" topMargin="5" bottomMargin="5">
	<property name="ireport.scriptlethandling" value="0"/>
	<property name="ireport.encoding" value="UTF-8"/>
	<import value="net.sf.jasperreports.engine.*"/>
	<import value="java.util.*"/>
	<import value="net.sf.jasperreports.engine.data.*"/>
	<parameter name="JOB_ID" class="java.lang.Long"/>
	<parameter name="FILENAME" class="java.lang.String"/>
	<parameter name="CUSTOMER" class="java.lang.String"/>
	<parameter name="ACCOUNT" class="java.lang.String"/>
	<parameter name="STARTED_AT" class="java.sql.Timestamp"/>
	<parameter name="SIZE" class="java.lang.Integer"/>
	<field name="processingType" class="java.lang.String"/>
	<field name="statisticType" class="java.lang.String"/>
	<field name="numberRecords" class="java.lang.Integer"/>
	<field name="auditStatus" class="java.lang.Boolean"/>
	<field name="alternativeDescription" class="java.lang.String"/>
	<variable name="average" class="java.lang.Double" calculation="Sum">
		<variableExpression><![CDATA[new java.lang.Double (  ($F{numberRecords}.intValue()) /($P{SIZE}.intValue()) )]]></variableExpression>
	</variable>
	<variable name="totalRecords" class="java.lang.Integer" calculation="Sum">
		<variableExpression><![CDATA[$P{SIZE}]]></variableExpression>
	</variable>
	<variable name="PERCENTAGE" class="java.lang.Integer">
		<variableExpression><![CDATA[new Integer( ($F{numberRecords}.intValue()*100 ) / $P{SIZE}.intValue())]]></variableExpression>
	</variable>
	<variable name="recordsMatched" class="java.lang.Integer">
		<variableExpression><![CDATA[new Integer($F{numberRecords})]]></variableExpression>
	</variable>
	<group name="audit">
		<groupExpression><![CDATA[new Boolean ($F{auditStatus})]]></groupExpression>
		<groupHeader>
			<band/>
		</groupHeader>
		<groupFooter>
			<band height="24">
				<staticText>
					<reportElement isPrintRepeatedValues="false" x="3" y="5" width="293" height="14" isPrintInFirstWholeBand="true"/>
					<textElement>
						<font size="9"/>
					</textElement>
					<text><![CDATA[Your data is also registered for the following services:]]></text>
				</staticText>
			</band>
		</groupFooter>
	</group>
	<background>
		<band/>
	</background>
	<title>
		<band height="50">
			<staticText>
				<reportElement key="staticText-1" x="14" y="22" width="0" height="0"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement/>
				<text><![CDATA[Static Text]]></text>
			</staticText>
			<image>
				<reportElement key="image-1" mode="Opaque" x="437" y="1" width="148" height="42"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<graphicElement fill="Solid"/>
				<imageExpression class="java.lang.String"><![CDATA["/shares/development/website/images/cnmlogo.jpg"]]></imageExpression>
			</image>
			<staticText>
				<reportElement key="staticText-2" mode="Transparent" x="9" y="1" width="422" height="42" forecolor="#A8A5A5"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement>
					<font size="34"/>
				</textElement>
				<text><![CDATA[Processing Results]]></text>
			</staticText>
		</band>
	</title>
	<pageHeader>
		<band height="57">
			<rectangle>
				<reportElement key="rectangle-2" mode="Opaque" x="-6" y="-2" width="596" height="58" forecolor="#29166A" backcolor="#29166A"/>
				<graphicElement fill="Solid"/>
			</rectangle>
			<rectangle radius="5">
				<reportElement key="rectangle-14" mode="Transparent" x="365" y="35" width="162" height="15" forecolor="#D8DADB"/>
			</rectangle>
			<rectangle radius="5">
				<reportElement key="rectangle-13" mode="Transparent" x="365" y="19" width="162" height="16" forecolor="#D8DADB"/>
			</rectangle>
			<rectangle radius="5">
				<reportElement key="rectangle-12" mode="Transparent" x="365" y="4" width="162" height="15" forecolor="#D8DADB"/>
			</rectangle>
			<rectangle radius="5">
				<reportElement key="rectangle-11" mode="Transparent" x="9" y="35" width="162" height="15" forecolor="#D8DADB"/>
			</rectangle>
			<rectangle radius="5">
				<reportElement key="rectangle-10" mode="Transparent" x="9" y="19" width="162" height="16" forecolor="#D8DADB"/>
			</rectangle>
			<rectangle radius="5">
				<reportElement key="rectangle-9" mode="Transparent" x="9" y="4" width="162" height="15" forecolor="#D8DADB"/>
			</rectangle>
			<rectangle radius="5">
				<reportElement key="rectangle-3" x="116" y="3" width="218" height="16" forecolor="#000000" backcolor="#D8DADB"/>
			</rectangle>
			<staticText>
				<reportElement key="staticText-3" x="14" y="3" width="95" height="16" forecolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement verticalAlignment="Middle"/>
				<text><![CDATA[Customer:]]></text>
			</staticText>
			<staticText>
				<reportElement key="staticText-4" x="14" y="19" width="95" height="16" forecolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement verticalAlignment="Middle"/>
				<text><![CDATA[Account:]]></text>
			</staticText>
			<staticText>
				<reportElement key="staticText-5" x="371" y="3" width="95" height="16" forecolor="#D8DADB"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement verticalAlignment="Middle"/>
				<text><![CDATA[CNM Job ID:]]></text>
			</staticText>
			<staticText>
				<reportElement key="staticText-7" x="371" y="19" width="95" height="16" forecolor="#D8DADB"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement verticalAlignment="Middle"/>
				<text><![CDATA[Date Processed:]]></text>
			</staticText>
			<staticText>
				<reportElement key="staticText-49" x="14" y="35" width="95" height="17" forecolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement verticalAlignment="Middle"/>
				<text><![CDATA[File Name:]]></text>
			</staticText>
			<staticText>
				<reportElement key="staticText-50" x="371" y="35" width="95" height="16" forecolor="#D8DADB"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement verticalAlignment="Middle"/>
				<text><![CDATA[Records Processed:]]></text>
			</staticText>
			<textField isBlankWhenNull="false">
				<reportElement key="textField" x="126" y="5" width="203" height="18" forecolor="#000000"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[$P{CUSTOMER}]]></textFieldExpression>
			</textField>
			<rectangle radius="5">
				<reportElement key="rectangle-4" x="116" y="19" width="218" height="16" forecolor="#000000" backcolor="#D8DADB"/>
			</rectangle>
			<textField isBlankWhenNull="false">
				<reportElement key="textField" x="126" y="18" width="203" height="18" forecolor="#000000"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement verticalAlignment="Middle"/>
				<textFieldExpression class="java.lang.String"><![CDATA[""+$P{ACCOUNT}]]></textFieldExpression>
			</textField>
			<rectangle radius="5">
				<reportElement key="rectangle-5" x="116" y="35" width="218" height="16" forecolor="#000000" backcolor="#D8DADB"/>
			</rectangle>
			<textField isBlankWhenNull="false">
				<reportElement key="textField" x="126" y="37" width="208" height="18" forecolor="#000000"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[$P{FILENAME}]]></textFieldExpression>
			</textField>
			<rectangle radius="5">
				<reportElement key="rectangle-6" x="473" y="3" width="107" height="16" forecolor="#000000" backcolor="#D8DADB"/>
			</rectangle>
			<rectangle radius="5">
				<reportElement key="rectangle-7" x="473" y="19" width="107" height="16" forecolor="#000000" backcolor="#D8DADB"/>
			</rectangle>
			<rectangle radius="5">
				<reportElement key="rectangle-8" x="473" y="35" width="107" height="16" forecolor="#000000" backcolor="#D8DADB"/>
			</rectangle>
			<textField isBlankWhenNull="false">
				<reportElement key="textField" x="478" y="5" width="100" height="15" forecolor="#000000"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement/>
				<textFieldExpression class="java.lang.Long"><![CDATA[$P{JOB_ID}]]></textFieldExpression>
			</textField>
			<textField pattern="dd/MM/yyyy" isBlankWhenNull="false">
				<reportElement key="textField" x="478" y="21" width="102" height="16" forecolor="#000000"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement/>
				<textFieldExpression class="java.sql.Timestamp"><![CDATA[$P{STARTED_AT}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="false">
				<reportElement key="textField" x="478" y="37" width="100" height="16" forecolor="#000000"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement/>
				<textFieldExpression class="java.lang.Integer"><![CDATA[$P{SIZE}]]></textFieldExpression>
			</textField>
		</band>
	</pageHeader>
	<columnHeader>
		<band height="21">
			<staticText>
				<reportElement key="staticText-51" mode="Opaque" x="0" y="3" width="267" height="15" forecolor="#D8DADB" backcolor="#29166A"/>
				<box>
					<topPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font isBold="true" pdfFontName="Helvetica-Bold"/>
				</textElement>
				<text><![CDATA[Processing Type]]></text>
			</staticText>
			<staticText>
				<reportElement key="staticText-55" mode="Opaque" x="392" y="3" width="113" height="15" forecolor="#D8DADB" backcolor="#29166A"/>
				<box>
					<topPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font isBold="true" pdfFontName="Helvetica-Bold"/>
				</textElement>
				<text><![CDATA[Records Found]]></text>
			</staticText>
			<staticText>
				<reportElement key="staticText-56" mode="Opaque" x="505" y="3" width="80" height="15" forecolor="#D8DADB" backcolor="#29166A"/>
				<box>
					<topPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font isBold="true" pdfFontName="Helvetica-Bold"/>
				</textElement>
				<text><![CDATA[%]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="17">
			<textField isBlankWhenNull="false">
				<reportElement key="textField-1" mode="Opaque" x="393" y="0" width="117" height="13" backcolor="#D8DADB"/>
				<box>
					<topPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.25" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.Integer"><![CDATA[$V{recordsMatched}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="false">
				<reportElement key="textField-2" x="267" y="0" width="125" height="13"/>
				<box>
					<topPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.25" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{statisticType}]]></textFieldExpression>
			</textField>
			<textField pattern="##0" isBlankWhenNull="false">
				<reportElement key="textField-4" mode="Opaque" x="510" y="0" width="75" height="13" backcolor="#D8DADB"/>
				<box>
					<topPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.25" lineColor="#000000"/>
					<rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.Integer"><![CDATA[$V{PERCENTAGE}]]></textFieldExpression>
			</textField>
			<rectangle>
				<reportElement isPrintRepeatedValues="false" x="0" y="0" width="267" height="13" backcolor="#FFCCCC">
					<printWhenExpression><![CDATA[new Boolean($F{auditStatus}==true)]]></printWhenExpression>
				</reportElement>
			</rectangle>
			<rectangle>
				<reportElement isPrintRepeatedValues="false" x="0" y="0" width="267" height="13" backcolor="#99CCFF">
					<printWhenExpression><![CDATA[new Boolean($F{auditStatus}==false)]]></printWhenExpression>
				</reportElement>
			</rectangle>
			<textField isBlankWhenNull="false">
				<reportElement key="textField-3" stretchType="RelativeToBandHeight" isPrintRepeatedValues="false" mode="Transparent" x="-6" y="0" width="273" height="14" forecolor="#29166A" backcolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="8"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{processingType}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band/>
	</columnFooter>
	<pageFooter>
		<band height="306">
			<bar3DChart>
				<chart isShowLegend="false" evaluationTime="Report">
					<reportElement key="element-1" stretchType="RelativeToBandHeight" x="6" y="43" width="580" height="204"/>
					<box>
						<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
						<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
						<bottomPen lineWidth="0.0" lineColor="#000000"/>
						<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					</box>
					<chartTitle/>
					<chartSubtitle/>
					<chartLegend/>
				</chart>
				<categoryDataset>
					<categorySeries>
						<seriesExpression><![CDATA[$F{statisticType}]]></seriesExpression>
						<categoryExpression><![CDATA[$F{processingType}]]></categoryExpression>
						<valueExpression><![CDATA[$V{PERCENTAGE}]]></valueExpression>
						<labelExpression><![CDATA[$V{recordsMatched}.toString()]]></labelExpression>
						<itemHyperlink/>
					</categorySeries>
				</categoryDataset>
				<bar3DPlot isShowLabels="true">
					<plot backcolor="#FFFFFF" labelRotation="30.0"/>
					<categoryAxisFormat>
						<axisFormat>
							<labelFont>
								<font fontName="SansSerif" size="5" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
							</labelFont>
							<tickLabelFont>
								<font fontName="SansSerif" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
							</tickLabelFont>
						</axisFormat>
					</categoryAxisFormat>
					<valueAxisLabelExpression><![CDATA["Percentage (%)"]]></valueAxisLabelExpression>
					<valueAxisFormat>
						<axisFormat>
							<labelFont/>
							<tickLabelFont/>
						</axisFormat>
					</valueAxisFormat>
				</bar3DPlot>
			</bar3DChart>
			<rectangle>
				<reportElement key="rectangle-1" mode="Opaque" x="-5" y="247" width="596" height="58" forecolor="#29166A" backcolor="#1E1A56"/>
				<graphicElement fill="Solid"/>
			</rectangle>
			<staticText>
				<reportElement key="staticText-10" x="0" y="256" width="104" height="14" forecolor="#D8DADB"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement/>
				<text><![CDATA[CNM Limited]]></text>
			</staticText>
			<staticText>
				<reportElement key="staticText-11" x="0" y="270" width="196" height="14" forecolor="#D8DADB"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement/>
				<text><![CDATA[Bullring House, 23 Northgate]]></text>
			</staticText>
			<staticText>
				<reportElement key="staticText-12" x="0" y="284" width="154" height="14" forecolor="#D8DADB"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement/>
				<text><![CDATA[Wakefield WF1 3BJ]]></text>
			</staticText>
			<staticText>
				<reportElement key="staticText-13" x="431" y="256" width="154" height="14" forecolor="#D8DADB"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Right"/>
				<text><![CDATA[Tel No: 01924 888700]]></text>
			</staticText>
			<staticText>
				<reportElement key="staticText-14" x="431" y="270" width="154" height="14" forecolor="#D8DADB"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Right"/>
				<text><![CDATA[email: sales@cnm.co.uk]]></text>
			</staticText>
			<staticText>
				<reportElement key="staticText-15" x="431" y="284" width="154" height="14" forecolor="#D8DADB"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Right"/>
				<text><![CDATA[Website: www.cnm.co.uk]]></text>
			</staticText>
			<line>
				<reportElement key="line-1" x="-7" y="251" width="598" height="1" forecolor="#D8DADB"/>
			</line>
			<staticText>
				<reportElement key="staticText-54" mode="Transparent" x="6" y="5" width="273" height="21" forecolor="#A8A5A5"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement>
					<font size="18"/>
				</textElement>
				<text><![CDATA[Summary]]></text>
			</staticText>
		</band>
	</pageFooter>
	<summary>
		<band/>
	</summary>
</jasperReport>

Has anyone experienced this problem, I have tried changing the evaluate at to report, band, etc and none seem to make any difference. The values must be their as they are used to calculate the percentage.

Thanks (in advnace)

Chris



Post Edited by chris johnson at 04/17/09 13:50
chr15athome's picture
Joined: Apr 17 2009 - 6:32am
Last seen: 14 years 5 months ago

chr15athome
Wrote:

but the chart does not have any values apart from a percentage which is calculated from the field values.

What other values do you expect int the chart?  It only shows what is fed to it via its dataset expressions.

Regards,

Lucian

lucianc's picture
87321
Joined: Jul 17 2006 - 1:10am
Last seen: 18 hours 34 min ago
Hi, The charts bars are showing the correct values but where I use fields for the category series labels, etc the names are not resolved. Infact the only value which gets resolved is the Variable that calculates the percentage. However this variable is calculated using some of the other fields. I have tried passing all the fields into variables but still nothing. Thanks Chris
chr15athome's picture
Joined: Apr 17 2009 - 6:32am
Last seen: 14 years 5 months ago

The series are not shown because you have isShowLegend="false".  Set this attribute to true and a legend cotaining the series displayed in the chart will show.

Regards,

Lucian

lucianc's picture
87321
Joined: Jul 17 2006 - 1:10am
Last seen: 18 hours 34 min ago
Hi Lucian, The legend makes no difference its just blank. The problem is due to either the fields not being available when the chart is created (but I have tried every evaluateAt stage possible), the groups cause a problem with the fields that are available (Ihave tried incrementing by group) or the bean data source works differently to SQL data sources.
chr15athome's picture
Joined: Apr 17 2009 - 6:32am
Last seen: 14 years 5 months ago

Here is the jrxml file I am using.

Thanks

Chris

chr15athome's picture
Joined: Apr 17 2009 - 6:32am
Last seen: 14 years 5 months ago

The JRXML still has isShowLegend="false" for the chart.  I've changed that to true and filled the report with some dummy/random data.  The result looks fine to me, see attached.

I don't know why it doesn't work for you, maybe you could create a self contained test case to illustrate the problem.

Regards,

Lucian

lucianc's picture
87321
Joined: Jul 17 2006 - 1:10am
Last seen: 18 hours 34 min ago

Hi Lucian,

The link to the PDF doesn't seem to work.

I tried ticking the box for the legend to show but it made no difference just showed a blank legend with no category names or anything else. I don't want the legend anyway so that is why I removed it again.

I have tried posting the PDF result I get but the forum will not upload it.

Thanks

Chris

chr15athome's picture
Joined: Apr 17 2009 - 6:32am
Last seen: 14 years 5 months ago

here is the pdf I get

Thanks

Chris

chr15athome's picture
Joined: Apr 17 2009 - 6:32am
Last seen: 14 years 5 months ago

Hi Lucian,

Sorry the pdf you posted works now. Can you tell me what data source you used?

That is how the PDF should look.

Would it be possible for you to send me the updated jrxml file so I can compare it.

 

Thanks

Chris

chr15athome's picture
Joined: Apr 17 2009 - 6:32am
Last seen: 14 years 5 months ago
Is there any chance of getting a copy of the working JRXML, so I can compare it with my none working JRXML. I do feel that it is the bean data source that is causing the problem. Thanks Chris
chr15athome's picture
Joined: Apr 17 2009 - 6:32am
Last seen: 14 years 5 months ago

The JRXML would probably not help as I only changed the isShowLegend attribute to true (and removed the image).

As you said, it might be a data source issue.  I used a data source that produces random/dummy data.  I'm attaching the Java source for the class, try to fill the report with this data source and see what happens.

Regards,

Lucian

lucianc's picture
87321
Joined: Jul 17 2006 - 1:10am
Last seen: 18 hours 34 min ago
Thanks Lucian, I tried to download the code but says error 404. Will wait a bit and try again. Have tried just the chart in separate report with same data source but no luck. Will try your data source and see if it makes a difference. Thanks Chris
chr15athome's picture
Joined: Apr 17 2009 - 6:32am
Last seen: 14 years 5 months ago

You need to be logged in in order to download attachments, see this bug.

Is it working now?

lucianc's picture
87321
Joined: Jul 17 2006 - 1:10am
Last seen: 18 hours 34 min ago
OK I just realised about logging in. Now I have managed to narrow this problem down to some sort or difference in versions between a system report I have that works and the same report that doesn\'t work run in a test environment. I have checked JFreeChart, JasperReports, JFree, Itext I know they are the same as we have run from command line adding the dependencies. Do you know any other class that might cause the missing text in the chart? Thanks Chris
chr15athome's picture
Joined: Apr 17 2009 - 6:32am
Last seen: 14 years 5 months ago

It might also be a problem with Java fonts, although I haven't seen this before.

You could try to set renderType="image" for the chart and see whether this has any effect.  Or maybe try other formats such as HTML or the Java report viewer.

Regards,

Lucian

lucianc's picture
87321
Joined: Jul 17 2006 - 1:10am
Last seen: 18 hours 34 min ago
Thanks for all the help Lucian. I finally found it was due to this version of openJDK: java-1.6.0-openjdk-src.i386 1:1.6.0.0-0.23.b09 download the up-to-date one from sun.com and everything works. I had to remove the openJDK completely before Eclipse would stop calling it and change the alternatives to point to suns VM. I can finally get back on with some real development work...lol. Thanks Chris
chr15athome's picture
Joined: Apr 17 2009 - 6:32am
Last seen: 14 years 5 months ago
Feedback
randomness