Guest_imported
New member
- Jan 1, 1970
- 0
Hi,
I am doing the reports by using Crystal Analysis and I can successfully view it on Web through Crystal Enterprise (Version 8, Standard Version). It can be viewed without problem if I load the reports by the default ePoftfolio page. However, I tried to develope my own customized CSP page, I can list out the report names succefully but the reports cannot be viewed.
The error message is:
*********************
Retrieve Error
There was an error while retrieving data from the server: Not Authorized
*********************
The URL link when one of the reports is called is as follows:
Before the report names are listed, the script runs an automatically logon (i.e. users do not have to type in any login name and password, users logon as "guest" by default) and then it lists out the report names.
What is the possible cause of this error? Anyone can help? Thanks.
Below is the CSP script I used.
******************************************************************
<HTML>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<BODY>
<!-- #include file=RetrieveIStore.csp -->
<%
Function RetrieveReports(ParentID ,IStore, Error)
'This returns an HTML table that is populated with the report name,
'report description, and the last time it was modified.
'
'Precondition:
'ParentID - The ID of the parent folder containing the reports to be retrieved.
'IStore - The InfoStore object required to interface with server.
'Error - A variable to hold the error if one occurs.
'
'Postcondition:
'Error - Contains the error number: 0 if successful.
'
'Notes:
'The function returns a string that is an HTML table.
'The query that will select the reports.
Dim Query
'The result of the query.
Dim Result
'A string to hold the HTML table.
Dim HTMLTable
HTMLTable=""
'Create a query that selects all the reports, but doesn't select the instances.
query = "Select SI_NAME, SI_ID, SI_DESCRIPTION, SI_UPDATE_TS From CI_INFOOBJECTS Where " & _
"SI_PROGID='CrystalEnterprise.Analysis' And SI_INSTANCE=0 AND SI_PARENT_FOLDER=" & CStr(ParentID)
'*************************************
On Error Resume Next
'Query the server.
Set Result = IStore.Query(Query)
If Err.Number <> 0 Then
'There was an error querying the server.
Error=Err.Number
Exit Function
End If
If Result.Count > 0 Then
'Set up the table header.
HTMLTable="<TABLE Border=0 width = ""100%"">" & _
"<TR><TD><B>Name</B></TD>" & _
"<TD><B>Description</B></TD>" & _
"<TD><B>Last Modified</B></TD></TR>"
Dim oReport
For each oReport in Result
'Add the report name and details to the table
HTMLTable=HTMLTable & _
"<TR valign=top><TD>" & _
"<A HRef='infoobject.cwr?ReportID=" & CStr(oReport.ID) & _
"&action=0" & _
"&apstoken=" & APSTOKEN & "' Target='Main'>" & _
Server.HTMLEncode(oReport.Properties("SI_NAME"
) & "</A></TD>" & _
"<TD>" & Server.HTMLEncode(oReport.Properties("SI_DESCRIPTION"
) & "</TD>" & _
"<TD>" & oReport.Properties("SI_UPDATE_TS"
& "</TD></TR>"
Next
HTMLTable=HTMLTable&"</TABLE>"
else
Response.Write "How are you??" & Result.Count
End If
RetrieveReports = HTMLTable
'Indicate success.
Error=0
End Function
Dim Result
Dim ReportNames
Dim ReportIDs
Dim IStore
Dim CurrentFolderID
Dim Error
'***Guest Login: user no need to type in login name and password
Set SessionManager = Server.CreateObject("CrystalEnterprise.SessionMgr"
Set oEnterpriseSession = SessionManager.Logon("", "","TOPFORM05","secEnterprise"
Set IStore = oEnterpriseSession.Service("","InfoStore"
'Set inStore = IStore.Query("SELECT * FROM CI_INFOOBJECTS WHERE SI_PROGID ='CrystalEnterprise.Analysis'"
Set LogonToken = oEnterpriseSession.LogonTokenMgr
APSToken = LogonToken.CreateLogonToken("",1,100)
'**************************************************************
'Retrieve the CurrentFolderID from the file's parameter list.
'***Change the folder to 124
'''CurrentFolderID = Request.QueryString("FolderID"
CurrentFolderID = 124
'*********************
Dim HTMLTable
HTMLTable= RetrieveReports(CurrentFolderID, IStore,Error)
If Error=0 Then
Response.Write "<B>Report Listing</B><BR><BR>"
If HTMLTable <> "" Then
Response.Write HTMLTable
Else
Response.Write "No reports..."
End If
Else
Response.Write "There was an error trying to retrieve the reports."
End If
%>
</BODY>
</HTML>
****************************************************************************
I am doing the reports by using Crystal Analysis and I can successfully view it on Web through Crystal Enterprise (Version 8, Standard Version). It can be viewed without problem if I load the reports by the default ePoftfolio page. However, I tried to develope my own customized CSP page, I can list out the report names succefully but the reports cannot be viewed.
The error message is:
*********************
Retrieve Error
There was an error while retrieving data from the server: Not Authorized
*********************
The URL link when one of the reports is called is as follows:
Before the report names are listed, the script runs an automatically logon (i.e. users do not have to type in any login name and password, users logon as "guest" by default) and then it lists out the report names.
What is the possible cause of this error? Anyone can help? Thanks.
Below is the CSP script I used.
******************************************************************
<HTML>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<BODY>
<!-- #include file=RetrieveIStore.csp -->
<%
Function RetrieveReports(ParentID ,IStore, Error)
'This returns an HTML table that is populated with the report name,
'report description, and the last time it was modified.
'
'Precondition:
'ParentID - The ID of the parent folder containing the reports to be retrieved.
'IStore - The InfoStore object required to interface with server.
'Error - A variable to hold the error if one occurs.
'
'Postcondition:
'Error - Contains the error number: 0 if successful.
'
'Notes:
'The function returns a string that is an HTML table.
'The query that will select the reports.
Dim Query
'The result of the query.
Dim Result
'A string to hold the HTML table.
Dim HTMLTable
HTMLTable=""
'Create a query that selects all the reports, but doesn't select the instances.
query = "Select SI_NAME, SI_ID, SI_DESCRIPTION, SI_UPDATE_TS From CI_INFOOBJECTS Where " & _
"SI_PROGID='CrystalEnterprise.Analysis' And SI_INSTANCE=0 AND SI_PARENT_FOLDER=" & CStr(ParentID)
'*************************************
On Error Resume Next
'Query the server.
Set Result = IStore.Query(Query)
If Err.Number <> 0 Then
'There was an error querying the server.
Error=Err.Number
Exit Function
End If
If Result.Count > 0 Then
'Set up the table header.
HTMLTable="<TABLE Border=0 width = ""100%"">" & _
"<TR><TD><B>Name</B></TD>" & _
"<TD><B>Description</B></TD>" & _
"<TD><B>Last Modified</B></TD></TR>"
Dim oReport
For each oReport in Result
'Add the report name and details to the table
HTMLTable=HTMLTable & _
"<TR valign=top><TD>" & _
"<A HRef='infoobject.cwr?ReportID=" & CStr(oReport.ID) & _
"&action=0" & _
"&apstoken=" & APSTOKEN & "' Target='Main'>" & _
Server.HTMLEncode(oReport.Properties("SI_NAME"
"<TD>" & Server.HTMLEncode(oReport.Properties("SI_DESCRIPTION"
"<TD>" & oReport.Properties("SI_UPDATE_TS"
Next
HTMLTable=HTMLTable&"</TABLE>"
else
Response.Write "How are you??" & Result.Count
End If
RetrieveReports = HTMLTable
'Indicate success.
Error=0
End Function
Dim Result
Dim ReportNames
Dim ReportIDs
Dim IStore
Dim CurrentFolderID
Dim Error
'***Guest Login: user no need to type in login name and password
Set SessionManager = Server.CreateObject("CrystalEnterprise.SessionMgr"
Set oEnterpriseSession = SessionManager.Logon("", "","TOPFORM05","secEnterprise"
Set IStore = oEnterpriseSession.Service("","InfoStore"
'Set inStore = IStore.Query("SELECT * FROM CI_INFOOBJECTS WHERE SI_PROGID ='CrystalEnterprise.Analysis'"
Set LogonToken = oEnterpriseSession.LogonTokenMgr
APSToken = LogonToken.CreateLogonToken("",1,100)
'**************************************************************
'Retrieve the CurrentFolderID from the file's parameter list.
'***Change the folder to 124
'''CurrentFolderID = Request.QueryString("FolderID"
CurrentFolderID = 124
'*********************
Dim HTMLTable
HTMLTable= RetrieveReports(CurrentFolderID, IStore,Error)
If Error=0 Then
Response.Write "<B>Report Listing</B><BR><BR>"
If HTMLTable <> "" Then
Response.Write HTMLTable
Else
Response.Write "No reports..."
End If
Else
Response.Write "There was an error trying to retrieve the reports."
End If
%>
</BODY>
</HTML>
****************************************************************************