Now that I found my SDK :roll:, I would like to get the list of all universes my account has access to.
I tried this :
Dim designerApplication As New Designer.Application
Call designerApplication.Logon("login", "password", "server", "secEnterprise")
Dim nbrUniverses As Integer
For nbrUniverses = 0 To designerApplication.universes.Count - 1
list.AddItem (designerApplication.universes.Item(nbrUniverses).Name)
'list is a multiselect listbox
Next
But there are no universe in this list (designerApplication.universes.Count = 0)…
I tried other things with a Designer.Universes variable and Imoprt, Add… but it doesn’t work better… :?
Here is a snippet of how we loop through universes via the SDK in XI:
Dim y As Integer
Dim oInfoStore As CrystalInfoStoreLib.InfoStore
Dim oInfoObjects As CrystalInfoStoreLib.InfoObjects
Dim ObjDes As Designer.Application
Dim oSessionMgr As CrystalEnterpriseLib.SessionMgr
Dim oEnterpriseSession As CrystalEnterpriseLib.EnterpriseSession
Dim oInfoObject As CrystalInfoStoreLib.InfoObject
Dim sSQL As String
Set ObjDes = New Designer.Application
ObjDes.Interactive = False
Call ObjDes.Logon(sLoginName, sPassword, sCMS, sAuthenticationMode)
Set oSessionMgr = New CrystalEnterpriseLib.SessionMgr
Set oEnterpriseSession = oSessionMgr.Logon(sLoginName, sPassword, sCMS, sEnterpriseSessionType)
Set oInfoStore = oEnterpriseSession.Service("", "InfoStore")
sSQL = ""
sSQL = "SELECT "
sSQL = sSQL & " SI_NAME,SI_REVISIONNUM,SI_SHORTNAME,SI_UPDATE_TS,SI_PARENT_FOLDER,SI_OWNER,SI_PARENT_FOLDER_CUID "
sSQL = sSQL & " FROM CI_APPOBJECTS "
sSQL = sSQL & " WHERE SI_KIND='Universe' "
Set oInfoObjects = oInfoStore.Query(sSQL)
For y = 1 To oInfoObjects.Count
Debug.Print oInfoObjects.Item(y).Properties.Item("SI_NAME")
Next y
I wanted to also add; my code utilizes the following references:
Crystal Enterprise Infostore Library 11.5
Crystal Enterprise Framework Library 11.5
BusinessObjects 11.5 Object Library
BusinessObjects Designer 11.5 Object Library
That’s because it’s the local Designer application counting the number of universes IT has open. If you want to look at the repository contents, you need the .StoredUniverses collection.