greylimbo Posted June 11, 2007 Share Posted June 11, 2007 I have tried to get my eclipse project to read the "jasper.properties" file and therefore find the .ttf files but it never seems to be reading the "jasper.properties" file. I am battling to get it to set the default folder for the fonts i want use. I have been able to add the .ttf files to my classpath and then it runs perfectly, unsure as to if my "jasper.properties" file is ever read? I am running subreports and using jasperreports-x.x.x-javaflow.jar to improve the performance, but how do I check to see that "net.sf.jasperreports.subreport.runner.factory=net.sf.jasperreports.engine.fill.JRContinuationSubrepo rtRunnerFactory" is even being implemented? any assistance is most welcome. Link to comment Share on other sites More sharing options...
raffimd Posted June 11, 2007 Share Posted June 11, 2007 Are you sure you placed that properties file in classpath? If you are running a web application, place the "jasper.properties" in WEB-INF/classes directory. Link to comment Share on other sites More sharing options...
greylimbo Posted June 11, 2007 Author Share Posted June 11, 2007 The properties file is definately in the classpath. It is just a java application, the problem is that if i place the .ttf files into the classpath then the exporter finds them and its all happy. But if i set "net.sf.jasperreports.export.pdf.fontdir.jasper=../fonts" in the properties file and move the .ttf files into the fonts directory i get this error message:Exception in thread "AWT-EventQueue-0" net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font : pdfFontName : Tahoma.ttfpdfEncoding : Cp1252isPdfEmbedded : true at net.sf.jasperreports.engine.export.JRPdfExporter.getFont(JRPdfExporter.java:1488) at net.sf.jasperreports.engine.export.JRPdfExporter.getChunk(JRPdfExporter.java:1391) at net.sf.jasperreports.engine.export.JRPdfExporter.getPhrase(JRPdfExporter.java:1374) at net.sf.jasperreports.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:1731) at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:613) at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:577) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:520) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:306) I have looked at other posts that deal with this issue and i still cannot get it to work? Link to comment Share on other sites More sharing options...
greylimbo Posted June 11, 2007 Author Share Posted June 11, 2007 bytes = JRLoader.loadBytesFromLocation(pdfFont.getPdfFontName(), classLoader, urlHandlerFactory);this is where the app bombs out, Code:classLoader and Code:[code]urlHandlerFactory are both null, is this correct? Surely if the properties files is in the classpath and is being read I dont have to hard code Code:[code]JRProperties.PDF_FONT_DIRS_PREFIX Link to comment Share on other sites More sharing options...
greylimbo Posted June 11, 2007 Author Share Posted June 11, 2007 http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=&func=view&catid=8&id=17234#17234 also refers to the same problem. Was just hoping someone had any ideas. 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