If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

List of all reports in public

Started by Jaws415, 15 Apr 2009 09:39:01 AM

Previous topic - Next topic

Jaws415

Hello all, hoping someone can point me in the right direction.  I am working on a VB.NET app that when run will produce a list of all reports that exist in the public folder(including some additional info about the report i.e. description, name etc.). 

I have the code that will pull a report already developed (using cognosdotnet_2_0.query to access the report) the issue I am running into is you have to supply the full path
i.e. content/package[@name='PKG']/folder[@name=Report Samples']/report[@name='Report'].

So I am trying to find a way to automatically fill in the search path without user input, that way I can loop through everything to get a list of all reports.

Any samples in VB or C# or any info or alternative ideas would be greatly appreciated, thanks in advance.

platipuss

You need to create a searchPathMultipleObject with the search path /content//report or take it just for public folders "/content/public folders//report"

Then just pass that in with the query function to get an array of reports back.

xiska

Right.

Depending on your output you may need tu use the Searchpath
/content//pakage[permission('read') or permission('traverse')] | /content//folder[permission('read') or permission('traverse')] | /content//report[permission('read') and permission('execute')][not(contains(@name, 'nav')) and not(contains(@name, 'Ver'))]
In this case you get all Packages with read or traverse permissions union all Folder with read or traverse permissions Union all reports not named like '%nav%' or '%Ver%' (case insensitive) with read and execute permissions.
Having some areas reserved for development use you do not want to show e.g. folders named like %dev% you might use this:
/content//pakage[permission('read') or permission('traverse')][not(contains(@name, 'dev'))] | /content//folder[permission('read') or permission('traverse')][not(contains(@name, 'dev'))] | /content//report[permission('read') and permission('execute')][not(contains(@name, 'nav')) and not(contains(@name, 'Ver'))]
You can use much more additional attributes (disabled, time ...) to limit the results.

The /content//report does not care where they are - it will show up all reports including those with no permissions to them. The second part is that you can use the objectType to make a switch and to show up the directory information as well if you may need it. The PropEnum.parent is a little complex to use if you do not know where you are. The anchestors are easier.
Be aware that the return values using the queries is limited - always keep the properties as small as possible (Java):
new PropEnum[] {
   PropEnum.searchPath,
   PropEnum.defaultName,
   PropEnum.objectClass
},
Never ever use the lazy getAllProps sometimes shown in some samples. If you are asking for 100 properties, the Contentstore needs to deliver them ... and you get them.

To deliver the final cream on top you can use the user session to include the personal folder as well
/content//pakage[permission('read') or permission('traverse')][not(contains(@name, 'dev'))] | /content//folder[permission('read') or permission('traverse')][not(contains(@name, 'dev'))] | /content//report[permission('read') and permission('execute')][not(contains(@name, 'nav')) and not(contains(@name, 'Ver'))] | ~//folder | ~//report