|
|
|
|
Re: Can't open a .doc file generated by B.I.R.T with ActiveX [message #1402704 is a reply to message #1398805] |
Thu, 17 July 2014 11:23 |
Ayman JDAINI Messages: 2 Registered: July 2014 |
Junior Member |
|
|
Hi,
Thanks for helping, I've found the problem using IE Debugger.
The problem came from openOffice who can't open documents generated by BIRT.
Here is a correct implementation of the mecanisme, all you need is to implements this fonction in your html page and then call it by giving the filePath :
<script type="text/javascript">
function myFunctionWord(filePath) {
try {
var myApp = new ActiveXObject('Word.Application');
myApp.Documents.Open(filePath);
myApp.Visible = true;
} catch (e) {
function createStructArray(ServiceManager, structName) {
var classSize;
var newStruct = new Array();
classSize = ServiceManager.forName(structName);
classSize.createObject(newStruct);
return newStruct;
}
var objServiceManager = new ActiveXObject('com.sun.star.ServiceManager');
var objCoreReflection = objServiceManager.createInstance('com.sun.star.reflection.CoreReflection');
var objDesktop = objServiceManager.createInstance('com.sun.star.frame.Desktop');
var args = createStructArray(objCoreReflection,'com.sun.star.beans.PropertyValue');
var objDocument = objDesktop.loadComponentFromURL(filePath, '_Blank', 0, args);
}
}
</script>
P.S : the filePath must be like this : file://remoteAdresse/Path/fileName.doc
Example : [u]file://15.46.44.147/myProject/BIRT_HOME/fileName.doc[/u]
[Updated on: Thu, 17 July 2014 11:25] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03015 seconds