<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.infinite-erp.co.id/index.php?action=history&amp;feed=atom&amp;title=How_to_Change_Fonts_in_Openbravo_Reports</id>
	<title>How to Change Fonts in Openbravo Reports - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.infinite-erp.co.id/index.php?action=history&amp;feed=atom&amp;title=How_to_Change_Fonts_in_Openbravo_Reports"/>
	<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_to_Change_Fonts_in_Openbravo_Reports&amp;action=history"/>
	<updated>2026-04-06T20:05:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.infinite-erp.co.id/index.php?title=How_to_Change_Fonts_in_Openbravo_Reports&amp;diff=2750&amp;oldid=prev</id>
		<title>Wikiadmin: Created page with &quot;{{RatingArticle}} {{Languages | Documentation_Style_Guide}} == Objective == The objective of this article is to show you how to change the fonts used in '''Openbravo Reports''...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_to_Change_Fonts_in_Openbravo_Reports&amp;diff=2750&amp;oldid=prev"/>
		<updated>2021-12-16T02:23:26Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{RatingArticle}} {{Languages | Documentation_Style_Guide}} == Objective == The objective of this article is to show you how to change the fonts used in &amp;#039;&amp;#039;&amp;#039;Openbravo Reports&amp;#039;&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{RatingArticle}}&lt;br /&gt;
{{Languages | Documentation_Style_Guide}}&lt;br /&gt;
== Objective ==&lt;br /&gt;
The objective of this article is to show you how to change the fonts used in '''Openbravo Reports'''. This can be useful in two cases:&lt;br /&gt;
&lt;br /&gt;
* We want to create our reports with a prettier or more readable appearance&lt;br /&gt;
* Some character sets like Japanese, Arabic or Vietnamese cannot be be displayed or printed out with the fonts used by default in the standard reports, so replacing the default font for one&amp;lt;br&amp;gt;that supports those character sets is the solution to properly display the reports in those languages.&lt;br /&gt;
&lt;br /&gt;
== Recommended articles ==&lt;br /&gt;
Before reading this guide, it is necessary to have a proper understanding of Openbravo's [[Modularity]] concept and how to [[How_To_Create_and_Package_a_Module | create and package a module]],&amp;lt;br&amp;gt;as we take the knowledge from these articles as a given in this guide.&lt;br /&gt;
&lt;br /&gt;
In case you are working with reports on a regular basis, the following link to an article might be of interest to you, since it describes [[How_to_create_a_Report | how to create a report]].&lt;br /&gt;
&lt;br /&gt;
== Execution Steps ==&lt;br /&gt;
Openbravo uses two different tools to create reports:&lt;br /&gt;
* '''Jasper Reports'''&lt;br /&gt;
* '''FOP'''&lt;br /&gt;
&lt;br /&gt;
With this, we need a different approach for each tool to change the font of the reports being generated by them. Both approaches will of course be explained here:&lt;br /&gt;
&lt;br /&gt;
===Changing the font in Jasper Reports===&lt;br /&gt;
When changing the font in '''Jasper Reports''', the software '''[http://community.jaspersoft.com/project/jaspersoft-studio/releases Jaspersoft Studio]''' will be very helpful. &lt;br /&gt;
&lt;br /&gt;
In the following [http://community.jaspersoft.com/wiki/custom-font-font-extension link] you can find a detailed tutorial that describes how to handle custom fonts in Jaspersoft Studio. In short, these are the steps we need to carry out:&lt;br /&gt;
* 1. Get the desired font's .ttf file from your pc or from the Internet.&lt;br /&gt;
* 2. Create the Font Extension, go to '''Window &amp;gt; Preferences'''&lt;br /&gt;
[[Image:JasperStudioFonts.png|thumbnail|center|150px|View larger]]&lt;br /&gt;
* 3. Click on '''JasperSoft Studio &amp;gt; Fonts'''. Click '''Add'''. At this point you must provide a unique name for the Font Extension and the path to its extension by selecting the path of the downloaded .ttf file.&lt;br /&gt;
* 4. Once done, we set a PDF Encoding type for our new font in the wizard.&lt;br /&gt;
* 5. We now have to change the fontName and pdfFontName used in the text fields we want to have being displayed with the new font in our report. We can accomplish that by either using Jaspersoft Studio or making changes directly in the .jrxml file using a text editor. &lt;br /&gt;
* 6. And, for our document(s), we shouldn't forget to to choose the same PDF Encoding type as the one we set for our font in step 4.&lt;br /&gt;
* 7. Export the font into a .jar file. Once again, Jaspersoft Studio can lend us a hand with doing this: Go to '''JasperSoft Studio &amp;gt; Fonts''' and this time click '''Export'''. Select the font and export it into a .jar file.&lt;br /&gt;
* 8. We have to create a new module to keep the .jar file. Inside our module folder we must create a subfolder '''&amp;quot;/lib/runtime&amp;quot;''' and put the exported .jar file in there.&lt;br /&gt;
[[Image:folders.png|thumbnail|center|150px|View larger]]&lt;br /&gt;
* 9. Stop tomcat&lt;br /&gt;
* 10. Execute: &amp;lt;pre&amp;gt;ant smartbuild&amp;lt;/pre&amp;gt;&lt;br /&gt;
* 11. Restart tomcat&lt;br /&gt;
&lt;br /&gt;
===Changing the font in FOP Reports===&lt;br /&gt;
Not every report in Openbravo is designed as a .jrxml report. For example, the [[Price_List_Report | Price List Report]] is generated using '''[http://xmlgraphics.apache.org/fop/ FOP]'''. The approach to change the font in this kind of reports is different; we don't need to change the report definition but make use of the '''FOP configuration file'''. These are the steps we must follow:&lt;br /&gt;
&lt;br /&gt;
# Get the desired font's .ttf file from your system or download it from the Internet. For example: ''DejaVuSans.ttf'' &lt;br /&gt;
&amp;lt;ol start = &amp;quot;2&amp;quot;&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
The ''.fo reports'' used in Openbravo use the ''Helvetica'' font by default. To replace this font with the new one, we will modify the '''config/userconfig.xml ''' file as explained [https://xmlgraphics.apache.org/fop/1.0/fonts.html#register here]. So, we just add this new xml source snippet inside the '''&amp;lt;configuration&amp;gt;''' tags of the '''userconfig.xml''' file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang =&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;fonts&amp;gt;&lt;br /&gt;
&amp;lt;renderers&amp;gt;&lt;br /&gt;
  &amp;lt;renderer mime=&amp;quot;application/pdf&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;fonts&amp;gt;&lt;br /&gt;
     &amp;lt;font embed-url=&amp;quot;/home/openbravo/DejaVuSans.ttf&amp;quot; kerning=&amp;quot;yes&amp;quot;&amp;gt; &lt;br /&gt;
       &amp;lt;font-triplet name=&amp;quot;Helvetica&amp;quot; style=&amp;quot;normal&amp;quot; weight=&amp;quot;normal&amp;quot;/&amp;gt; &lt;br /&gt;
       &amp;lt;font-triplet name=&amp;quot;Helvetica&amp;quot; style=&amp;quot;normal&amp;quot; weight=&amp;quot;bold&amp;quot;/&amp;gt; &lt;br /&gt;
       &amp;lt;font-triplet name=&amp;quot;Helvetica&amp;quot; style=&amp;quot;italic&amp;quot; weight=&amp;quot;normal&amp;quot;/&amp;gt; &lt;br /&gt;
       &amp;lt;font-triplet name=&amp;quot;Helvetica&amp;quot; style=&amp;quot;italic&amp;quot; weight=&amp;quot;bold&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/font&amp;gt; &lt;br /&gt;
    &amp;lt;/fonts&amp;gt;&lt;br /&gt;
  &amp;lt;/renderer&amp;gt;&lt;br /&gt;
&amp;lt;/renderers&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that in this case we have our font placed in the path: ''/home/openbravo''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Execute: &amp;lt;pre&amp;gt;ant smartbuild&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart tomcat&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this change, all '''.fo reports''' in the application will use the ''DejaVuSans'' font instead of ''Helvetica''.&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
Following screenshots show the results after successfully carrying out the steps mentioned above:&lt;br /&gt;
&lt;br /&gt;
{|width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
First, we have a '''Jasper Report''', where the font of the title has been replaced with another font:&lt;br /&gt;
 &lt;br /&gt;
||[[Image:customReport.png|thumbnail|right|150px|View larger]]||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
And last, we have a '''FOP Report''' with the default font replaced:&lt;br /&gt;
 &lt;br /&gt;
||[[Image:customBalanceSheet.png|thumbnail|right|150px|View larger]]||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Wikiadmin</name></author>
		
	</entry>
</feed>