0
votes

I wanna get report universe via api, steps as described below

  1. Open report document
  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

mostly, I got correct data like this /DEV_folder/testUNV.unv

seldomly, the result is null/testUNV.unv or \DEV_folder\testUNV.unv

any idea why?

Business Objects server version is Enterprise XI 3.1 SP7, using java SDK


Thank you Joe. But this may not solve my problem, you provide 3 possibilities, see my comments below

  • The universe is not in a folder — No, reports using the same universe, one can get path, the other one cannot

  • The universe is in a folder that you don't have access to (although you have access to the universe) — No, reports using same universe, which I have read and write privilege.

  • The data source is not a universe — it is a universe.

Sorry I cannot provide screenshot due to lack of reputations.

Contract - 4th Party Supplier Consent Form Report

/eSourcing_Dev/Contract.unv

/eSourcing_Dev/Project Save.unv

Contract 4th Party Supplier Consent Form Report

null/Contract.unv

null/Project Save.unv

Contract - 4th Party Supplier Consent Form Report and Contract 4th Party Supplier Consent Form Report connect to the same universes, Contract.unv and Project Save.unv, but the path display null.

If I open Contract 4th Party Supplier Consent Form Report on BO Infoview and just save the report again, then I can get the correct path.

Report Name

Project ? Milestones

Universe

/eSourcing/Project Save.unv

\eSourcing/Project Save.unv

Project ? Milestones report get 2 different path

/eSourcing/Project Save.unv

\eSourcing/Project Save.unv

they should be one report, 2 query(2 data provider), using the same universe.

I already provided actual code/API I used, loop omitted. Please check the steps I described. What I am trying to do is get all the reports and their universe in a batch.

2
It would help if you'd indicate what version of BusinessObjects you're using and which API (.NET, COM, …).ƘɌỈSƬƠƑ

2 Answers

1
votes

There are a couple of reasons for the "null":

  • The universe is not in a folder.
  • The universe is in a folder that you don't have access to (although you have access to the universe)
  • The data source is not a universe

Try printing out the result of ds.getUniverseID() and then run a CMS query on that ID. That may give you more insight as to the problem.

I can't explain the "\". If you could provide more of your code and the actual results that you get, I may be able to help.

0
votes

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.