aeid Posted July 27, 2007 Share Posted July 27, 2007 Hi, I am seeing very strange behaviour when using JRHtmlExporter:- The report contains special characters like single quotes and non-english characters.- When the report is generated as HTML through iReport, the characters are displayed correctly.- When generating the same report through my web application as part of a JSP page, the non-english characters appear as ????? and the single quote is displayed as '- When generating the same exact report as PDF through the same web application (using JRPdfExporter), all characters are displayed correctly.- I am using arialuni.ttf for PDF encoding:Code: FontKey key = new FontKey("Arial", false, false); PdfFont pdfFont = new PdfFont( reportsPath + "/fonts/arialuni.ttf", "Identity-H", true); Map fontMap = (Map) pdfExporter.getParameter( JRExporterParameter.FONT_MAP );- The same web application is displaying non-english characters correctly through other JSPs. All help is highly appreciated. Regards, Ashraf Link to comment Share on other sites More sharing options...
martynhiemstra Posted July 27, 2007 Share Posted July 27, 2007 That non english characters appear as ?????? is just a encoding problem. You need to learn how to set encoding in your jsp pages. Try this link:http://www.theserverside.com/discussions/thread.tss?thread_id=28944Post edited by: martynhiemstra, at: 2007/07/27 08:38 Link to comment Share on other sites More sharing options...
aeid Posted July 27, 2007 Author Share Posted July 27, 2007 Thanks Marty for your reply. But as I mentioned in my original post, I already have other JSPs in the SAME web application that are displaying the non-english characters correctly.Note that the default encoding for JasperReports is UTF-8 which should do the job. Regards, Ashraf Link to comment Share on other sites More sharing options...
aeid Posted July 31, 2007 Author Share Posted July 31, 2007 Hi, The non-english characters issue turned out to be an issue with tiles settings.See http://forum.java.sun.com/thread.jspa?threadID=539309&start=15. I am still haviving the problem with the single-quote being translated to ' Regards, Ashraf Link to comment Share on other sites More sharing options...
lucianc Posted July 31, 2007 Share Posted July 31, 2007 aeid wrote:I am still haviving the problem with the single-quote being translated to &apos This has been fixed in JR 1.3.2. Regards,Lucian Link to comment Share on other sites More sharing options...
aeid Posted August 1, 2007 Author Share Posted August 1, 2007 Hi Lucian, You are right.The problem is that when I use JR 1.3.4, I get this error during compilation:Code:[jasperReportCompile] net.sf.jasperreports.engine.design.JRValidationException: Report design not valid :[jasperReportCompile] 1. java.lang.ClassNotFoundException: com.speakesl.server.admin.web.esl.reports.ClassesOverallDashboardReportScriplets[jasperReportCompile] at net.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:260)[jasperReportCompile] at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:144)[jasperReportCompile] at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105)[jasperReportCompile] at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:128)[jasperReportCompile] at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:110)[jasperReportCompile] at net.sf.jasperreports.ant.JRAntCompileTask.compile(JRAntCompileTask.java:413)[jasperReportCompile] at net.sf.jasperreports.ant.JRAntCompileTask.execute(JRAntCompileTask.java:259)[jasperReportCompile] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)[jasperReportCompile] at org.apache.tools.ant.Task.perform(Task.java:364)[jasperReportCompile] at org.apache.tools.ant.Target.execute(Target.java:341)[jasperReportCompile] at org.apache.tools.ant.Target.performTasks(Target.java:369)[jasperReportCompile] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)[jasperReportCompile] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)[jasperReportCompile] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)[jasperReportCompile] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)[jasperReportCompile] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)[jasperReportCompile] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)[jasperReportCompile] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)BUILD FAILED However, if if I move back to JR 1.3.1, I do not get this error. Any ideas? Regards, Ashraf Link to comment Share on other sites More sharing options...
aeid Posted August 1, 2007 Author Share Posted August 1, 2007 I have figured out the issue.It looks that JR 1.3.4 is using CLASSPATH that needs to be set correctly to be able to see the scriplets. Thanks for your help. Regards, Ashraf 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