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

Strange behaviour when export to HTML


aeid

Recommended Posts

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

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...