cancel
Showing results for 
Search instead for 
Did you mean: 

How to Display the Headers in Particular order in Excel File

Former Member
0 Kudos

[http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/wd%20java/wdjava%20archive/exporting%20context%20data%20into%20excel%20using%20the%20web%20dynpro%20binary%20cache.pdf]

Hi Friend,

By using this Link I have done download data in Excel File. Now it is working data is downloaded in to Excel File.

But here I am getting Some Problem.

In when download the data that Header Text will display in different order. I need what alien in table Header. That Header format will display in Excel also

For Exampls

In Table: PO Number, Po Line Item ,Vendaor Material, Materila Like this

When Download data in Excel First will Shows in Excel Vendor Materila, Confirm Ship Date, Po Number Like This I need to Display First PO Number

By Using This I will write this Code.

private void trimHeaderTexts(Map columnInfos) {

String attributeName, trimmedHeaderText;

for (Iterator iter = columnInfos.keySet().iterator(); iter.hasNext();) {

attributeName = (String) iter.next();

trimmedHeaderText = trimHeaderText((String) columnInfos.get(attributeName));

columnInfos.put(attributeName, trimmedHeaderText);

Here I iterator Shows returns elements in no Particular order.

I need to display Particular order.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Vijay,

private void trimHeaderTexts(Map columnInfos)

is for removing the empty spaces between the words in a single header(s).

Now tell me the below Qs:

1. What you've implemented in the below method:

private Map getProductColumnInfos()

2. How many Attributes you've defined in your Node (ex: ProductsNode)

Your excel will display in the order that you've coded in the getProductColumnInfos() method, so first thing is to re-order to the order you want to display in the excel sheet. And you will see the output excel as you want.

Hope it solves your query,

Thanks, MS.

Answers (1)

Answers (1)

p330068
Active Contributor
0 Kudos

Hi Vijay,

If you want to customize the downloaded excel file then you can use JXL API for making more intreactive.

Please check the JXL API ....

Hope it helps

Regards

Arun