COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS UpFront => Topic started by: davidsoc on 08 Sep 2005 09:47:27 AM

Title: List of reports dependent on a cube
Post by: davidsoc on 08 Sep 2005 09:47:27 AM
Is it possible to get a list of all reports, and their locations, saved throughout Upfront that are based upon a particular (or even all) cubes published?

We would like to know the if this can be do through a macro or even if there is a tool anywhere that could do the same.

My understanding of Upfront is that it stores all saved reports, for a given cube, are saved in the \\Imported Reports\<cube_name> folder. Is this the case? and is there any way to extract details like location within upfront or the title of the file?

Thanks in advance for any suggestions

Chris
Title: Re: List of reports dependent on a cube
Post by: dwood09 on 12 Sep 2005 01:57:11 AM
davidsoc,

The following xml command can be executed to extract the list of reports connected to a particular PP upfront newsitem:

I've used this in a vb.net app, but it will also work by iteself as well:


  sResp = DeCodeXML(objSourceUpfSession.xmlcmd("<DescribeNewsItem><Filter><select>UP.DataSourceId = '" & sSourceNewsItemId & "'</select></Filter></DescribeNewsItem>"))



WHERE:
objSourceUpfSession is an Upfront Session object
sSourceNewsItemId  is a string representing the newsitemId to be searched for
sResp will be populated with xml representing the newsitems related to the sSourceNewsItemId 



DeCodeXML is the following function:

Function DeCodeXML(sInXML As String) as String
  Dim sResult As String

    sResult = sInXML
    sResult = Replace(sResult, "&amp;", "&")
    sResult = Replace(sResult, "&apos;", "'")
    sResult = Replace(sResult, "&#10;", " ")

    DeCodeXML = sResult

End Function


hope this helps:

cheers,
DW
Title: Re: List of reports dependent on a cube
Post by: davidsoc on 12 Sep 2005 09:51:27 AM
Thanks greatly for your reply. It has lead me to finding how to query the Upfront server and get the information i require.

However the script keeps failing when executed. It fails at the point it queries the server. Login is successful by the way.

Below is the vb code written using Cognos Script Editor.

Sub Main()

Dim Upfsession As Object

Set Upfsession = CreateObject("Upfront.UpfrontSession")

loginresp = Upfsession.Login("xxxxx", "Administrator", "xxxxx", "Root User Class")

SourceNewsItemId = "fc8cb81805fd11d895c692951c656a0b"

msgbox loginresp

Dim sResp As String

sResp = DeCodeXML(Upfsession.xmlcmd("<DescribeNewsItem><Filter><select>UP.DataSourceId = '" & SourceNewsItemId & "'</select></Filter></DescribeNewsItem>"))
'sResp = Upfsession.xmlcmd("<DescribeNewsItem><Filter><select>UP.DataSourceId = '" & SourceNewsItemId & "'</select></Filter></DescribeNewsItem>")

'msgbox sResp

loginresp = Upfsession.Logout()

End Sub
Title: Re: List of reports dependent on a cube
Post by: dwood09 on 12 Sep 2005 04:36:10 PM
This symtom sounds familiar ... try loggong off and exiting from the Access Manager Windows Comon Logon Server and do a describe on the item itself first, just to confirm that the item exists in the Upfrnt session that you are logging on to ... ie

sResp = objDestUpfSession.xmlcmd("<DescribeNewsItem><id>" & sDestNewsItemId & "</id></DescribeNewsItem>")

cheers,
DW
Title: Re: List of reports dependent on a cube
Post by: davidsoc on 13 Sep 2005 03:07:06 AM
I'm getting application errors when executing the code through Cognos Script Editor.

Could it be that the string being returned is too big to be stored as a string?

Thanks
Title: Re: List of reports dependent on a cube
Post by: dwood09 on 14 Sep 2005 02:27:08 AM
no, I don't think so, I would expect an overflow message, or something like that if the string data type could not handle it. 

Were you able to extract the details of the newsitem by itself, ie confirming that the ID does exist in the server that you're connecting to?

btw, I run most of the utilities that I build in VB.Net ... much easier to debug etc

cheers,
DW