cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting web Dynpro content into ms-word

Former Member
0 Kudos

Hi Experts,

Any one can tell me how to export web Dynpro content (like tables and data etc) into ms-word document.

Any help is greatly appreciated and rewarded.

Regards,

Jay

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

it got resolved thanks for ur all help.

Former Member
0 Kudos

Hi Varma,

you can follow the thred,

[http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/edc2f3c2-0401-0010-8898-acd5b6a94353]

In this pdf this code is avaliable. please chek it this code

public void Download_Reporting( com.sap.tc.webdynpro.progmodel.api.IWDNode dataNode, java.util.Map columnInfos )

{

//@@begin Download_Reporting()

byte[] excelXMLFile;

IWDCachedWebResource cachedExcelResource = null;

String fileName = dataNode.getNodeInfo().getName() + ".xls";

try {

// create Excel 2003 XML data as a byte array for the given context node,

// attributes and headers

excelXMLFile = toExcel(dataNode, columnInfos).getBytes("UTF-8");

// create a cached Web Dynpro XLS resource for the given byte array

// and filename

cachedExcelResource = getCachedWebResource(excelXMLFile, fileName, WDWebResourceType.XLS);

// Store URL and file name of cached Excel resource in context.

if (cachedExcelResource != null) {

wdContext.currentContextElement().setExcelFileURL(

cachedExcelResource.getURL());

wdContext.currentContextElement().setExcelFileName(

cachedExcelResource.getResourceName());

// Open popup window with a link to the cached Excel file Web resource.

openExcelLinkPopup();

} else {

wdComponentAPI.getMessageManager().reportException(

"Failed to create Excel file from table!", true);

}

} catch (UnsupportedEncodingException e) {

wdComponentAPI.getMessageManager().reportException(

e.getLocalizedMessage(), true);

} catch (WDURLException e) {

wdComponentAPI.getMessageManager().reportException(

e.getLocalizedMessage(), true);

}

//@@end

}

Here please check it this line cachedExcelResource = getCachedWebResource(excelXMLFile, fileName, WDWebResourceType.XLS);

here you can u put like this cachedExcelResource = getCachedWebResource(excelXMLFile, fileName, WDWebResourceType.DOC);

Here different Options is avaliable please find it

Hope it is help full for u

Regards

Vijay kalluri

Former Member
0 Kudos

Hi Varma,

1. first you have to import jxl.jar file into lib folder

Look at the threads

[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0cc41cb-9576-2b10-99a6-ab90ef28c73b]

[http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3596] [original link is broken] [original link is broken] [original link is broken];

[http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4591] [original link is broken] [original link is broken] [original link is broken];

Regards

Vijay Kalluri

Former Member
0 Kudos

Hi Sarvanan/Vijay,

Thanks for ur help.

The thing is I know that how to Export tables and data into Excel sheet, but my question is how can we export data or any information in msword document, how can we achieve it?

Former Member
0 Kudos

Hi,

Pl have a look at this thread,

- Saravanan K