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> |
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
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
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
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
You need to be logged in in order to download attachments, see this bug.
Is it working now?