<%@ Language=VBScript %>
<HTML>
<HEAD>
<title>BOE XI Reports MetaData Page</title>
<link rel="stylesheet" type="text/css" href="rsc/style/template_style.css"/>
<style type="text/css">
body {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#5F5F5F;
text-decoration:none;
scrollbar-arrow-color:#003366;
scrollbar-base-color:#C0C0C0;
scrollbar-darkshadow-color:#6699cc;
scrollbar-face-color:#6699cc;
scrollbar-highlight-color:;
scrollbar-shadow-color:;
}
table {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#5F5F5F;
text-decoration:none;
}
td {
vertical-align:top;
}
.dropdown {
font-size:11px;
}
.marginTable {
margin-left: 10px;
margin-right: 10px;
}
.heading {
font-size:18px;
font-weight:700;
text-align:center;
color:#003366;
}
.leftnav {
font-family:arial,helvetica,sans-serif;
font-weight:bold;
font-size:12px;
color:white;
text-decoration:none;
}
a:hover.leftnav {
text-decoration:underline;
}
.leftnavHeading {
font-family:arial,helvetica,sans-serif;
font-weight:bold;
font-size:12px;
text-align:center;
background-color:#99ccff;
color:green;
text-decoration:none;
}
a:hover.leftnavHeading {
text-decoration:underline;
}
.leftnavHeadingLeftAlign {
font-family:arial,helvetica,sans-serif;
font-weight:bold;
font-size:12px;
text-align:Left;
/*background-color:#99ccff; */
color:#003366;
text-decoration:none;
}
.tableHeading {
font-weight:700;
color:#003366;
font-size:14px;
}
.tableHeadingGreen {
font-weight:700;
color:green;
font-size:14px;
}
.tableHeadingLeft {
font-weight:700;
text-align:left;
}
.tableHeadingLink {
font-weight:700;
color:#5F5F5F;
text-align:center;
text-decoration:none;
}
a:hover.tableHeadingLink {
font-weight:700;
color:#5F5F5F;
text-align:center;
text-decoration:underline;
}
.tableLink {
font-weight:200;
font-size:14px;
color:#003366;
text-align:left;
text-decoration:none;
}
a:hover.tableLink {
font-weight:200;
color:#6699cc;
text-align:left;
text-decoration:underline;
}
.navigationPage {
font-size:14px;
font-weight:700;
text-align:left;
color:#003366;
text-decoration:none;
}
a:hover.navigationPage {
font-size:14px;
font-weight:700;
text-align:left;
color:#6699cc;
text-decoration:underline;
}
.emailLink {
font-weight:200;
color:#5F5F5F;
text-align:left;
text-decoration:underline;
}
a:hover.emailLink {
font-weight:200;
color:#333333;
text-align:left;
text-decoration:underline;
}
</style>
</HEAD>
<BODY>
<%
Const APS = <YourCMS>
Const UserID = "<Userwith Sufficient rights>"
Const Password= "<userspassword>"
Const Aut = "secEnterprise"
Function Logon(ByRef IStore)
Dim SessionManager
Dim Result
Result = FALSE
Set SessionManager = Server.CreateObject("CrystalEnterprise.SessionMgr")
If Err.Number = 0 then
Dim Sess
Set Sess = SessionManager.Logon(UserID, Password, APS, Aut)
If Err.Number = 0 then
Set IStore = Sess.Service ("", "InfoStore")
Set Session("IStore") = IStore
Result = TRUE
End If
end if
Logon = Result
End Function
Function ViewReportRoles (ReportID)
' Get the Report object for which to view the security roles,
' display the report name, and get the Report plugin interface.
Set MyStore = Session("IStore")
Set Reports = MyStore.Query("Select top 1 * From CI_INFOOBJECTS Where SI_ID='"& ReportID & "'")
Set Report = Reports.Item (1)
Response.Write("<TH class=tableHeading> The Following Users have permissions </TH>")
' Get the principals for the Report object.
Set RptSecurityInfo = Report.SecurityInfo
Set RptSecurityPrincipals = RptSecurityInfo.ObjectPrincipals
' Loop through all of the report's security principals and
' display the name and role of each principal.
ceRoleAdvanced = 0
ceRoleNoAccess = 1
ceRoleView = 2
ceRoleSchedule = 3
ceRoleViewOnDemand = 4
ceRoleFullControl = 5
For SecLoop = 1 to RptSecurityPrincipals.Count
Set SecPrincipal = RptSecurityPrincipals.Item (SecLoop)
Role = SecPrincipal.Role
Select Case Role
case ceRoleAdvanced
RoleDescription = "Advanced"
case ceRoleNoAccess :
RoleDescription = "No Access"
case ceRoleView
RoleDescription = "View"
case ceRoleSchedule
RoleDescription = "Schedule"
case ceRoleViewOnDemand
RoleDescription = "View on demand"
case ceRoleFullControl
RoleDescription = "Full Control"
End Select
Response.Write "<TR><TD>" & SecPrincipal.Name &" - " & RoleDescription & "</TD></TR>"
Next
End Function
Sub Main
Dim Indx
Dim Indx2
Dim IStore
Dim Result1
Dim Result2
Dim tyFlg
Dim IdIn
tyFlg = Request.Form("WhatType")
IdIn = Request.Form("FolderID")
' Set up the InfoStore Object needed for all Queries aginst CI_INFOOBJECTS
Logon IStore
' Create a Table to organize the display of the data in a readable format
Response.Write("<TABLE >")
'See if a Parent Folder is wanted of just 1 folder with its reports
If tyFlg = "F" then
'If Folder then this section will cycle through all sub-folders of that parent and create
'output for all the reports in each sub-folder ( NOTE - Can run for a very long time with large #s of reports)
Set Result1 = IStore.Query("Select SI_ID, SI_NAME , SI_DESCRIPTION From CI_INFOOBJECTS WHERE SI_PROGID = 'CrystalEnterprise.Folder' And SI_INSTANCE=0 AND SI_PARENT_FOLDER='" & IdIn & "' order by SI_NAME" )
For indx2 = 1 to Result1.Count
Response.Write("<tr><td style=color=red><u><h4> Folder Name is " & Result1.Item(indx2).Title & "</h4></u></td></tr>")
Set Result2 = IStore.Query("Select SI_ID, SI_NAME , SI_DESCRIPTION From CI_INFOOBJECTS WHERE SI_PROGID = 'CrystalEnterprise.Report' And SI_INSTANCE=0 AND SI_PARENT_FOLDER='" & Result1.Item(indx2).ID & "' order by SI_NAME" )
For indx = 1 to Result2.Count
Response.Write("<tr><td style=color=blue> Report # " & indx & " is " & Result2.Item(indx).Title & "</TD></TR>")
ViewReportRoles(Result2.Item(indx).ID)
next
Response.Write("<BR>")
next
' If just 1 Folder's Reports are requested, this section will handle that...( NOTE: Many Reports = slow return )
elseif tyFlg = "R" then
Response.Write("<tr><td style=color=red><u><h4> Report Information:</h4></u></td></tr>")
Set Result2 = IStore.Query("Select SI_ID, SI_NAME , SI_DESCRIPTION From CI_INFOOBJECTS WHERE SI_PROGID = 'CrystalEnterprise.Report' And SI_INSTANCE=0 AND SI_PARENT_FOLDER='" & IdIn & "' order by SI_NAME" )
For indx = 1 to Result2.Count
Response.Write("<tr><td style=color=blue> Report # " & indx & " is " & Result2.Item(indx).Title & "</TD></TR>")
ViewReportRoles(Result2.Item(indx).ID)
next
Response.Write("<BR>")
else
Response.Write("Bad, Bad result")
end if
End Sub
Main
%>
</BODY>
</HTML>