on 09-08-2010 3:55 PM
Hello Folks
I need to pass the login token along with the URL so that the users are not challenged to enter login credentials.How can I do that using .Net ?Can any one help me regarding this?
Thanks
denlion
You gave us no information as to what you are actually doing.
What product and version?
What URL are you talking about (opendocument, viewrpt, Infoview, etc)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To create a logon token for the OpenDocument page, use the VB.NET sample code below:
=================
'Add the following refernces to the project.
CrystalDecisions.Enterprise.Framework
CrystalDecisions.Enterprise.Infostore
'Add the following Name space to the top of the code page.
Imports CrystalDecisions.Enterprise
=================
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Enterprise Session Manager Variables
Dim ceSessionMgr As New SessionMgr
Dim ceSession As EnterpriseSession
Dim ceToken As String
'Enterprise Credential Variables
Dim apsUser As String = "Administrator" 'Valid User ID
Dim apsPassword As String = "" 'Valid User Password
Dim cmsName As String = "myInfoviewServer" 'Server running Infoview
Dim apsAuthType As String = "secEnterprise" 'Authorization Type
'URL Reporting Report Variables
Dim ceEnterpriseService As EnterpriseService
Dim ceInfoStore As InfoStore
Dim ceReportObjects As InfoObjects
'********************
'Report is being hard coded in this example.
'You can use other approaches to populate the reportid variable.
'Your reportid values will be different.
'********************
'Choose a valid report ID. The 'World Sales Report' reportID may not be 306 on your system
Dim reportid As String = "306" ' 'World Sales Report' - basic report, no parameters
Dim sQuery As String
'Create Logon Token for use with Open Document method
Try
'logon to Enterprise
ceSession = ceSessionMgr.Logon(apsUser, apsPassword, cmsName, apsAuthType)
'create the security token for this logon
ceToken = ceSession.LogonTokenMgr.CreateLogonTokenEx("", 30, 100)
Catch err As Exception
'error logging on
lblError.Text = err.Message
End Try
'Use Logon Token to build URL to view report with Open Document method
Try
'Logon with the token
ceSession = ceSessionMgr.LogonWithToken(ceToken.ToString)
ceEnterpriseService = ceSession.GetService("", "InfoStore")
ceInfoStore = New InfoStore(ceEnterpriseService)
'Use query to confirm report is in crReportObjects collection
sQuery = "Select * From CI_INFOOBJECTS Where SI_ID=" + reportid
ceReportObjects = ceInfoStore.Query(sQuery)
'check for returned reports
If ceReportObjects.Count > 0 Then
'Business Objects Enterprise 3.1 Open Document URL
Response.Redirect(" http://myInfoviewServer/OpenDocument/opendoc/opendocument.aspx?token=" + ceToken + "&iDocID=" + reportid)
'See the Business Objects Enterprise 3.1 Open Document white paper for
'additional URL parameters - xi3-1_url_reporting_opendocument_en.pdf
'http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_url_reporting_opendocument_en.pdf
Else
'no objects returned by query
Response.Write("No report objects found by query <br>")
Response.Write("Please click <a href='Default.aspx'>here</a> to return to the start page.<br>")
End If
Catch err As Exception
Response.Write("There was an error: <br>")
Response.Write(err.Message.ToString + "<br>")
End Try
End Sub
That doesnt matter as the code is the same.
What kind of report you are viewing has nothing to do with creating a logon token.
Where, when and how are you using opendocument?
What does webi have to do with the opendocument call you are using?
What are you doing with flash files?
Edited by: Jason Everly on Sep 8, 2010 4:05 PM
Private Sub myOpenDocument()
Dim lProceed As Boolean
lProceed = False
sTool = sTool & "Retrieving the InfoObject..."
Dim query As String
query = "query://{SELECT TOP 1 * FROM CI_INFOOBJECTS WHERE SI_NAME='" & sDocName & "' AND SI_INSTANCE=0}"
Dim bowsResponseHolder As BusinessObjects.DSWS.BIPlatform.ResponseHolder
bowsResponseHolder = bowsBiPlatform.Get(query, Nothing)
Dim bowsInfoObjects As BusinessObjects.DSWS.BIPlatform.Desktop.InfoObjects
If Not bowsResponseHolder Is Nothing Then
bowsInfoObjects = bowsResponseHolder.InfoObjects
If Not bowsInfoObjects.InfoObject Is Nothing Then
lProceed = True
End If
End If
If lProceed Then
Dim bowsWebi As BusinessObjects.DSWS.BIPlatform.Desktop.WebI
bowsWebi = bowsInfoObjects.InfoObject(0)
Dim sDocCuid As String
sDocCuid = bowsWebi.CUID
sTool = sTool & "WebI document [" & bowsWebi.Name & "] found!<BR>"
'----
sTool = sTool & "Opening the WebI document..."
Dim bowsDocumentInformation As BusinessObjects.DSWS.ReportEngine.DocumentInformation
bowsDocumentInformation = bowsReportEngine.GetDocumentInformation(sDocCuid, Nothing, Nothing, Nothing, Nothing)
'bowsDocumentInformation = b
sDocumentReference = bowsDocumentInformation.DocumentReference
session.Add("SAMPLE.sDocumentReference", sDocumentReference)
sTool = sTool & "Successful!<BR>"
Else
sTool = sTool & "WebI document [" & sDocName & "] not found!<BR>"
End If
End Sub
This is the code I am using to open the doucment ...
To view my report right now I am using HTML . I need to open a flash file
Dim bowsViewSupport as New BusinessObjects.DSWS.ReportEngine.ViewSupport
bowsViewSupport.OutputFormat = OutputFormatType.HTML
bowsViewSupport.ViewType = ViewType.CHARACTER
bowsViewSupport.ViewMode = ViewModeType.REPORT_PAGE
I am using this code to view in html
Thanks
denlion
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.