从 Java 程序访问 OBIEE 中的报告

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10373122/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 00:45:25  来源:igfitidea点击:

Accessing reports in OBIEE from a Java Program

javabusiness-intelligenceoracle-adfobieebi-publisher

提问by Faisal Memon

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.

我正在使用 Netbeans 开发 Java 应用程序,它将从 OBIEE 10G 上的 BI 服务器获取报告,并使用 Java 应用程序将其显示给客户端。任何人都可以建议我执行此操作的适当步骤以及如何开始。

回答by gerardnico

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.

首先,您将从 Presentation Services 而不是从 BI 服务器获取报告。BI 服务器是一个只有 SELECT 语句的数据库,而 Presentation Service 使用此 SELECT 来创建和格式化报告。

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

要将来自 BI Presentation 服务的报告集成到其他应用程序中,您可以使用:

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

这些链接指向相同的文档(集成商指南)。这是为 11g 编写的,但它也适用于 10g。

Cheers Nico

干杯尼科

回答by sprezzatura

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

你的问题不清楚;您是否正在尝试从 OBIEE 调用 Java 方法?

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.

如果是:您可以通过创建链接到操作的代理来完成此操作。Action 可以调用 java 方法(在 EJB 中)。通过将 Agent 与 Action 挂钩,您可以将其安排为作业。

回答by RHT

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 stepsto 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.

虽然可以使用 webservices 和 GO url 来创建您的 web 应用程序,但这是一种非常困难的方法。如果您有选择,请使用最新的 JDeveloper 11g,然后使用这些步骤将您的 Answers Reports 或 Dashboards 拖放到 .jspx 页面。这很简单,只要您熟悉 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 docbefore taking it to production.

编辑:如果您仍然想使用 Netbeans,这里有一段代码可以帮助您入门。在将其投入生产之前,请记住阅读并理解OBIEE 集成文档中HtmlViewService SOAP API

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);