Accessing reports in OBIEE from a Java Program

14,154

Solution 1

First of all, you will fetch the report from Presentation Services and not from BI server. BI server is a database with only SELECT statement whereas Presentation Service uses this SELECT to create and format reports.

To integrate report from BI Presentation service within a other application, you can use:

The links goes to the same documentation (Integrator's Guide). This is written for 11g but it will also works in 10g.

Cheers Nico

Solution 2

Your question is not clear; Are you trying to invoke a Java method from OBIEE?

If yes: You can do this by creating an Agent which is linked to an Action. The Action can invoke a java method(in an EJB). By hooking the Agent to the Action, you can schedule it as a job.

Solution 3

While it is possible to use the webservices and the GO url to create your web app, it is a very hard way to do so. If you have a choice, use the latest JDeveloper 11g and then, use these steps to drag and drop your Answers Reports or Dashboards to the .jspx page. It's simple, can be done in minutes rather than days provided you are familiar with JDeveloper.

EDIT: If you still want to use Netbeans, here's a snippet of code to get you started. Remember to read and understand the HtmlViewService SOAP API in the OBIEE integration doc before taking it to production.

import oracle.bi.services.soap.*

SAWSessionParameters sessionParams = new SAWSessionParameters();
sessionParams.setUserAgent("Mozilla/...."); //Copy the exact agent from your Firefox menu Help > About

javax.xml.rpc.ServiceFactory factory = ServiceFactory.newInstance();
SAWSessionServiceSoap sessionService = ((SAWSessionService) factory.loadService(SAWSessionService.class)).getSAWSessionServiceSoap();

HtmlViewServiceSoap htmlService = ((HtmlViewService) factory.loadService(HtmlViewService.class)).getHtmlViewService();

AuthResult authResult = sessionService.logonex("replace_with_your_username", "replace_with_your_password", sessionParams); //You should reuse the session for multiple HTTP Requests from the same user
String sessionID = authResult.getSessionID();

StartPageParams pageParams = new StartPageParams();
pageParams.setIdsPrefix("replace_with_your_prefix");
String pageID = htmlService.startPage(pageParams, sessionID);

ReportRef report = new ReportRef();
report.setReportPath("replace_with_full_path_to_your_report");
htmlService.addReportToPage(pageID, "replace_with_your_report_name", report, null, null, null, sessionID);

String reportHTML = htmlService.getHtmlForReport(pageID, "replace_with_your_report_name", sessionID);
System.out.println(reportHTML); //Here's the report that you are looking for

htmlService.endPage(pageID, sessionID);
Share:
14,154
Faisal Memon
Author by

Faisal Memon

Technology enthusiast, Java, Android, Web, OBIEE Developer ;)

Updated on June 15, 2022

Comments

  • Faisal Memon
    Faisal Memon almost 2 years

    I am developing an Java application using Netbeans which will fetch reports from the BI server on OBIEE 10G and display it to the client using the Java application. Can anyone suggest me appropriate steps to do this and also how to begin with it.

  • Rafael Estrada
    Rafael Estrada over 9 years
    I am implementing a Java application that consumes the HTMLViewService from OBIEE. The XMLViewService works properly, but the HTMLViewService just shows the spinning loader and then renders the report (with an error in the source of "Load embedded report error"). The OBI Server and the Java app are on different domains, so I think that is the probably. I'm under the assumption I have to use the setBridge() method to navigate this issue. Can someone help with this? Code example would be appreciated.
  • Rafael Estrada
    Rafael Estrada over 9 years
    Correction to my last comment: the report never loads, the spinning loader just keeps on spinning indefinitely.