Jump to content
We've recently updated our Privacy Statement, available here ×

Blank Labels on Charts


lukus

Recommended Posts

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

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

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

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.

 

Cheers

Lukus

 

 

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

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

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...