Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal XI with .NET Security

Status
Not open for further replies.

Videla

Programmer
Jul 28, 2005
98
US
Hi,

We are working on a project with BO XI.
For adhoc reports we are creating universes using BO and users will access the universes through Infoview portal.
For standard reports (where users choses predefined set of filters and run the report), we are using crystal xi with .net.

we are very new to this technology. My question is how does the users access the crystal reports using asp.net in a secured way.
What is the standard way of accessing. As crystal is invoked from a customized asp .net pages,
we can not just use infoview. can anyone throw some light on this.

For webI part we are very clear. Users log on to infoview (so security it taken care) and
access the universes. Only problem is we are not sure on how the crystal with asp.net can be accessed by user.
Does BO XI support this by itself or do we need to build the security framework.


Thanks
Ravi
 
The way we do it is with a "managed" system with a .net program that runs the reports. You publish the reports using the Crystal/BO publishing wizard, then in your asp.net pages you call the .net app (Response.Redirect) that runs the reports (vb.net code below) passing the report name and any parameters to it. *Make sure you provide db login info to the reports when you publish them.

Code (for a BOE XI system, if you are on CE 10 just change the "11s" to "10s"):

Dim svr As String = System.Environment.MachineName
Dim qs As String = "&" & context.Request.QueryString.tostring
Dim rpt = Context.Request("rpt")
Dim cmd = context.request("cmd")
Dim cesm = CreateObject("CrystalEnterprise11.SessionMgr.1")
Dim ces = cesm.Logon("administrator", "", svr, "secEnterprise")
Dim ceis = ces.Service("", "InfoStore")
Dim cetokmgr = ces.LogonTokenMgr
Dim cetok = cetokmgr.CreateLogonTokenEx("", 2, 100)
Dim sSQL As String = "Select SI_ID From CI_INFOOBJECTS Where SI_PROGID = 'CrystalEnterprise.Report' AND SI_INSTANCE = 0 AND SI_NAME = '" & rpt & "'"
Dim rID As Integer

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ceio = ceis.Query(sSQL)
Dim init As String = ""
If ceio.count > 0 Then
rID = ceio.item(1).ID
Else
Response.Write("Report " & rpt & " not found")
Exit Sub
End If
If cmd = "" Then init = "&init=java_plugin:connect"
Response.Redirect("/crystalreportviewers11/viewrpt.aspx?id=" & rID & _
"&apstoken=" & cetok & qs & init)
End Sub

Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Unload
cetok = Nothing
cetokmgr = Nothing
ceis = Nothing
ces = Nothing
cesm = Nothing
End Sub

End Class
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top