cancel
Showing results for 
Search instead for 
Did you mean: 

Sending Output to MS word

Former Member
0 Kudos
88

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

View Entire Topic
former_member205624
Contributor
0 Kudos

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