cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in Office Control

Former Member
0 Kudos

Hi all,

I am trying to work with office control. I had created a value node called "DocumentSourceNode".

created a supply function with the name fillNode.. Under fillNode i wrote the following code.

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

ModifiableBinaryType bin = (ModifiableBinaryType)mod;

bin.setMimeType(new WebResourceType("doc", "application/msword", false));

IPrivateOfficeView.IDocumentSourceNodeElement element = wdContext.nodeDocumentSourceNode().createDocumentSourceNodeElement();

node.addElement(element);

String filename = "";

try

{

filename = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), "example.doc");

byte[] bytes = getBytesFromFile(new File(filename));

element.setDocumentContent(bytes);

}

catch (WDAliasResolvingException e)

{

throw new WDRuntimeException("No datasource available: " + filename);

}

catch (IOException e) {

//handle exception

}

when i am executing, i am getting this exception....

catch (WDAliasResolvingException e)

{

throw new WDRuntimeException("No datasource available: " + filename);

}

I had stored a msword document say example under mime/applications/com.sap..../example... am i stored the document in a right area? Please help me....

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member194668
Active Participant
0 Kudos

try to place the file in

src/mimes/components/..../

-Aarthi

Former Member
0 Kudos

Thanks for ur reply.. ya i had placed it there only

Former Member
0 Kudos

sorry i mistakenly said.. Now i was able to see the page but when i am clicking the show button, i am getting this error

" com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: can not invoke methods on non ACF UI-elements "...

former_member194668
Active Participant
0 Kudos

Try this...

WDURLGenerator.getWebResourceURL(wdComponentAPI.getDeployableObjectPart(), "example.doc")

Former Member
0 Kudos

Hi aarthi,

Thanks for ur suggestion. Since i got error in my catch block i added this lines in the catch block

catch (WDURLException e)

{

throw new WDRuntimeException("No datasource available: " + filename);

}

So i m getting this error,

com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: No datasource available

Former Member
0 Kudos

Hi,

Help me to solve this problem..............