0

我想通过 api 获取报告宇宙,步骤如下所述

  1. 打开报告文件
  2. DataProvider dp = dps.getItem(i); //get report data providers
  3. DataSource ds = dp.getDataSource(); //get data source
  4. universe.setFilePath(ds.getDomainName() + "/"+dp.getSource()+".unv"); //get datasource -- universe domain/path

大多数情况下,我得到了这样的正确数据/DEV_folder/testUNV.unv

很少,结果是null/testUNV.unv\DEV_folder\testUNV.unv

知道为什么吗?

Business Objects 服务器版本为 Enterprise XI 3.1 SP7,使用 java SDK


谢谢。但这可能无法解决我的问题,您提供了 3 种可能性,请参阅下面的评论

  • Universe 不在文件夹中— 不,报告使用相同的 Universe,一个可以获取路径,另一个不能

  • Universe 位于您无权访问的文件夹中(尽管您可以访问该 Universe) — 不,报告使用相同的 Universe,我具有读取和写入权限。

  • 数据源不是一个 Universe——它是一个 Universe。

抱歉,由于缺乏声誉,我无法提供屏幕截图。

合同 - 第四方供应商同意书报告

/eSourcing_Dev/Contract.unv

/eSourcing_Dev/Project Save.unv

合同第四方供应商同意书报告

空/合同.unv

空/项目保存.unv

合同 - 第 4 方供应商同意表报告和合同第 4 方供应商同意表报告连接到相同的 Universe,即 Contract.unv 和 Project Save.unv,但路径显示为空。

如果我在 BO Infoview 上打开合同第四方供应商同意书报告并再次保存报告,那么我可以获得正确的路径。

报告名称

项目 ?里程碑

宇宙

/eSourcing/项目保存.unv

\eSourcing/项目保存.unv

项目 ?里程碑报告获得 2 条不同的路径

/eSourcing/Project Save.unv

\eSourcing/Project Save.unv

它们应该是一个报告,2 个查询(2 个数据提供者),使用同一个 Universe。

我已经提供了我使用的实际代码/API,省略了循环。请检查我描述的步骤。我想要做的是批量获取所有报告及其宇宙。

4

2 回答 2

1

“null”有几个原因:

  • 宇宙不在文件夹中。
  • Universe 位于您无权访问的文件夹中(尽管您有权访问 Universe)
  • 数据源不是 Universe

尝试打印 ds.getUniverseID() 的结果,然后对该 ID 运行 CMS 查询。这可能会让您对问题有更多的了解。

我无法解释“\”。如果您可以提供更多代码和您获得的实际结果,我可能会提供帮助。

于 2014-08-27T12:45:08.630 回答
0

I've looked at the API documentation of the Report Engine API and couldn't really determine what the getDomainName() call is supposed to return. Domains where a notion that was used in pre-XI releases; AFAIK this concept no longer exists in the XI versions.

If you want to get the path of the universe, I do the following:

  1. Get the datasource ID, using getID() method of the DataSource interface.
  2. Retrieve the InfoObject (using the BusinessObjects Enterprise API) using the ID from step 1.
  3. Retrieve the parent ID for the universe, using the getParentID() method of the IInfoObject interface, check that this is a folder object and cast to an IFolder interface.
  4. Use the getPath() method of the IFolder interface to return the full path.

Keep in mind that sometimes a Webi report will report that it's not linked to any universe, so-called unbound reports. See this blog post for more information about this issue.

于 2014-09-01T12:23:11.460 回答