on 09-22-2008 6:54 PM
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....
try to place the file in
src/mimes/components/..../
-Aarthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.