Skip to Content

I had a customer today that needed to find out what reports (webi and deski) on their Enterprise deployment that had become disconnected from their universe after a migration.

They were interested in writing a custom application to do this in .NET and after searching for forever thinking I had already written one I discovered that I had not…or at least had lost it if I had so off to writing I went.

This code just outputs the name of the object (it does not distinguish between webi or deski), the parent folder id, and the creation time of the object.

VB.NET Sample Code

<textarea cols=”75″ rows=”10″>

Imports CrystalDecisions.Enterprise

Partial Class _Default

    Inherits System.Web.UI.Page

    ‘Logon and Enterprise vars

    Dim ceSessionMgr As New SessionMgr()

    Dim ceSession As EnterpriseSession

    Dim ceService As EnterpriseService

    Dim ceInfoStore As InfoStore

    Dim ceInfoObjects As InfoObjects

    Dim ceInfoObject As InfoObject

    Dim boUniObject As InfoObject

    Dim boUniObjects As InfoObjects

    ‘Used to store query string

    Dim sQuery As String = “”

    Dim userid As String = “Administrator”      ‘Enter user name here

    Dim password As String = “”    ‘Enter password here

    Dim aps As String = “JEXIR2NET2k5”          ‘Enter APS name here

    Dim auth As String = “secEnterprise”

    Dim UniverseId As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        ‘Log on to the CMS

        ceSession = ceSessionMgr.Logon(userid, password, aps, auth)

        ceService = ceSession.GetService(“”, “InfoStore”)

        ceInfoStore = New InfoStore(ceService)

        ‘Grab all Webi and Deski templates

        sQuery = “SELECT SI_Name, SI_PARENT_FOLDER, SI_CREATION_TIME, SI_Universe FROM CI_INFOOBJECTS WHERE (SI_Kind = ‘Webi’ or SI_Kind = ‘FullClient’)  and si_instance = 0”

        ceInfoObjects = ceInfoStore.Query(sQuery)

        Response.Write(“<b>Webi and Deski documents with no Universe</b>” & “<BR><BR>”)

        Response.Write(“<table border=1 cellspacing=2>”)

        Response.Write(“<tr><td><b>Document Name</b></td>”)

        Response.Write(“<td><b>Folder ID</b></td>”)

        Response.Write(“<td><b>Creation Date</b></td></tr>”)

        ‘Loop through the objects for the universe ids of webi docs

        For Each ceInfoObject In ceInfoObjects

            If ceInfoObject.Properties(“SI_Universe”).Properties(“SI_TOTAL”).Value.ToString = “0” Then

                ‘Output name of the doc

                Response.Write(“<tr><td>” + ceInfoObject.Properties(“SI_Name”).ToString + ” </td>”)

                Response.Write(“<td>” + ceInfoObject.Properties(“SI_Parent_Folder”).ToString + ” </td>”)

                Response.Write(“<td>” + ceInfoObject.Properties(“SI_CREATION_TIME”).ToString + ” </td></tr>”)

            End If

        Next

    End Sub

End Class

</textarea>

Have a great day!

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Greg Myers
    Hi Jason, this is a very slick way to do this.
    I used to just run a query in the Query Builder to try and determine if the Universe association had been broken.
    SELECT SI_NAME
    , SI_ID
    , SI_UNIVERSE
    , SI_PARENT_FOLDER
    FROM CI_INFOOBJECTS

    If the SI_UNIVERSE entry was empty, the report had lost its way.

    (0) 
    1. Jason Everly Post author
      Thanks for the comment Greg!

      That is essentially what I do in code.  Using query builder is awesome for taking a quick look at what is going on in the CMS.

      This customer wanted to be able to output the information in a usable format instead of just cutting and pasting out of the qb results. 

      I put it in a table for looks, but that can easily be changed to output to your own csv, dataset, etc for ease of use later.

      (0) 
  2. Mustafa Kamal
    The looks great but how do we go about binding this association again betweek Deski Reports and Univeres. I have seen this issue very recently and while importing the Reports the default Univerese is not selected in Import Wizard. Any help would be appreciated.

    Thank you,
    Mustafa

    (0) 
    1. Jason Everly Post author
      Hi Mustafa,

      Unfortunately as far as I know it is not possible using the .NET SDK as the Dataprovider class does not have a method such as changeDataSource() to update the webi reports.

      You would have to look into using Java to accomplish this.

      Jason

      (0) 

Leave a Reply