lukus Posted July 2, 2009 Share Posted July 2, 2009 Hi There, 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 to 3.5.2 in aneffort 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. I've attached a copy of what I'm getting.Any help will be greatly apreciated. Cheers Link to comment Share on other sites More sharing options...
lukus Posted July 6, 2009 Author Share Posted July 6, 2009 Does anyone have any idea on this? I could really use some help... Link to comment Share on other sites More sharing options...
Teodor Danciu Posted July 7, 2009 Share Posted July 7, 2009 Hi, It would he good if you could post the JRXML source file.It certainly looks like the well known problem of missing fonts:http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/faq.html?group_id=252#FAQ25 The solution is to make sure the fonts you use in your reports will be present on the machine where your application runs, simply by shipping those fonts with your application, packages as font extensions.The samples inside the JR project distribution use fonts from a font extension placed inside the /demo/fonts folder of the project, which is part of the classpath when those samples are run. Look into the files there and see what you need to do in order to package up TTF files as font extension to use with your reports. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
lukus Posted July 7, 2009 Author Share Posted July 7, 2009 Hi Teodord, Thanks for your feedback. Here is my JRXML... There is really very little going on here and I have left all the font settings as the default in iReport. I did have a read of FAQs regarding the fonts and I will have a crack at explicitly packaging them up for reference and let you know how I go. CheersLukus 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="report name" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <subDataset name="Piegraph"> <queryString> <![CDATA[sELECT COUNT(h.id), h.statusFROM dheader hWHERE h.projectid = 179AND h.visitdate > '2009-06-01'GROUP BY h.status]]> </queryString> <field name="count" class="java.lang.Long"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="status" class="java.lang.Integer"> <fieldDescription><![CDATA[]]></fieldDescription> </field> </subDataset> <queryString> <![CDATA[]]> </queryString> <background> <band splitType="Stretch"/> </background> <title> <band height="64" splitType="Stretch"/> </title> <pageHeader> <band height="6" splitType="Stretch"/> </pageHeader> <columnHeader> <band splitType="Stretch"/> </columnHeader> <detail> <band splitType="Stretch"/> </detail> <columnFooter> <band splitType="Stretch"/> </columnFooter> <pageFooter> <band splitType="Stretch"/> </pageFooter> <summary> <band height="337" splitType="Stretch"> <bar3DChart> <chart> <reportElement x="16" y="14" width="515" height="309"/> <chartTitle/> <chartSubtitle/> <chartLegend/> </chart> <categoryDataset> <dataset> <datasetRun subDataset="Piegraph"/> </dataset> <categorySeries> <seriesExpression><![CDATA[$F{status}]]></seriesExpression> <categoryExpression><![CDATA[$F{status}]]></categoryExpression> <valueExpression><![CDATA[$F{count}]]></valueExpression> <labelExpression><![CDATA["Status"]]></labelExpression> </categorySeries> </categoryDataset> <bar3DPlot> <plot/> <categoryAxisFormat> <axisFormat> <labelFont/> <tickLabelFont/> </axisFormat> </categoryAxisFormat> <valueAxisFormat> <axisFormat> <labelFont/> <tickLabelFont/> </axisFormat> </valueAxisFormat> </bar3DPlot> </bar3DChart> </band> </summary></jasperReport> Link to comment Share on other sites More sharing options...
Teodor Danciu Posted July 8, 2009 Share Posted July 8, 2009 Hi, Are you sure this is the exact report you are running and you get the result in the PDF you sent us?As it is, this JRXML is unlikely to run because the master does not have a datasource and whenNoDataType is not set. If it had a data source, then it would not have a connection for the subdataset to exectute its query. Also, when you are making your tests, you are trying to view the PDF reports on the same machine that generates them?What about other formats, like html, do they work? Thanks,Teodor Link to comment Share on other sites More sharing options...
lukus Posted July 8, 2009 Author Share Posted July 8, 2009 Hi, Apoligies. I'm not sure how I ended up posting an incomplete JRXML file. I've double checked and ensured that this one is correct. The connection is passed in at the time of launching. I have yet to test with differing output but will do in the next couple of hours and post the results. Cheers Code: Post Edited by lukus at 07/08/2009 22:44 Link to comment Share on other sites More sharing options...
lukus Posted July 8, 2009 Author Share Posted July 8, 2009 OK I've had a crack using RTF output (I'm not set up to create HTML output at the mo without writing another class). The result was that I actually got the labels...? Link to comment Share on other sites More sharing options...
lukus Posted July 8, 2009 Author Share Posted July 8, 2009 Hi Teodord, From the FAQs you posted eariler --- "One thing to play attention to is making sure that the fonts set in the report via fontName attributes are actually available in the Java VM, because AWT silently uses the default font when a specific font cannot be loaded" This seems to be the most likely scinario and including the font lib in the class path won't be a problem but I'm unsure of even what font the default fint is. I've tried explicity setting the font and including that in the classpath to no avail. Cheers Link to comment Share on other sites More sharing options...
Teodor Danciu Posted July 13, 2009 Share Posted July 13, 2009 Hi, I'm not sure how did you try to include the font the in the classpath. Simply putting it in the classpath does not make it available to your program. You need to setup a font extension. So at least two more config files would be needed along with your font file. Check the files in the /demo/fonts folder of JR. They represent a functional font extension containing two font families. Do something similar for your font files, or add them there. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
lukus Posted July 13, 2009 Author Share Posted July 13, 2009 Hi Teodord, 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...
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