This discussion is archived
9 Replies Latest reply: May 14, 2009 7:25 PM by 566241 RSS

Run BI Publisher from the command line through a shell script

678370 Newbie
Currently Being Moderated
Dear Friends,

I have the following situation:

BI Publisher accesses a 10g database through its data template and transforms this gathered data into XML through a custom XSLT layout template. Thereafter it transfers its output as XML over a FTP connection.

My question is, how can I run BI Publisher with a shell script (from the command line with an external scheduler) to do all this, where the report names (or data template and layout template for that matter) need to be variable (there are multiple different reports).

Note that I am relatively new to this batch processing ergo an example would be very valuable to me.

Thanks a lot,

Kees
  • 1. Re: Run BI Publisher from the command line through a shell script
    695168 Newbie
    Currently Being Moderated
    I have a similar need. Does anyone know if schduling a report via command line (cmd or unix shell) is possible?
  • 2. Re: Run BI Publisher from the command line through a shell script
    524753 Guru
    Currently Being Moderated
    Create a java program, which consumes web services , some thing liek this

    bipwebservices.proxy.ParamNameValue[] parms = new bipwebservices.proxy.ParamNameValue[1];

    parms[0] = new bipwebservices.proxy.ParamNameValue();
    parms[0].setMultiValuesAllowed(false);
    parms[0].setName("dept");

    java.lang.String[] parmValue = { "10" };
    parms[0].setValues(parmValue);

    bipwebservices.proxy.PublicReportServiceClient myPort = new bipwebservices.proxy.PublicReportServiceClient();
    ReportRequest repReq = new bipwebservices.proxy.ReportRequest();
    ReportResponse repRes = new bipwebservices.proxy.ReportResponse();
    repReq.setAttributeFormat("pdf");
    repReq.setAttributeLocale("en-US");
    repReq.setAttributeTemplate("Template1);
    repReq.setReportAbsolutePath(".....");
    repReq.setParameterNameValues(parms);
    repRes = myPort.runReport(repReq, userName, password);


    Create a shellscript
    java -cp calljava.java

    if you execute this shell script , then you can run reports.

    if you want to choose the reprots, pass it as arguments to java.
    if you want, parameter for reprots to be passed, pass it as arguments to java.
  • 3. Re: Run BI Publisher from the command line through a shell script
    680183 Journeyer
    Currently Being Moderated
    Are you not using Oracle Apps, BI Enterprise, or ..?
    Why do you need to schedule it via shell?
  • 4. Re: Run BI Publisher from the command line through a shell script
    695168 Newbie
    Currently Being Moderated
    We are using BI Publisher with OBIEE, no other ORACLE products are being used.
  • 5. Re: Run BI Publisher from the command line through a shell script
    695168 Newbie
    Currently Being Moderated
    Vetstrini,

    I am slightly confused by your response. Why do we need to engage web-services in order to schedule a job?

    Let me go into a little bit more detail of what I am trying to do. I have a parameterized report, which contains multiple grids. Hence bursting doesn't work. (secondary grids drop off after the first bursted page).

    I am trying to work around the issue by scheduling execution of reports with a different parameter every time.

    Right now I am able to manually schedule a report using the BIP scheduler.

    What I am looking to do is to schedule a BIP scheduler job via command line script. If this is not possible, then maybe there is a different way to go about scheduling an execution of a same report with a different parameter every time?

    Thanks much for your help,
    Michael
  • 6. Re: Run BI Publisher from the command line through a shell script
    524753 Guru
    Currently Being Moderated
    Yes, BIP has provided a webservice,
    One of the function is to run or schedule a report.

    Write a simple Java program, which will look at the server and point to run the report you wanted.

    then you got to run this java program from command line.
    You can write shell script to run this from command prompt.

    When you run the report, we have option of passing the parameters , so if you want to schedule the same report for 10 different value.

    You have to write a loop to run the same report with different parameter.


    http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/e10416/bip_webservice_101331.htm

    We have been using similar process for long without any issues.
  • 7. Re: Run BI Publisher from the command line through a shell script
    408268 Explorer
    Currently Being Moderated
    Michael,

    BI Publisher does not provide a command line interface. It provides a web service interface if you are running the BI Publisher server and want to run, schedule, etc. any of the reports you have created.

    There is also a Java API if you want to leverage lower level Publisher operations in a custom application but, then your application takes responsibility for catalog mgt, scheduling etc.

    To accomplish what you want, Vestrini's reply is a good one.


    Mike
  • 8. Re: Run BI Publisher from the command line through a shell script
    Abhishek_H Explorer
    Currently Being Moderated
    Hi,
    I used the bip wsdl ( http://localhost:9704/xmlpserver/services/PublicReportService?wsdl )
    to generate a web service which saves a report in pdf file.

    Now, I have created some parameters in the report which i want to pass using the web service. how can i do that?

    eg. in the sample report
    HR Manager>Employee Salary Report
    I want to set the lov's 'Departments' and 'Employee' as parameters to the web service.
  • 9. Re: Run BI Publisher from the command line through a shell script
    566241 Newbie
    Currently Being Moderated
    as mentioned, you can create a driver program in j developer to run the reports for you using the code vestrini supplied above. you can query the employee and department tables and create recordsets with your parameters.
    insert the code block to execute the reports inside a while loop that runs through your recordsets.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points