Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Issue of export to excel

Hi All

I got a requirement where i have to export the table to the excel 2003 i had done that. but not getting order of the fields as per the table, using the the following code

<i>for (int i = 0; i < dataNode.size(); ++i) {

IWDNodeElement dataNodeElement = dataNode.getElementAt(i);

x.append("<").append(entryName).append(">\n");

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

attributeName = (String) iter.next();

headerName = (String) columnInfos.get(attributeName);

x

.append("<")

.append(headerName)

.append(">")

.append(dataNodeElement.getAttributeValue(attributeName))

.append("</")

.append(headerName)

.append(">\n");

}</i>

can any one give me a clue how to get the same order as in table or as iam passing to the excel from webdynpro code..

Thanks & Regards

Ashwin

Former Member
Former Member replied

Hey,

This is the simple instead of mar parameter u can chage the LinkedHashMap.

Then you can get the same order and u need to give the order when u give your value attributes at your method in TableApp.

wdthis.wdGetAPPInterface.ExpoertExcel(wdcontext.node<name>(),getValues());

the Imple of this method

private LinkedHashMap getValues()

{

// you can give ur value attrbute what ever order do u need.

return LikedhshMap;

}

Any probs post ur issues.

Thanks,

Lohi.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question