Hi all,
I found a web page at (near bottom of the page) with a very interesting approach towards reporting on the 'hidden' information in the APS Database. It's a lot easier and more automated than pulling information via Excel macros on an exported HTML page, but there are a few improvements needed. I'm not taking credit for any of this, just bringing it to the attention of the group to see if others can help perfect it...
Basically, it involves creating a CSP page which generates an XML datasource containing the results of a CI_INFOOBJECTS query. I had to modify the CSP code given on the above link a little bit in order to get it to output valid XML, here's what I used:
<%
Dim SessionManager
Set SessionManager=Server.CreateObject("CrystalEnterprise.SessionMgr")
Dim Sess
Set Sess = SessionManager.Logon("administrator", "PASSWORD_GOES_HERE","SERVERNAME_GOES_HERE", "secEnterprise")
Dim IStore
Set IStore = Sess.Service ("", "InfoStore")
'Next we create a query
Dim Rs: Set Rs = IStore.Query("SELECT SI_NAME, SI_ID, SI_DESCRIPTION, SI_PROGID, SI_CREATION_TIME," &_
"SI_STARTTIME, SI_ENDTIME, SI_LAST_RUN_TIME, SI_NEXTRUNTIME, SI_PARENTID, SI_PROCESSINFO.SI_DBNEEDLOGON," &_
"SI_SCHEDULE_STATUS, SI_RECURRING, SI_OWNER, SI_PATH, SI_SCHEDULEINFO.SI_DESTINATION.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_MESSAGE," &_
"SI_ERROR_MESSAGE FROM CI_INFOOBJECTS WHERE " &_
"SI_INSTANCE = 1")
'Next we will write a simple function that will build each data row within xml tags
'with the tag names matching select properties
Function PrintOutRow(row)
For each col in row
PrintOutRow = PrintOutRow &_
" <"&Server.HTMLEncode(col.Name) & ">" &_
Server.HTMLEncode(col.Value)& "</" & Server.HTMLEncode(col.Name) & ">" & vbCRLF
Next
End Function
'Now before we loop thru all rows of our result set we need to enclose a
'beginning tag
Response.Write "<?xml version='1.0' ?>" & vbCRLF
Response.Write "<DATA>"& vbCRLF
'and then loop thru the result set of Rs
For Each rsRow in Rs
Response.Write "<ITEM>" & vbCRLF
Response.Write PrintOutRow(rsRow.Properties)
'now we can set a reference to the processing info object and
'get its properties
Dim pinfo: Set pinfo = rsRow.ProcessingInfo
Response.Write PrintOutRow(pinfo.Properties)
'and then the scheduling info
Dim sinfo: Set sinfo = rsRow.SchedulingInfo
Response.Write PrintOutRow(sinfo.Properties)
Response.Write "</ITEM> " & vbCRLF
Next
'and lastly end it with a closing tab
Response.Write "</DATA>"& vbCRLF
%>
Once the CSP page is on the server, you can create an ODBC connection to the CSP page using the CR XML driver (Location type is "XML Document") and base reports on that XML data source.
The one thing that this doesn't seem to be able to show is some of the 'nested' items in Query Builder. For example, it would be really useful to be able to get some of the items in SI_PROCESSINFO, to be able to produce a report showing full details for all scheduled reports. But including items from SI_PROCESSINFO in the .csp causes errors, probably because there's more than one column.
I'm a complete novice at CSP and XML, does anyone have the 'skillz' to take this to the next level and get this to display ALL data in the CI_INFOOBJECTS table?
I found a web page at (near bottom of the page) with a very interesting approach towards reporting on the 'hidden' information in the APS Database. It's a lot easier and more automated than pulling information via Excel macros on an exported HTML page, but there are a few improvements needed. I'm not taking credit for any of this, just bringing it to the attention of the group to see if others can help perfect it...
Basically, it involves creating a CSP page which generates an XML datasource containing the results of a CI_INFOOBJECTS query. I had to modify the CSP code given on the above link a little bit in order to get it to output valid XML, here's what I used:
<%
Dim SessionManager
Set SessionManager=Server.CreateObject("CrystalEnterprise.SessionMgr")
Dim Sess
Set Sess = SessionManager.Logon("administrator", "PASSWORD_GOES_HERE","SERVERNAME_GOES_HERE", "secEnterprise")
Dim IStore
Set IStore = Sess.Service ("", "InfoStore")
'Next we create a query
Dim Rs: Set Rs = IStore.Query("SELECT SI_NAME, SI_ID, SI_DESCRIPTION, SI_PROGID, SI_CREATION_TIME," &_
"SI_STARTTIME, SI_ENDTIME, SI_LAST_RUN_TIME, SI_NEXTRUNTIME, SI_PARENTID, SI_PROCESSINFO.SI_DBNEEDLOGON," &_
"SI_SCHEDULE_STATUS, SI_RECURRING, SI_OWNER, SI_PATH, SI_SCHEDULEINFO.SI_DESTINATION.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_MESSAGE," &_
"SI_ERROR_MESSAGE FROM CI_INFOOBJECTS WHERE " &_
"SI_INSTANCE = 1")
'Next we will write a simple function that will build each data row within xml tags
'with the tag names matching select properties
Function PrintOutRow(row)
For each col in row
PrintOutRow = PrintOutRow &_
" <"&Server.HTMLEncode(col.Name) & ">" &_
Server.HTMLEncode(col.Value)& "</" & Server.HTMLEncode(col.Name) & ">" & vbCRLF
Next
End Function
'Now before we loop thru all rows of our result set we need to enclose a
'beginning tag
Response.Write "<?xml version='1.0' ?>" & vbCRLF
Response.Write "<DATA>"& vbCRLF
'and then loop thru the result set of Rs
For Each rsRow in Rs
Response.Write "<ITEM>" & vbCRLF
Response.Write PrintOutRow(rsRow.Properties)
'now we can set a reference to the processing info object and
'get its properties
Dim pinfo: Set pinfo = rsRow.ProcessingInfo
Response.Write PrintOutRow(pinfo.Properties)
'and then the scheduling info
Dim sinfo: Set sinfo = rsRow.SchedulingInfo
Response.Write PrintOutRow(sinfo.Properties)
Response.Write "</ITEM> " & vbCRLF
Next
'and lastly end it with a closing tab
Response.Write "</DATA>"& vbCRLF
%>
Once the CSP page is on the server, you can create an ODBC connection to the CSP page using the CR XML driver (Location type is "XML Document") and base reports on that XML data source.
The one thing that this doesn't seem to be able to show is some of the 'nested' items in Query Builder. For example, it would be really useful to be able to get some of the items in SI_PROCESSINFO, to be able to produce a report showing full details for all scheduled reports. But including items from SI_PROCESSINFO in the .csp causes errors, probably because there's more than one column.
I'm a complete novice at CSP and XML, does anyone have the 'skillz' to take this to the next level and get this to display ALL data in the CI_INFOOBJECTS table?