BusinessObjects Board

BO XI 3-SDK-Java get schema, table, columns used in report

Hi,
in BO XI R3, we have about 3000 documents of different type of report webi and full client and we need to write a .JAVA program that displays the reports and data source details (schema, table, columns).
I’ve found Dave Rathbun’s “ObjectsUsed” macro at List Objects Used in a set of Documents
and was able to implement the same functionality in .JAVA.
How can I retrieve objects used in WebI and CrystalReport reports? Is this possible at all?
I tried to use Java SDK, but the DataSource return a little information. Can anyone suggest anything?
Thanks in advance.

I use the search pattern method instead of sql query language
http://devlibrary.businessobjects.com/businessobjectsxir2/en/en/BOE_SDK/boesdk_java_dg_doc/doc/boesdk_java_dg/HowToExamples50.html#514179

IInfoStore infoStore = (IInfoStore) getEnterpriseSession().getService("InfoStore");
int propertySet = IInfoObject.PropertySet.ALL;
SearchPattern searchPattern = new SearchPattern();
searchPattern.setObjectKind(CeKind.WEBI);
SortType sortType = new SortType();
sortType.addSortDimension(ISortDimension.NAME_ASC);
IInfoObjects reports = infoStore.find(propertySet, searchPattern, sortType);
for (Object obj : reports) {
	IInfoObject iObject = (IInfoObject) obj;
	if (iObject instanceof IWebi) {
	   IWebi iWebi = (IWebi) iObject;
	   IWebiDocDataProviders IWDDPs = webi.getDocumentDataProviders(); 
       IWebiDocDataProvider IWDDP = (IWebiDocDataProvider) IWDDPs.item(0); 
       IWDDP.getName()); 
       IWDDP.getID()); 
       IWDDP.getDataSourceName()); 
       IWDDP.getDataSourceID()); 

where found datasource details schema, table and columns of the report?


stylus (BOB member since 2008-08-09)

For webi, the way I approached this was by getting the following information from the reports: Report Name, CUID, Location, Owner, FRS Location, Object Name, Parent Folder, Universe Name, and Object Type (result or filter) and then also extracting the universe information and joining these tables together on Universe, object name, and parent folder.

For Crystal Reports you’ll need a completely separate process to break down the database information using the RAS SDK. The way I approached this was having two methods one to document the report and the other to generate a table list from the document.

To get the tables, you access the document database controller to get the database and then tables. Then for each table I looped through checking the type (Table, Command, Stored Procedure) and then gathered the table name, alias, and fully qualifed name in a hash table. I used this hash table as the very end to update any places where the column had a alias so I could get a distinct list of tables used.

To document the report I looped through the getResultFields(), getForumulaFields(), getRecordFilter(), and getGroups() methods and used regular expressions to get rid of braces and stuff generated in Crystal that distorts the actual name (mainly used with Formulas). Then used the ReportDefControler() method I got all report objects and looped through them to get condition formulas, columns used in report text objects, charts, and crosstabs and used regular expressions again to normalize the names. And also did this for any subreports using a simlar method.


bdgeise (BOB member since 2011-12-15)