I have published a report to CE9. I am able to use VB.Net to get the latest instance of the report. Now, I want to view the report's chart in a report part viewer on a web page.
The problem is that I keep getting an exception,
"The Enterprise logon failed". I KNOW that I am able to logon to CE9. That is how I get the report instance. But, the report instance's .NeedsLogon returns True.
The database logon info is stored in CE9. I can go to the CE9 administrator, click "Run Now" and it works without prompting me for logon info.
My code seems to blow up when I set the report viewer's .ReportSource to the instance of the report I fetched from CE9.
Does anyone know why I'm getting this exception? Any help is greatly appreciated.
Here is my code:
The problem is that I keep getting an exception,
"The Enterprise logon failed". I KNOW that I am able to logon to CE9. That is how I get the report instance. But, the report instance's .NeedsLogon returns True.
The database logon info is stored in CE9. I can go to the CE9 administrator, click "Run Now" and it works without prompting me for logon info.
My code seems to blow up when I set the report viewer's .ReportSource to the instance of the report I fetched from CE9.
Does anyone know why I'm getting this exception? Any help is greatly appreciated.
Here is my code:
Code:
Dim ceSessionmgr As New SessionMgr
Dim ceSession As EnterpriseSession
Dim ceInfoStore As InfoStore
Dim ceEnterpriseService As EnterpriseService
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
LogOn("myusername", "mypassword", "myaps", "secEnterprise")
Dim oRpt As Report = getReport()
If Not IsPostBack Then
Dim crReportPartsDefinition As New CrystalDecisions.Web.ReportPartsDefinition
With CrystalReportPartsViewer1
.ReportParts = crReportPartsDefinition
.ReportSource = oRpt
End With
End If
End Sub
Private Sub LogOn(ByVal p_user As String, ByVal p_password As String, ByVal p_aps As String, ByVal p_auth As String)
If TypeOf Session.Item("CEInfoStore") Is Object Then
ceInfoStore = Session.Item("CEInfoStore")
Else
ceSession = ceSessionmgr.Logon(p_user, p_password, p_aps, p_auth)
ceEnterpriseService = ceSession.GetService("", "InfoStore")
ceInfoStore = New InfoStore(ceEnterpriseService)
Session.Add("CEInfoStore", ceInfoStore)
End If
nd Sub
Public Function getReport() As Report
Dim result = ceInfoStore.Query("SELECT * FROM CI_INFOOBJECTS WHERE SI_ID = 77222")
Return result.Item(1)
End Function