barlindh Posted November 30, 2010 Share Posted November 30, 2010 Hello,I am having problem displaying text from JFreeCharts in my JasperReport. I am embedding the chart as it is done in the "jfreechart" sample. I can view the chart with titles etc. with "view", but when I export to PDF the titles disappear. The text from the jrxml file is still there.From what I have read here, I think there is a problem with font embedding, but I am not sure what to do to fix this. Any help is greatly appreciated. I am using JasperReports 3.7.6 on Ubuntu.I know that it is possible (and probably easier) to generate charts directly in JasperReports as in the "charts" sample code. But I am doing a lot of customization of the charts so I would like to do it in my Java application.Screenshots of the pdf and JasperViewer are attached.Post Edited by barlindh at 11/30/2010 14:01 Link to comment Share on other sites More sharing options...
svenn Posted November 30, 2010 Share Posted November 30, 2010 I assume you know that you can extend JRAbstractChartCustomizer then point to this class in your chart. We have some really fancy charts and use this approach to create our custom charts. Link to comment Share on other sites More sharing options...
barlindh Posted December 1, 2010 Author Share Posted December 1, 2010 No, I do not know about the JRAbstractChartCustomizer. I have tried to find some more inforamtion, but I have not found anything else except form the JasperReports API. Is it featured in any of the samples included in JasperReports? The class that I make extending JRAbstractChartCustomizer is run by Japserreports as a scriptlet? How do I access it in my jrxml file? An net.sf.jasperreports.engine.JRAbstractChartCustomizer variable inside an ImageExpression tag? Link to comment Share on other sites More sharing options...
iamwoodyjones Posted December 2, 2010 Share Posted December 2, 2010 To narrow down the problem I would try the following: * Switch your font and then see if it shows up in PDF* If it still doesn't then export to a different format and see if your font shows up thenAs for using a cusomizer class you just have to put the customizer as an attribute called cusomizerClass such as: <chart evaluationTime="Report" customizerClass="com.my.package.ChartCustomizer">And then just ensure that the class is on your classpath Link to comment Share on other sites More sharing options...
barlindh Posted December 6, 2010 Author Share Posted December 6, 2010 Suddenly I got the fonts working with JRRenderable. Unfortunately I do not know exactly what made it work, but I think it has something to do with the font JFreeChart used.So right now JRRenderable is serving my needs so I will keep it. Thanks for all your help. 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