JasperReports 10 JasperReports is a pure Java library and not a standalone application. It cannot run on its own, hence it needs to be embedded into another client or server-side Java application. The report is a file in a PDF, HTML, RTF, XLS, ODT, CSV, or XML format. JasperReports uses a template to define a document structure. The template is defined either in an XML file or created with the programming API.
PROCEDURE
Procedure for NuGenesis 9 LMS
- In JasperSoft Studio, click Window > Preferences. In the Preferences window, click JasperSoft Studio > Fonts
- The list of fonts available to JasperSoft appears. If the necessary font is not in the list, click the Add button
- Enter a name for the new font. This name will appear in the Studio client when working with text as one of the selectable fonts
- Use the browse buttons to find the TrueType Font (ttf) files for the normal, bold, italic, and bold-italic fonts
- Select 'Identity-H (Unicode with horizontal writing)' for the PDF Encoding. If a non-Unicode character encoding is chosen, characters outside that encoding will not be visible in PDF reports. For example, with the CP1252 encoding, only characters in the extended Latin alphabet are supported; letters in the Greek or Cyrillic alphabets will not work
- Click the Finish button to add this font to JasperSoft Studio
- Select the font or fonts to export and click the Export button
- In the new dialog box, select a location for the export file; specify a name for the file; and select the file type *.jar
- Copy the JAR file to the LMS server:
- Drive:WatersLMSServerWildfly-11.0.0.Finalmodulessystemlayersbasewaterslmsreportsmain
- Open the following file in Notepad:
- Drive:WatersLMSServerWildfly-11.0.0.Finalmodulessystemlayersbasewaterslmsreportsmainmodule.xml
- Add a new line below '<!--Jasper Reports -->', where FontFileName.jar is the name of the .JAR file created in step 8:
- <resource-root path='FontFileName.jar'/>
- Save and close module.xml
- Restart the 'NuGenesis LMS Server' service.
Procedure for NuGenesis 8 LMS
- Follow the directions above for NuGenesis 9 to create the fonts file.
- Copy the JAR file to the LMS server:
- Drive:WatersLMSServerJboss-6.0.0.Finalserverelnlib
- Restart the 'NuGenesis LMS Server' service.
Procedure for NuGenesis 8 ELN
- In the iReports client, go to Tools > Options. Click the Fonts tab under the 'iReport' category.
- The fonts available to iReports are listed in the Fonts box. If the fonts are not listed, click the Install Font button.
- In the Font Installation box, browse to the TTF file for the font and click Next.
- Jasper reads the Font Name from the TTF file and displays it in the 'Family Name' box.
- If necessary, browse to the separate TTF files for the Bold, Italic, and Bold-Italic variants of the font.
- Select 'Identity-H (Unicode with horizontal writing)' for the PDF Encoding. If a non-Unicode character encoding is chosen, characters outside that encoding will not be visible in PDF reports. For example, with the CP1252 encoding, only characters in the extended Latin alphabet are supported; letters in the Greek or Cyrillic alphabets will not work.
- Click the Finish button to add this font to iReports.
- Select the font or fonts to export and click the 'Export as extension' button.
- In the new dialog box, select a location for the export file; specify a name for the file; and select the file type *.jar.
- Copy the JAR file to the ELN server:
- Drive:WatersELNServerJboss-6.0.0.Finalserverelnlib
- Restart the 'NuGenesis ELN Server' service.
Toolbox
Main PageUpload file
What links here
Recent changes
Help
PDF Books
Show collection (0 pages)Collections help
Search
Participate
CommunicateReport a bug
Contribute
Talk to us now!
|
Introduction
Currently in Jasper Reports 2.40 the font being used does not support Unicode characters. This document outlines how this will be replaced.
The current fonts in use in the Jasper Reports in Openbravo ERP include:
- Bitstream Vera Sans
- Helvetica
- Times-Roman
- Helvetica-Bold
Overview
The scope of this specification does require further clarification to ensure that it meets the required outcomes. Some questions relating to this can be found in the discussion section at the bottom of the page.

