Friday, 29 November 2013

How to Implement Bar Code in XML Publisher Report

Bar Code Local Setup:

1) Copy Barcode font in C:\Windows\Fonts directory.
2) Copy xdo.cfg in C:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\config directory. The sample file is already available when BI Publisher desktop is installed.
3) Right click the font file and go to properties. Copy the .ttf file name. Double click the font file to get the family name.
4) Open the xdo.cfg file and paste as follows (My filename is w39elc.ttf and font family is WASP 39 ELC)
<font family="WASP 39 ELC" style="normal" weight="normal">  <truetype path="C:\WINDOWS\Fonts\w39elc.ttf" /> </font>
Bar Code Application Setup:
Basically this post refers to any font that you want to embed into you output but I was working specifically on demand to insert the barcode.
So start with something simple. Obtain the font file. In my case I posses “WASP 39 ELC" font. Font file name is w39elc.ttf. Install the font into Windows by double clicking on it and choosing “install”
Open your RTF template and place the bar code in the location you want.

So far so good and if you run this template locally on your workstation you will see the bar code. But not in EBS.
  This is what you need to do in order to make it work in EBS
Open “XML Publisher Administrator” responsibility
Go to “Administration”-> “Font Files”

Click on “Create Font File”

In “Font Name” put the name of the font as it appears in Word. Choose the font file and click “Apply”

Go to “Administrator”-> “Font Mapping”
image
Click on “Create Font Mapping Set”

Put into “Mapping Name” – Bar Code Fonts, into “Mapping Code” – BAR_CODE_FONTS, into “Type” –FO To PDF and click “Apply”

Click on the Bar Code Fonts link

Click on “Create Font Mapping”

Define Font Mapping as appears in the print screen bellow and click “Continue”

Ok, now you need  template to “know” the bar code font we just created.

Open template definition and go to “Edit Configuration”
Expand “FO Processing” and put into “Font Mapping Set” – Bar Code Fonts and click “Apply”.

Now you can run your template and it will display the bar code properly.

No comments:

Post a Comment