You are on page 1of 6

12/6/2017 How to Display Leading Zeros in XMLP Report – Excel Output ~ OracleTechnology

OracleTechnology
         

Home Business Downloads Parent Category


  

Featured Health Uncategorized


How to Display Leading Zeros in


XMLP Report – Excel Output
  Le Hung      06:45      No comments   

Microsoft Excel has a tendency to display number format based


columns with no prefix of ZEROs. For example, if there is a
value ‘007’ excel displays it as ‘7’, excel display it as ‘007’ only if
the column is set in text format. You can see the difference in the
below screenshot

Please go through the below URL for an example to generate an


XMLP report:
http://oracleappsdna.com/2013/07/plsql-script-to-generate-xml-
tags-for-xmlp-report/

In the example mentioned in the above URL you could see the
output as shown in the below screenshot

http://oracleappsvn.blogspot.in/2016/11/how-to-display-leading-zeros-in-xmlp.html 1/6
12/6/2017 How to Display Leading Zeros in XMLP Report – Excel Output ~ OracleTechnology

But if you observe the data in the emp table, you could see three
rows have leading zeros for employee number( Please note, I
have updated the data of seeded emp table with prefix of 00 and
also changed the data type of empno column to varchar2(6) for
the sake of example.)

As the output is of excel type the empno column is considered


as Number column (as the entire column consists of number
format data) and the leading zeros are removed in display.

We have multiple ways to resolve this, I have listed them below.

Method 1

1. Open the RTF Template in MS Word.


2. Go to Data -> Load XML Data.
3. Once the data is loaded successfully, double click on that
field.
4. Under field properties window set the field formatting type
as “Regular Text” and set the check box “Force LTR”.

http://oracleappsvn.blogspot.in/2016/11/how-to-display-leading-zeros-in-xmlp.html 2/6
12/6/2017 How to Display Leading Zeros in XMLP Report – Excel Output ~ OracleTechnology

After following the above said steps, save the template and
preview the output which is as shown below

Method 2

Add Ctrl+Shift+Space after/before emplyee number on template


to create a non-breaking space. The non-breakable space
converts the number column to string column

Emp_RPT_shift+ctrl+sp
ace

Disadvantage of this method is that the non-breakable space is


visible in the output as well, you can see in the screenshot below

space in emp
number

Method 3

http://oracleappsvn.blogspot.in/2016/11/how-to-display-leading-zeros-in-xmlp.html 3/6
12/6/2017 How to Display Leading Zeros in XMLP Report – Excel Output ~ OracleTechnology

This is the best method I have found, In this method we need to


use an equal-to symbol before the field and enclose the field in
double quotes for example:- =”ENUM”

This works only in excel however it will allow you to cut and
paste (ie to use the value to search in Oracle) and also to do
vlookups.

Enum with equalto


and quotes

The theory is that excel will concatenate the values together


because it has quotes around it, it will treat it as a string rather
than simply a value.

For any other formats this method will not work.

You can see in the above screenshot that Enum column values
are turned to blue color as the content is explicit converted to
text format from number format.

Hope this article is useful for those who are in need to show
leading zeros for number columns in XMLP reports. If you have
any best solution, please leave a comment and share with the
readers.

Credits:- Thanks to my friend Kiran Reddy for helping me to get


this knowledge.

UPDATE: on 20-OCT-2015

Method 4

Here is another way to set format style ‘Force LTR’ in a


programmatic way to prevent Excel from suppressing leading
zeros:

http://oracleappsvn.blogspot.in/2016/11/how-to-display-leading-zeros-in-xmlp.html 4/6
12/6/2017 How to Display Leading Zeros in XMLP Report – Excel Output ~ OracleTechnology

<fo:bidi-override direction="ltr" unicode-bidi


<?XML_ELEMENT?>
</fo:bidi-override>

Share This:    Facebook  Twitter  Google+


 Stumble  Digg

Related Posts:

Query to list all Documents and their information


under a Payment Process Request
This query list all payment documents under a
payment batch with detailed invoice and
Supplier/Employee information. /***************************…
Read More

How to Display Leading Zeros in XMLP Report –


Excel Output
Microsoft Excel has a tendency to display number
format based columns with no pre x of ZEROs.
For example, if there is a value ‘007’ excel displays … Read More

R12 Customer Bank Accounts


- Banks and their Branches are now each stored as
Parties (HZ_PARTIES) in their own right. They are
linked together through
Relationships(HZ_RELATIONS… Read More

Join condition between RA_CUSTOMER_TRX_ALL


and OE_ORDER_HEADERS_ALL/LINES_ALL
Here is the query to nd link of Sales Orders with
their corresponding Invoices

http://oracleappsvn.blogspot.in/2016/11/how-to-display-leading-zeros-in-xmlp.html 5/6
12/6/2017 How to Display Leading Zeros in XMLP Report – Excel Output ~ OracleTechnology

/*************************************************************
**… Read More

What is MO_GLOBAL.INIT and When to Use


MO_GLOBAL.INIT?
Before reading this post, if you are new to Multi
Org and MOAC then read: MOAC – Oracle Apps
ORG_ID, Multi Org Concept What is MO_GLOBAL.INIT ? MO_…
Read More

Bài đăng Mới hơn Trang chủ Bài đăng Cũ hơn

0 nhận xét:

Đăng nhận xét

Nhập nhận xét của bạn...

Nhận xét với tên: Mani (Google) Đăng xuất

X ất bả X t ớ Thô bá h tôi

Search Search

Popular Posts

Join condition between RA_CUSTOMER_TRX_ALL and


OE_ORDER_HEADERS_ALL/LINES_ALL
Here is the query to nd link of Sales Orders with their
corresponding Invoices
http://oracleappsvn.blogspot.in/2016/11/how-to-display-leading-zeros-in-xmlp.html 6/6

You might also like