on 12-14-2007 7:06 AM
Dear All
I want to show the Predefined WordDocuemnt from the Webdynpro UI(Any) element.
I have Written following coding in the init method
*******************************************************
try
{
IWDAttributeInfo attributeInfo =wdContext.getNodeInfo().getAttribute(IPrivatePopUpView.IContextElement.ATTR_CONTENT);
IWDModifiableBinaryType binaryType =(IWDModifiableBinaryType) attributeInfo.getModifiableSimpleType();
String resourcePath = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(),PopUpView.FILE_NAME);
wdContext.currentContextElement().setAttrContent(this.getByteArrayFromResourcePath(resourcePath));
binaryType.setFileName(PopUpView.FILE_NAME);
binaryType.setMimeType(WDWebResourceType.DOC);
}
catch (Exception e)
{
throw new WDRuntimeException(e);
}
and in the Method
*********************
private byte[] getByteArrayFromResourcePath(String resourcePath)
throws FileNotFoundException, IOException {
FileInputStream in = new FileInputStream(new File(resourcePath));
ByteArrayOutputStream out = new ByteArrayOutputStream();
int length;
byte[] part = new byte[10 * 1024];
while ((length = in.read(part)) != -1) {
out.write(part, 0, length);
}
in.close();
return out.toByteArray();
}
private static final String FILE_NAME = "Example.doc";
Instead of the MSWord document I have a wonderfull blue component where it is written "I am the PlaceHolder control".
How to call the WordDocument from the Webdynpro using OfficeControl in NWDS2004
thanks in advance
J Dhinakaran
Message was edited by:
Dhinakaran Jeyachandran
Message was edited by:
Dhinakaran Jeyachandran
Message was edited by:
Dhinakaran Jeyachandran
Hi,
These blogs by Anilkumar would be helpful for you.
/people/anilkumar.vippagunta2/blog/2007/02/01/office-control-in-webdynpro--i
/people/anilkumar.vippagunta2/blog/2007/02/01/office-control-in-webdynpro--i
Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.