Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0015812Openbravo ERP09. Financial managementpublic2011-01-28 14:062011-04-05 04:44
maite 
egoitz 
urgentmajoralways
closedfixed 
5
3.0RC3 
3.0RC6 
Core
No
0015812: Error when visualizing Balance sheet and P&L structure report in Japanese
Error when visualizing Balance sheet and P&L structure report in Japanese.
Japanese characters are not properly handled and showed as #
1. Install Japanese translation
2. Follow http://wiki.openbravo.com/wiki/Balance_sheet_and_PL_structure [^] to configure reports
3. Execute report in PDF
No tags attached.
blocks backport 0016048 closed egoitz Error when visualizing Balance sheet and P&L structure report in Japanese 
Issue History
2011-01-28 14:06maiteNew Issue
2011-01-28 14:06maiteAssigned To => dalsasua
2011-01-28 14:06maiteModules => Core
2011-01-28 14:35skengakuIssue Monitored: skengaku
2011-02-24 16:30adrianromeroStatusnew => acknowledged
2011-02-24 16:30adrianromeroStatusacknowledged => scheduled
2011-02-24 16:30adrianromerofix_in_branch => pi
2011-02-24 16:31adrianromeroIssue cloned0016048
2011-02-24 16:31adrianromeroRelationship addedblocks 0016048
2011-02-28 10:09egoitzAssigned Todalsasua => egoitz
2011-02-28 10:09egoitzfix_in_branchpi =>
2011-03-08 12:59hgbotCheckin
2011-03-08 12:59hgbotNote Added: 0034655
2011-03-08 12:59hgbotStatusscheduled => resolved
2011-03-08 12:59hgbotResolutionopen => fixed
2011-03-08 12:59hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e713c25dd0542b9a0d49c4aa98fe3af43fcc9076 [^]
2011-03-08 13:02egoitzNote Added: 0034656
2011-03-08 13:09egoitzNote Added: 0034657
2011-03-08 16:40skengakuNote Added: 0034666
2011-03-10 12:17egoitzNote Added: 0034722
2011-03-22 12:17jonalegriaesarteNote Added: 0035142
2011-03-22 12:17jonalegriaesarteStatusresolved => closed
2011-03-22 12:17jonalegriaesarteFixed in Version => 3.0RC6
2011-03-23 00:00anonymoussf_bug_id0 => 3235747
2011-04-05 03:27skengakuNote Added: 0035576
2011-04-05 04:44skengakuNote Added: 0035577

Notes
(0034655)
hgbot   
2011-03-08 12:59   
Repository: erp/devel/pi
Changeset: e713c25dd0542b9a0d49c4aa98fe3af43fcc9076
Author: Egoitz Castillo <egoitz.castillo <at> openbravo.com>
Date: Tue Mar 08 12:57:35 2011 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/e713c25dd0542b9a0d49c4aa98fe3af43fcc9076 [^]

Fixed bug 15812. Error when visualizing Balance sheet in Japanese

---
M src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReportsPDF.fo
---
(0034656)
egoitz   
2011-03-08 13:02   
* How to test the issue
It is not a bug, but a configuration problem, so the only change done is to allow configuring the report properly.
A font-family has been defined for the whole document, because this fix only some fields had a font-family.

 *Other areas affected
It has only been modified a property on a fo file, no other areas are affected by this fix
(0034657)
egoitz   
2011-03-08 13:09   
How to configure the application to allow using Japanese in fo reports:

1- Get the needed fonts that include special characters for Japanse.
 It has been tested with: Ms Gothc, Ms PGothic, Ms UI Gothc and Ms Micho.

2- Convert the font file to xml using the same fop version that version used on Openbravo (fop 0.20.5) http://archive.apache.org/dist/xmlgraphics/fop/binaries/fop-0.20.5-bin.tar.gz [^]
To convert use the following order on the fop application downloaded:
For example to use MS UI Gothic font, after get the ttc file needed.

java -cp build/fop.jar:lib/avalon-framework-4.2.0.jar:lib/commons-logging-1.0.4.jar:lib/commons-io-1.3.1.jar:lib/xmlgraphics-commons-1.3.1.jar org.apache.fop.fonts.apps.TTFReader -ttcname "MS UI Gothic" /home/openbravo/fonts/msgothic.ttc /home/openbravo/fonts/msgothic.xml


3-Configure the config/userconfig.xml file to use this new font:

Add this new source, on configuration tag of the file:

<fonts>
<font metrics-file="/home/openbravo/fonts/msgothic.xml" embed-file="/home/openbravo/fonts/msgothic.ttc" kerning="yes">
<font-triplet name="Helvetica" style="normal" weight="normal"/>
<font-triplet name="Helvetica" style="normal" weight="bold"/>
<font-triplet name="Helvetica" style="italic" weight="normal"/>
<font-triplet name="Helvetica" style="italic" weight="bold"/>
<font-triplet name="Helvetica" weight="bold"/>
<font-triplet name="Helvetica"/>
</font>
</fonts>

4-Ejecute: ant smartbuild
5-Restart tomcat.

Now the report should be shown correctly on Japanese
(0034666)
skengaku   
2011-03-08 16:40   
Do you mean, OB ERP doesn't have font files of "Ms Gothc, Ms PGothic, Ms UI Gothc and Ms Micho."? Account names in Japanese are properly displayed on screens, html reports. Are you saying that these fonts are used by pdf report ONLY?

Also, how can ever get a font file? I have no ideas.
OB ERP does have font files for Japanese, can I simply enables those fonts tp pdf?
(0034722)
egoitz   
2011-03-10 12:17   
@skengaku

The Japnasese fonts on the htmls files are printed by the browser but not by openbravo, so Openbravo does not include this fonts, because they belong to other applications, so Openbravo can not deliver them.

Fop needs to have Japonese fonts to render the pdf, so it is needed to configure the config/userconfig.xml file to say wich fonts are to be used.

Regarding, where to get the files, Openbravo can not say where to get the fonts you need, because you have to know wich fonts do you want to use, so you will need to find the fonts you need
(0035142)
jonalegriaesarte   
2011-03-22 12:17   
Verified
(0035576)
skengaku   
2011-04-05 03:27   
This resolution hasn't worked, so far. I have used the font files:

1. msmincho.ttc
C:\Windows\winsxs\amd64_microsoft-windows-font-truetype-
msmincho_31bf3856ad364e35_6.1.7600.16385_none_be34642396bfadae

2. msgothic.ttc
C:\Windows\winsxs\amd64_microsoft-windows-font-truetype-
msgothic_31bf3856ad364e35_6.1.7600.16385_none_34a180b79866a79c

I cannot see any Japanese characters, so far. Where have you guys found the ttc files? Without some tips, I don't think I can find proper ttc files. It's been taking forever with OB Support, feels like I'm trapped in an endless loop.
(0035577)
skengaku   
2011-04-05 04:44   
Why OB couldn't just tell me that there were bunch of ttc files in C:\Windows\Fonts

This communication doesn't make any business sense, this has created a serious doubt about OB side willingness to help partners and customers.

Even though, the files still don't work.