Skip to Content

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

Sending Output to MS word

Hello all

I am planning to write a program that send the out put displayed on webdynpro view to a MS word document.So I request you if you have any plans to solve my problems or any helpfull URLs. Thank you for your time in advance

Regards

Maruti

replied

hi maruti try this It will solve your prob.

create a single view with Text area,a button and a LinkTOUrl UI element. Write the following code on click of button. and set the refrence property of LinktoUrl equals to Url.

Note : Here Doc and Url are the value attribute of string type.

public void onActionConvert(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActionConvert(ServerEvent)
		final String formattedStr = wdContext.currentContextElement().getDoc();
		try
		{
final IWDCachedWebResource resource = WDWebResource.getWebResource
			(
	formattedStr.getBytes("UTF-8"), WDWebResourceType.DOC
			);
			resource.setResourceName("WordDoc.doc");
		
    
			wdContext.currentContextElement().setUrl( resource.getAbsoluteURL() );

		}
		catch (final Exception ex)
		{
			wdComponentAPI.getMessageManager().reportException( new WDNonFatalException(ex), false );
		}
    //@@end
  }

Regards

Jitender

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