lukus Posted July 5, 2009 Share Posted July 5, 2009 Hi There, None of my graphs display any lables, ledgend or numbers. I've attached an example I have been using ireport and jasperReports for a whle now and have just migrated all my reports fomr an old OSX 10.3 server to a new CentOS setup. As a result none of my PDF reports that use graphs now display any lables of any sort. I've upgraded all components from 3.0.0 libraries to 3.5.2 in an effort to get this fixed but to no avail. I've even written a very simple report that just displays a bar graph. The graph renders fine but again no lables or anything. Not even any numbering on the axsis. I am thinking that this is a system font issue maybe but have no idea as to how to solve it...? Any help will be greatly apreciated. I have already posted this on the 'JasperReports Discussion/Help' but have had no responce over the last 3 or 4 days so apoligies if you have already read this... CheersPost Edited by lukus at 07/05/2009 23:35 Link to comment Share on other sites More sharing options...
lukus Posted July 8, 2009 Author Share Posted July 8, 2009 Anyone got any suggestions on this? I'm willing to try almost anything... Link to comment Share on other sites More sharing options...
mdahlman Posted July 8, 2009 Share Posted July 8, 2009 Attach the .jrxml and someone may be able to take a look. Please modify your SQL to just return a few hard-coded values so that people can run it. For example:SELECT 'abc' as field1, 42 as field2UNION SELECT 'xyz' as field1, 11 as field2 Also, your PDF looks like you're using the same value for the Series and Category. Really you should be using that value for the Series OR the Category. Regards,Matt Link to comment Share on other sites More sharing options...
lukus Posted July 8, 2009 Author Share Posted July 8, 2009 Hi Matt, thanks for the sugestions. This isn't an actual report but rather something I knocked up for testing so I haven't been too concerned with proper pratice ;) I've put in a static query with the JRXML Cheers Code:<?xml version="1.0" encoding="UTF-8" ?><!-- Created with iReport - A designer for JasperReports --><!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"><jasperReport name="Action_Graph" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="0" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <subDataset name="Piegraph" > <queryString><![CDATA[sELECT 12 AS count, 'Missed' AS status UNION SELECT 45 AS count, 'Compleated' AS status UNION SELECT 16 AS count, 'Pending' AS status UNION SELECT 75 AS count, 'Actions' AS status UNION SELECT 62 AS count, 'Refused' AS status]]></queryString> <field name="count" class="java.lang.Long"/> <field name="status" class="java.lang.Integer"/> </subDataset> <queryString><![CDATA[sELECT '']]></queryString> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="64" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="6" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="0" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="0" isSplitAllowed="true" > </band> </detail> <columnFooter> <band height="0" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="0" isSplitAllowed="true" > </band> </pageFooter> <summary> <band height="337" isSplitAllowed="true" > <bar3DChart> <chart hyperlinkTarget="Self" > <reportElement x="16" y="14" width="515" height="309" key="element-1"/> <box></box> <chartLegend textColor="#000000" backgroundColor="#FFFFFF" > </chartLegend> </chart> <categoryDataset> <dataset > <datasetRun subDataset="Piegraph"> </datasetRun> </dataset> <categorySeries> <seriesExpression><![CDATA[$F{status}]]></seriesExpression> <categoryExpression><![CDATA[$F{status}]]></categoryExpression> <valueExpression><![CDATA[$F{count}]]></valueExpression> <labelExpression><![CDATA["Status"]]></labelExpression> <itemHyperlink > </itemHyperlink> </categorySeries> </categoryDataset> <bar3DPlot > <plot /> <categoryAxisFormat> <axisFormat > </axisFormat> </categoryAxisFormat> <valueAxisFormat> <axisFormat > </axisFormat> </valueAxisFormat> </bar3DPlot> </bar3DChart> </band> </summary></jasperReport> Link to comment Share on other sites More sharing options...
lukus Posted July 8, 2009 Author Share Posted July 8, 2009 I am able to get lebels when creating an RTF so this looks to be PDF specific... Link to comment Share on other sites More sharing options...
mdahlman Posted July 9, 2009 Share Posted July 9, 2009 Lukus, I pasted your attached jrxml and ran it in iReport. It looks fine for me in PDF. See the attached image.I guess you're right about it being related to what fonts are available... but I'm not sure what's going wrong. Try changing the axis or legend font to something that you're sure you have. Regards,Matt Link to comment Share on other sites More sharing options...
lukus Posted July 13, 2009 Author Share Posted July 13, 2009 Hi Matt, thanks for helping me out with this one. Unfortunatly I just couldn't crack it. I took the rather drastic measure of scrapping CentOS and installing FreeBSD and using their Ports jdk16 install... java version “1.6.0_03-p4″Java SE Runtime Environment (build 1.6.0_03-p4-root_30_mar_2009_17_29-b00)Java HotSpot Client VM (build 1.6.0_03-p4-root_30_mar_2009_17_29-b00, mixed mode) This has worked a charm. Once again thanks. Cheers Link to comment Share on other sites More sharing options...
asking4 Posted November 5, 2009 Share Posted November 5, 2009 Thanks for the suggestion of installing fonts. I had the same issue - Charts labels were all blank in PDF output version of a report from jasperserver. (jasperserver running on centos5) yum install xorg-x11-fonts* solved it. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now