Skip to Content
avatar image
Former Member

WebDynpor: OfficeControl Example, I cannot see the file...

Hi together,

I've tried the SAP example to call a MSOffice Document.

I've done the coding an implementation how it is shown in the sap example (

I've tried this two months ago and it works correctly.

Now I've tried it again and nothing happens. I've tried to call inplace and explace. No result....

My MSExplorer allows to call ActiveX - Components.

Could anybody help me.

I just want to show an Excel-File in my WebDynpro-Project.

Thank you so much.

Greetings Sascha

10 points for the solution.

😔 ... 200 pulse .... 😔

public void fillNode(IPrivateTestViewOfficeControl.IDocumentSourceNodeNode node, IPrivateTestViewOfficeControl.IContextElement parentElement)


//@@begin fillNode(IWDNode,IWDNodeElement)

ISimpleTypeModifiable mod = node.getNodeInfo().getAttribute("DocumentContent").getModifiableSimpleType();

ModifiableBinaryType bin = (ModifiableBinaryType)mod;

bin.setMimeType(new WebResourceType("xls", "application/msexcel", false));

// bin.setMimeType(WebResourceType.XLS);

// bin.setMimeType(new WebResourceType("xls", "application/ms-excel", false));

// bin.setMimeType(new WebResourceType("xls", "application/msexcel", false));

// bin.setMimeType(new WebResourceType("html", "text/html", false));

IPrivateTestViewOfficeControl.IDocumentSourceNodeElement element = node.createDocumentSourceNodeElement();




byte[] bytes = getBytesFromFile(new File("C:



catch (IOException e)


// do something




public void onActiongetDocument( wdEvent )


//@@begin onActiongetDocument(ServerEvent)




//@@begin others

public static byte[] getBytesFromFile(File file)

throws IOException


FileInputStream is = new FileInputStream(file);

long length = file.length();

byte[] bytes = new byte[(int)length];

long bytesRead =;

if (bytesRead < length)


throw new IOException("Could not completely read file "+file.getName());



return bytes;



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jun 02, 2005 at 02:02 PM

    Hi Sascha,

    Which version of Web AS are you testing this example on?


    Add comment
    10|10000 characters needed characters exceeded