In order to fulfill this specification it is important to clarify and understand the impact of terms like font, encoding, unicode, and how they work within the Jasper framework.
Scope
Ubiquitous Language
- Encoding - character encoding. All encoding in Openbravo ERP should be Unicode.
- Font - A specification for a style of calligraphy e.g. Helvetica Italic, Courier Bold.
- PDF - Portable Document Format - the default in most Windows systems is to Use Adobe Acrobat to read these files.
- FontFamily - e.g. Arial, Helvetica.
- FontStyle - e.g. Bold, Italic.
Technical Implementation
The issue with displaying non western characters inside of Jasper reports and iReports is to do with encoding and ensuring that the font and encoding are compatible. Jasper Reports uses iText for creation of PDF documents, further information on this can be found in the link in the references section below.
While it is nice to ensure that the solution is complete and covers all possible languages this is not realistically going to be possible. The solution should be to find the simplest solution for configuring each installation.
In line with this the solution being proposed is to define the output font and encoding in a language specific format. This can be integrated into the language-country implementation within the application and as such bears a direct relationship with the translation process. This process proposes including font characteristics in the language object that would cover:
- Font name
- encoding
- pdf font
- pdf encoding
- pdf embedded font
To ensure that this work is functioning there is a test jrxml file available that includes various languages that can be used to check the rendering of non western characters.
Language
The language object for a translation will include font objects. This relationship is outline in the diagram below.
A specific font object will be set as the default and this will be used for the rendering of Jasper reports with Openbravo ERP, if there is no default value set then the application will use the default font for the entire application. The attributes within the font object can then be passed through to the relevant report object being created to set the encoding and font required for rendering that language.
iReports
Inside the iReports tool there is a setting that allows the user to set the encoding and font for PDF rendering. This should be set to a unicode compliant encoding setting (settings contained here are Java naming conventions) and the font should be capable of displaying non western characters.
PDF Font Handling
Within Jasper Reports there is a specific method to define the font and encoding to be used in a PDF document produced from the application. There is also a third attribute that can be defined which embeds the font in the pdf document thereby not requiring the view to have the font enabled within their system. This seems a far more reliable option when it comes to correctly rendering the correct text.
There is a clear benefit to embedding the font in the document as it will ensure the document renders properly irrespective of whether the viewer has the font installed or not, the overhead to embedding the font is not significant enough to outweigh the benefit. Drivers acer a1-ao756-84xkk.
Jasper Reports Font definition
- Reference: Jasper Reports - Quick Reference document - Font Definition (References 1)
font
Defines the font to use with the text element.
CONTAINS EMPTY
ATTRIBUTES'
- reportFont
- Name of the report level font to use as base font (see <reportFont> element).
- fontName
Pdf File Encoding
- size
- Size of the font.
- isBold
- true/false
- isItalic
- true/false
- isUnderline
- true/false
- isStrikeThrough
- true/false
- pdfFontName
- Name of the PDF font.
- pdfEncoding
- Encoding type to use with the PDF font.
- isPdfEmbedded
- Specifies if the PDF font should be embedded in the document.
- true/false
HTTPSecureAppServlet - renderJR method
The above settings will be implemented within the renderJR() method in the org.openbravo.base.secureapp.HttpSecureAppServlet class. Acer h243h driver. This should be implemented in a separate private method that is called should the language include font attributes, if attributes are not available then the application will use the attributes defined in the jasper report.
Appendices
Jasper Report Pdf Encoding Pdf
Appendix A. UML Diagrams
Appendix B. Test Cases
The following code is a test jrxml file that can be used to display non western characters.
References
- Jasper Reports quick reference - Font definition - http://jasperreports.sourceforge.net/quick.reference.html#font
- Jasper Reports quick reference - ReportFont definition - http://jasperreports.sourceforge.net/quick.reference.html#reportFont
- Unicode.org FAQ - http://www.unicode.org/faq/
- Jasper Forum post - http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=1003
- Lowagie tutorial on iText and font usage - http://itextdocs.lowagie.com/tutorial/fonts/index.php
Pdf Encoding Text
Discussion Items
What is the scope of this project?
Is the objective to cover producing output documents from Openbravo ERP that are readable in all languages including non-western languages? Should this be out-of-the-box implementation or a configuration task?Does it only cover how to implement non western characters in the iReport tool?
Jasper Report Pdf Encoding Document
Retrieved from 'http://wiki.openbravo.com/wiki/Projects:Unicode_Fonts_in_iReports/Technical_Specification'
Jasper Report Pdf Encoding Document
This page has been accessed 38,879 times. This page was last modified on 8 June 2012, at 05:31. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.
Jasperreports Pdf Encoding
