ก็คือเรื่องการแสดงผลภาษาไทยบน Oracle Reports แบบ PDF
วันนี้ผมจะสรุปวิธีการ ขั้นตอน และการแก้ปัญหาให้ครับ
แต่สำหรับตอนนี้ ผมจะให้วิธีการของ Windows Platform ก่อนครับ
ขั้นตอนน้อยกว่าและง่ายกว่าการทำบนตระกูล UNIX
และที่สำคัญ มีเพื่อนร่วมงานผม ที่อยู่ต่างบริษัทกัน กำลังจำเป็นต้องใช้แก้ปัญหานี้บน Windows ครับ
1. ผมจะถือว่าขั้นตอนการติดตั้ง Oracle Application Server เสร็จสมบูรณ์แล้ว และไม่มีปัญหาใด ๆ

2. เพิ่มตัวแปร NLS_LANG เข้าไปในระบบครับ
ผมจะใช้วิธีเพิ่มที่ System Variable ครับ เพราะว่าวิธีนี้จะดีกว่าการเพิ่มใน regedit ครับ เพราะทำที่เดียว ครั้งเดียว
2.1 ไปที่ System Properties ครับ

2.2 ไปที่ Environment Variables

2.3 เพิ่ม System variables เพิ่ม New ครับ
2.4 ใส่ตัวแปร
Variable Name: NLS_LANG
Variable Value: AMERICAN_AMERICA.TH8TISASCII

หมายเหต: ควรตั้งค่า Variable Value ให้ตรงกับ database character set
และค่า NLS_LANG ของเครื่องที่สร้าง file .rdf

3. แก้ไข file uifont.ali
3.1 ไปที่ folder ORACLE_HOME\tools\common จะเจอ file uifont.ali
3.2 เปิด file นี้ หาย่อหน้าที่ว่า
[ PDF:Subset ] #
This example shows how to subset Arial True Type font into the PDF file # Arial = "Arial.ttf" # The True Type font files must exist in any one of the folders specified in # REPORTS_PATH.
3.3 เพิ่ม fonts ที่ต้องการใช้ลงไป ตัวอย่าง
AngsanaUPC = "ANGSAU.ttf"
CordiaUPC = "CORDIAU.ttf"
"Angsana New" = "ANGSA.ttf"
"Cordia New" = "CORDIA.ttf"

3.4 copy fonts ที่ได้ระบุในข้อ 3.3 ลงไปใน folder ORACLE_HOME\reports\samples\demo
4. Restart Oracle Services ที่เกี่ยวข้อง
5. สำเร็จครับ

ส่วนการแก้ปัญหานี้บน UNIX ไว้จะเอามาลงใน blog อีกทีครับ
No comments:
Post a Comment