on 06-02-2005 1:56 PM
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 (http://help.sap.com/saphelp_nw04/helpdata/en/ef/3483789514b748b6fe1f145e9685ab/frameset.htm)
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();
node.addElement(element);
try
{
byte[] bytes = getBytesFromFile(new File("C:
temp
besuchsbericht_template.xls"));
element.setDocumentContent(bytes);
}
catch (IOException e)
{
// do something
}
//@@end
}
public void onActiongetDocument(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActiongetDocument(ServerEvent)
WDOfficeControlMethods.showDocument(this.wdThis.wdGetAPI(),"OfficeControl1");
//@@end
}
//@@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 = is.read(bytes);
if (bytesRead < length)
{
throw new IOException("Could not completely read file "+file.getName());
}
is.close();
return bytes;
}
//@@end
Hi Sascha,
Which version of Web AS are you testing this example on?
Pranav
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 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.