prashanth.talkad Posted March 28, 2010 Share Posted March 28, 2010 Hi,I'm facin an issue where Maori Macrons are getting displayed on my reports when I run it in JasperServer(v ) and in iReport(v ). I have a java Interface with code to interact with JasperServer via webservices calls provided by the jasper server. The moethod - public JasperPrint generateReport(String reportUri, Map parameters) throws Exception { ResourceDescriptor resourceDescriptor = new ResourceDescriptor(); resourceDescriptor.setWsType(ResourceDescriptor.TYPE_REPORTUNIT); resourceDescriptor.setUriString(reportUri); JasperPrint generatedJP = null; WSClient wsClient = jasperServer.getWSClient(); if (wsClient != null) { generatedJP = wsClient.runReport(resourceDescriptor, parameters); boolean emptyPages = generatedJP.getPages().isEmpty(); } else { new SystemException("A WSClient instance is not available."); } return generatedJP; } And the returned JasperPrint object is converted into pdf using - JasperExportManager.exportReportToPdfFile(report, pdfFile.getAbsolutePath());This is where the problem is - the pdf report that is rendered DOES NOT CONTAIN MAORI MACRONS!!! As mentioned earlier, the macrons are visible when I run it from iReport(with connection to server) and from the jasper server itself.Any help in pointing to the right direction to get this working is appreciated. cheersp Link to comment Share on other sites More sharing options...
prashanth.talkad Posted March 29, 2010 Author Share Posted March 29, 2010 hi - a quick update . in the JRXML, I've got a text field as below - <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" ><reportElementx="9"y="25"width="523"height="12"key="textField-7"/><box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/><textElement><font fontName="Times-Roman" size="10" pdfFontName="C:\WINDOWS\FONTS\ARIALUNI.TTF" pdfEncoding="Identity-H" isPdfEmbedded="true"/></textElement><textFieldExpression class="java.lang.String"><![CDATA[$F{V_PERSON_ADDRESSING_NAME}]]></textFieldExpression></textField> If in the above field definition I change the pdfFontName to "repo:ARIALUNI.TTF" and upload the font onto jasperserver, the java application throws an exception -Caused by: net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font :pdfFontName : repo:ARIALUNI.TTFpdfEncoding : Identity-HisPdfEmbedded : trueat net.sf.jasperreports.engine.export.JRPdfExporter.getFont(JRPdfExporter.java:1691)at net.sf.jasperreports.engine.export.JRPdfExporter.getChunk(JRPdfExporter.java:1600)at net.sf.jasperreports.engine.export.JRPdfExporter.getPhrase(JRPdfExporter.java:1583)at net.sf.jasperreports.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:1908) If the hardcoded path is in the field definition, it would like a charm. The java app I'm talking about it a web application and the user needs to open the pdf's to view the macrons. thanks,p Link to comment Share on other sites More sharing options...
mdahlman Posted April 1, 2010 Share Posted April 1, 2010 It sounds like you need Font Extensions. Search the JasperReports forum (not this iReport forum) for details. Font Extensions are also documented in the JR Ultimate Guide.Regards,Matt 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