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

prashanth.talkad

Members
  • Posts

    45
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Everything posted by prashanth.talkad

  1. 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" > <reportElement x="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.TTF pdfEncoding : Identity-H isPdfEmbedded : true at 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
  2. 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" > <reportElement x="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.TTF pdfEncoding : Identity-H isPdfEmbedded : true at 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
  3. 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. cheers p
  4. 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. cheers p
  5. Matt, I'm using JasperExportManager to export the report to PDF from my application like below ::: JasperExportManager.exportReportToPdfFile(report, pdfFile.getAbsolutePath()); I would also think that the font may need to be in my calsspath or no? please confirm ! thanks
  6. I tried uploading the font in Jasperserver and referencing it via repo:ARIALUNI.TTF, repo:/ARIALUNI.TTF and all other permutations and combinations to no avail ! not sure what i'm missing this time !! :-(
  7. Thanks Matt. I've uploaded a font called ARIALUNI.TTF into the folder root\resources\fonts\ARIALUNI.TTF I uploaded the report after updating all elements to refer to repo://ARIALUNI.TTF, but it STILL throws the same exception of not being able to load the FONT !!! :-(
  8. Hi, The problem I'm having:: I'm getting a raw stream from a webservice call to JasperServer and trying to export the same to PDF using JasperExportManager.exportFileToPdf(JasperPrint, path)....The issue is that when I use ARIALUNI.TTF as PDF font name and PDFEmbedded is true and PDFEncoding is Identity-H, the export to PDF fails from my java applicationbecause it cannot find the path of the font ARIALUNI.TTF. I was looking into the jasperreports-3.0.1 api and found the JRProperties class which defines the properties files which load the PDF fonts, PDF_FONT_FILES_PREFIX and PDF_FONT_DIRS_PREFIX. I'm unable to locate the /** * Prefix of properties that specify font files for the PDF exporter. */ public static final String PDF_FONT_FILES_PREFIX = PROPERTY_PREFIX + "export.pdf.font."; // this is net.sf.jasperreports.export.pdf.font /** * Prefix of properties that specify font directories for the PDF exporter. */ public static final String PDF_FONT_DIRS_PREFIX = PROPERTY_PREFIX + "export.pdf.fontdir."; // this is net.sf.jasperreports.export.pdf.fontdir My question is ........ where should I add the fonts int the API(I'm using jasperserver.jar) in my applications library). Any help is appreciated. cheers,p
  9. in my application, i use jasperreports2.0.1.jar, JasperReports API, and this JAR needs to have the font in it somewhere for it to export the file to PDF from the raw stream that it recieves from the JasperServer webservice call. I was looking into the API and found the following - JRProperties point to net.sf.jasperreports.export.pdf.font for PDF fonts, but i'm unable to find that path in the jar. I'll try and add these folder manually into the exploded jar and see if it works. cheers
  10. Thanks Matt. Here's what I did in JasperServer(the install directory) - 1. added fonts ARIALUNI.TTF, ARIAL.TTF into the iReport\fonts folder. 2. I have a tomcat base to which I deploy jasperserver.war - I edited the pdfFontBeans.xml to include font references to the fonts placed in the iReport\fonts folder mentioned in 1. I ran the report from teh web interface of JasperServer and used the "PDF Export" button as in the snapshot below: this works now !! thats a step ahead. But my java application that interfaces with JasperServer and calls the same report and reads the PDF back into the client browser fails with an exception::: :( Could not load the following font : pdfFontName : ARIALUNI.TTF pdfEncoding : Identity-H isPdfEmbedded : true To get this to work in JRViewer, I had loaded the fonts ARIALUNI.TTF, arial.ttf in to the "iReportFonts" folder under the JasperServer install folder. This means that the Jasper Server now packages the font into the PDF export. Are there any other settings I need to do for this to work with my application. Since my application is just using the JasperServer API to get JasperPrint pbjects, I thought that it should work on its own if it wokrd on JasperServer. But thats not the case. I'm lost !!! Is there something I'm missing here? thanks, p
  11. I've got it to export into PDF(from the Web Interface of JasperServer) - that is, from the JRViewer. I can run the report in JRViewer and then export to PDF using the "PDF link". Now, I try to run the same report via my application - this throws a similar exception now - Could not load the following font : pdfFontName : ARIALUNI.TTF pdfEncoding : Identity-H isPdfEmbedded : true To get this to work in JRViewer, I had loaded the fonts ARIALUNI.TTF, arial.ttf in to the "iReportFonts" folder under the JasperServer install folder. This means that the Jasper Server now packages the font into the PDF export. Are there any other settings I need to do for this to work with my application. Since my application is just using the JasperServer API to get JasperPrint pbjects, I thought that it should work on its own if it wokrd on JasperServer. But thats not the case. I'm lost !!!
  12. as i've stated in my previous post, I had it uncommented but it did not work and hence I commented it. but in any case, will try again and I had tried with the absolute path as well for the font TTF files in the XML. there is something else missing here....dunno what though.... Project owner???? can you help? p
  13. I'll try to explain our current setup here::: 1) The jasperserver install has a fonts forlder - c:program filesjasperserver-2.0.1ireportfonts and i've added arial.ttf and ARIALUNI.TTF into this folder. 2) I have a Tomcat Base that has the jasperserver.war deployed on it at c:tomcal-base-nzls-jasperwebapps 3) The WEB-INF in c:tomcal-base-nzls-jasperwebappsjasperserver has pdffontbeans.xml, wherein, i've added entries for the fonts as below:::: i've commented out the fonts as I was not sure if this was needed here. 4) when I try to run the report in JRViewer, the Maori Macrons displays - see anapshot attached. 5) when i export this report to PDF by clicking the PDF icon in the snapshot, or through the application that reads the pdf, it throws the following error. Error Trace: net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font : pdfFontName : ARIALUNI.TTF pdfEncoding : Identity-H isPdfEmbedded : true net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font : pdfFontName : ARIALUNI.TTF pdfEncoding : Identity-H isPdfEmbedded : true at net.sf.jasperreports.engine.export.JRPdfExporter.getFont(JRPdfExporter.java:1551) at net.sf.jasperreports.engine.export.JRPdfExporter.getChunk(JRPdfExporter.java:1454) at net.sf.jasperreports.engine.export.JRPdfExporter.getPhrase(JRPdfExporter.java:1437) at net.sf.jasperreports.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:1794) at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:632) at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:596) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:539) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:313) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.exportToPdf(EngineServiceImpl.java:275) at com.jaspersoft.jasperserver.war.action.ReportPdfExporter.export(ReportPdfExporter.java:63) Code:<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsdhttp://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> <!-- parent map --> <!-- This is the map containing localized font maps. Keys are Strings representing the language hold by the session context's Locale object. Values are font maps. Please feel free to uncomment, add simmilar elements, or modify the commented entries below. --> <util:map id="localePdfFontMap"> <!-- <entry key="en" value-ref="enPdfFontMap"/> <entry key="ja_JP" value-ref="jaJpPdfFontMap"/> --> </util:map> <!-- end parent map --> <!-- localized font maps --> <!-- Font maps are maps with specific structure: Keys are FontKey objects; values are PdfFont objects. --> <!-- <util:map id="enPdfFontMap"> <entry key-ref="enArialFontKey" value-ref="enArialPdfFont"/> <entry key-ref="enArialUniFontKey" value-ref="enArialUniPdfFont"/> </util:map> <util:map id="jaJpPdfFontMap"> <entry key-ref="jaJpArialFontKey" value-ref="jaJpArialPdfFont"/> <entry key-ref="jaJpArialUniFontKey" value-ref="jaJpArialUniPdfFont"/> </util:map> --> <!-- end localized font maps --> <!-- localized font keys --> <!-- <bean id="enArialFontKey" class="net.sf.jasperreports.engine.export.FontKey"> <constructor-arg index="0" value="Arial"/> <constructor-arg index="1" value="false"/> <constructor-arg index="2" value="false"/> </bean> <bean id="enArialUniFontKey" class="net.sf.jasperreports.engine.export.FontKey"> <constructor-arg index="0" value="Arial Unicode MS"/> <constructor-arg index="1" value="false"/> <constructor-arg index="2" value="false"/> </bean> <bean id="jaJpArialFontKey" class="net.sf.jasperreports.engine.export.FontKey"> <constructor-arg index="0" value="Arial"/> <constructor-arg index="1" value="false"/> <constructor-arg index="2" value="false"/> </bean> <bean id="jaJpArialUniFontKey" class="net.sf.jasperreports.engine.export.FontKey"> <constructor-arg index="0" value="Arial Unicode MS"/> <constructor-arg index="1" value="false"/> <constructor-arg index="2" value="false"/> </bean> --> <!-- end localized font keys --> <!-- localized pdf fonts --> <!-- The best practice is to save first the desired pdfFont in the repository, and then to reference it in the 0-index constructor argument. Another way, less safer is to save the .TTF object on your disk, and store its absolute path in the 0-index constructor argument. --> <!-- <bean id="enArialPdfFont" class="net.sf.jasperreports.engine.export.PdfFont"> <constructor-arg index="0" value="repo:/fonts/arial.ttf"/> <constructor-arg index="1" value="Identity-H"/> <constructor-arg index="2" value="false"/> <constructor-arg index="3" value="false"/> <constructor-arg index="4" value="false"/> </bean> <bean id="enArialUniPdfFont" class="net.sf.jasperreports.engine.export.PdfFont"> <constructor-arg index="0" value="repo:/fonts/ARIALUNI.TTF"/> <constructor-arg index="1" value="Identity-H"/> <constructor-arg index="2" value="true"/> <constructor-arg index="3" value="false"/> <constructor-arg index="4" value="false"/> </bean> <bean id="jaJpArialPdfFont" class="net.sf.jasperreports.engine.export.PdfFont"> <constructor-arg index="0" value="../fonts/ARIAL.TTF"/> <constructor-arg index="1" value="Identity-H"/> <constructor-arg index="2" value="false"/> <constructor-arg index="3" value="false"/> <constructor-arg index="4" value="false"/> </bean> <bean id="jaJpArialUniPdfFont" class="net.sf.jasperreports.engine.export.PdfFont"> <constructor-arg index="0" value="repo:/fonts/ARIALUNI.TTF"/> <constructor-arg index="1" value="Identity-H"/> <constructor-arg index="2" value="true"/> </bean> --> <!-- end localized pdf fonts --> </beans>
  14. hi, i've attached my jrxml. also, when you talk about putting the TTF into the JAR, are you talking about the classpath in iReport? or something else? cheers !
  15. thanks mate!! appreciate your help. I looked in the jasperserver install folder, included the ARIALUNI.TTF in the fonts folder and restarted jasperserver. still the same exception :((
  16. yes I did load the "C:windowsfonts" into the classpath, then I set the Font Path to include the new path and I see the list of fonts in the drop down list for PDF font. Now I chose the "ARIALUNI.TTF" and "Identity-H" for encoding and ran the report in JRViewer. The PDF version still throws an exception, Looks like the Jasper Engine is looking for the font at a place where its not able to find it. Is there another place in jasperserver that I need to load this font? Code:net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font : pdfFontName : ARIALUNI.TTF pdfEncoding : Identity-H isPdfEmbedded : truenet.sf.jasperreports.engine.JRRuntimeException: Could not load the following font : pdfFontName : ARIALUNI.TTFpdfEncoding : Identity-HisPdfEmbedded : true at net.sf.jasperreports.engine.export.JRPdfExporter.getFont(JRPdfExporter.java:1551) at net.sf.jasperreports.engine.export.JRPdfExporter.getChunk(JRPdfExporter.java:1454) at net.sf.jasperreports.engine.export.JRPdfExporter.getPhrase(JRPdfExporter.java:1437) at net.sf.jasperreports.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:1794) at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:632) at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:596) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:539) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:313) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.exportToPdf(EngineServiceImpl.java:275)
  17. hi thanks for the suggestion. i've set the font path in iReport to contain the windows font dir and can also see the font "Arial.....Uni...." and changed the encoding to Identity-H and V , but this throws an exception when i try export to DF saying "cannot load font ,...." duuno why....any ideas?
  18. hmmm tried editing the pdfFontBeans.xml in jasperserver and added a bean to the windows font with support to unicode, and restarted and redeployed, to no avail :((
  19. I'm made sure all fields in my report have the same values for PDF FONT, PDF EMBEDDED and PDF ENCODING respectively as "Helvetica", "checked" and "CP1252". Surprising that I do not find any UNICODE encoding type in the list (though there is a Identity-H and Identity-V, which unfortunately dont work and throws exceptions at runtime.)
  20. I have an issue with Maori Macrons - I am running a report with the code below for a field that needs to display Maori Macrons. It displays fine within JRViewer, and its fine when I export it to word or excel, but craps out when I export to PDF. I've pasted my code below for that field. Any suggestions welcome. below is the code for the text field::: Also, iReport documentation conatains a sentence that says that they have a rich set of encoding types, but which one is best to use for Unicode? I see a Identity-H and -V which does not solve the problem. Also, all fields in my report are consistent in terms of the PDF encoding and PDF font and PDF embedded values. Code:
  21. I have a similar issue with Maori Macrons - I am running a report with the code below for a field that needs to display Maori Macrons. It displays fine within JRViewer, and its fine when I export it to word or excel, but craps out when I export to PDF. I've pasted my code below for that field. Any suggestions welcome. x="9" y="25" width="523" height="12" key="textField-7"/> $F{V_PERSON_ADDRESSING_NAME} Also, iReport documentation conatains a sentence that says that they have a rich set of encoding types, but which one is best to use for Unicode? I see a Identity-H and -V which does not solve the problem. Also, all fields in my report are consistent in terms of the PDF encoding and PDF font and PDF embedded values.
  22. tested via jasperserver interface and the report comes up with the macrons there, but not when exported to PDF !!! :(
  23. I'm thinking that you mean adding font files into the Jasperserver install ?
  24. I'm using Arial for both the font and the PDF fonts. Also, when you say "add font directories to the paths", what exactly do you mean. thanks, p
  25. hi, I have my java application trying to display names of persons and their addresses. The query in my iReport picks up data from a database that supports "nvarchar", thereby supporting Maori Macrons(UTF-8 enconding in other words). But when I try to display the same in the report I desuigned using iReport, the macrons get eaten up and the reminder of the name is shown. For example::: if the name is DÅnnÄ , the report displays only "Dnn". Am using java.lang.String to display the names and heres how my field looks in the iReport. <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="74" y="66" width="188" height="15" key="textField-27"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{V_PERSON_ADDRESSING_NAME}]]></textFieldExpression> </textField> The header of my JRXML reads ::: <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> can anyone help me on this one please. thanks, p
×
×
  • Create New...