Hi,
It is possible to work with Open Office API
After getting its two objects "com.sun.star.ServiceManager", and "com.sun.star.frame.Desktop" you can do almost anything with it.
Here's an example on how to write some data to Open Office Calc and save the document (JScript):
FileName - full path for the new file
function SaveSmthToCalc(FileName)
{
try
{
//creating Desktop object
var oServiceManager = Sys.OleObject("com.sun.star.ServiceManager");
var oDesktop = oServiceManager.createInstance("com.sun.star.frame.Desktop");
// creating an array of document parameters
// and placing there a value Hidden=true, so that Open office calc won't be shown
var VariantArray = new Array();
var Mystruct = oServiceManager.Bridge_GetStruct("com.sun.star.beans.PropertyValue");
Mystruct.Name = "Hidden";
Mystruct.Value = true;
VariantArray[0] = Mystruct;
//creating a document
//first parameter can be a URL path to an existing document (then existing document will be changed)
var oDoc = oDesktop.LoadComponentFromURL("private:factory/scalc", "_blank", 0, VariantArray);
//getting first sheet
var oSheet = oDoc["getSheets"]().getByIndex(0);
//filling several with some values
for (var j=0; j<10; j++)
for(var i=0; i<10; i++)
oSheet.getCellByPosition(i, j).setString("Col:"+i+" Row:"+j);
//saving the document
// url path should be used here, so converting usual path to it
oDoc.storeAsURL("file:///"+aqString.Replace(FileName, "\\", "/"), VariantArray);
//closing document
oDoc.Close(false);
}
catch(exception)
{
Log.Warning("Unable to save the data to ods table", exception.description);
}
}