Not able to save file to local disk through iBot - OBIEE
741169Jun 11 2010 — edited Feb 19 2013Hi All,
I have followed the following steps to save the deliver content in the local disk(through iBot). But, I am not getting any file in the specified directory.Please help me out.
1. Created a file named SavetoFile.js
2. The contents of the file is:
var FSO = new ActiveXObject("Scripting.FileSystemObject");
var foldername = "\\Reports"
var rptname;
with (new Date) {
rptname = ((((getFullYear() * 100 + getMonth() + 1) * 100 + getDate()) * 100 + getHours()) * 100 + getMinutes()) * 100 + getSeconds();
}
if (FSO.FolderExists(foldername))
{
var fileName = foldername + "\\" + "File1-" + rptname + Parameter(1);
var fooFile = FSO.CopyFile(Parameter(0), fileName, true);
}
else
{
FSO.CreateFolder(f oldername);
var fileName = foldername + "\\" + "File1-" + rptname + Parameter(1);
var fooFile = FSO.CopyFile(Parameter(0), fileName, true);
}
3. Change the value of rptname to whatever you want the file name to be.
4. Store the file in OracleBI\server\Scripts\Common
5. Create the iBot as you normally do. Make sure on the 'Delivery Content' tab, set the drop-down to PFD.
6. On the 'Advanced' tab of the iBot, click the Add Action.
7. In the Custom Script Properties popup, File Name is SaveToFile.js, Type is JavaScript. Check on the 'Pass delivery content to script' radio button.
8. In the 'Other Parameters', you will need two: the first is the name of the file (If the file name on the server should be 'Bob.pdf', the first parameter is Bob.) Create a second parameter of PDF.
This will create the file on the root drive of the server. In the Javascript from above, the file is stored in C:\Reports.
Thanks,
Soumitra