Monday, March 18, 2013

Oracle BI EE 11g – Calling JS Scripts


 

How to save the reports scheduled via Agents to a local directory using a simple JS Script:

 
JS Script Method:
 
var FSO = new ActiveXObject("Scripting.FileSystemObject");
var foldername = 'D:\IBOT'

if (FSO.FolderExists(foldername))
{
var fileName = foldername + "\\" +Parameter(1);
var fooFile = FSO.CopyFile(Parameter(0), fileName, true);
}
else
{
FSO.CreateFolder(foldername);
var fileName = foldername + "D:\IBOT"  + Parameter(1);
var fooFile = FSO.CopyFile(Parameter(0), fileName, true);
}
 
Or
 
We can convert vb script to Js script. Your wish !!!!
 
 
Please copy the above script in notepad then save as satyaexport_report.js then move to this file as mention below path.
C:\OBIEE11G\instances\instance1\bifoundation\OracleBISchedulerComponent\coreapplication_obisch1\scripts\common
 
Follow the steps.
 
 
 









 
 
 
Good Luck!!!!!!
 
 
Thanks,
Satya Ranki Reddy

11 comments:

  1. hi Can u tell me what do you mean by parameter(0) and (1) in js script


    thanks
    Goutham

    ReplyDelete
  2. Hi Goutham Reddy,

    Thanks for visiting my blog.

    0--->Delevery content as PDF
    1-->satya.PDF

    Parameter (1) you can see above what this Java Script basically does is that it accepts one parameter (Parameter(1)) which is the file name and saves this file to a desired location ex: For me D drive it will store.
    Parameter(0) : Noting but define the output format specification.

    Hope this help’s

    Thanks,
    Satya

    ReplyDelete
  3. Hi Satya,

    Can we achieve this in Linux? My BI Server is installed on Linux Box.

    Thanks,

    ReplyDelete
    Replies
    1. Hi

      It is not possible in linux / unix. But using action link it is possible but we can't trigger action link method.

      Thanks,
      Satya

      Delete
    2. Hi Satya,

      I have followed same process to sent i bot FTP server location. But i got below error.


      [nQSError: 61007] File error: path=E:\Oracle\instances\instance1\bifoundation\OracleBISchedulerComponent\coreapplication_obisch1\scripts\common, code=5: Access is denied.

      Delete
    3. It seems folder permission issue.

      Delete
    4. Hi Satya,

      Then how to resolve this issue. I have try to make path as shared path and also same issue.


      Please let me know how reslove this issue.

      Thanks,
      Malli

      Delete
  4. Hi Stahya , I wanna to implement same on Linux machine . Can you help me on same

    ReplyDelete
  5. Hi Stahya , I wanna to implement same on Linux machine . Can you help me on same

    ReplyDelete
  6. Hi satya ,please clear this

    [nQSError: 66013] [Line:51 Column:1]
    [nQSError: 66016] Unknown error code '0x80070002'.

    ReplyDelete