Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query a specific Enterprise folder 1

Status
Not open for further replies.

LV

Programmer
Nov 1, 2000
1,184
US
CE 10. Is there any way to query a specific folder in the InfoStore (using CE Query language) by folder's name, not ID? For example, there is a folder called "Client Reports", I need to list all reports in it. Thanks!
 
What you are asking, essentially, is if the CE query language will let you do a relational join. Not to my knowledge. You would execute one query to obtain the folder ID from the folder name and a follow-up query to obtain the (child) objects/reports from the (parent) folder ID.
 
Thanks for the reply. I can live with two separate quieries, the problem is that i can't find a way to query the infostore to get a specific folder info (such as its ID) by folder name. The help file is not much of a help.
 
I'll have to cut it out on Monday if no one else gets to it sooner.
 
The first query, to retrieve the ID, is:
Code:
SELECT SI_ID FROM CI_INFOOBJECTS WHERE SI_NAME = 'Client Reports'

This will return a number, for example 344. The second query retrieves the objects in the folder:
Code:
SELECT SI_PROGID, SI_NAME, SI_ID FROM CI_INFOOBJECTS WHERE SI_PARENT_FOLDER = 344

SI_PROGID should return a value of CrystalEnterprise.Report. However, if the folder contains subfolders, the SI_PROGID will be CrystalEnterprise.Folder. (It could also be CrystalEnterprise.FavoritesFolder.) You can use these progid's in your WHERE clause, which also supports "IN" as in:
Code:
SELECT SI_ID FROM CI_INFOOBJECTS WHERE SI_PARENT_FOLDER = " & MyParent & " AND SI_PROGID In ('CrystalEnterprise.Folder', 'CrystalEnterprise.FavoritesFolder'

The InfoStore does return the query results into an object collection, for which you may need to use a loop. The object properties for name and id are Title and ID.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top