cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Public member 'Dispose' on type 'ISCDReportClientDocument' not found.

Former Member
0 Kudos

Hi everyone,

I have an ASP VB.NET web application developed in Visual Studio 2010 4.0 loaded on server A making a call to server B running Crystal reports 2013. I want to use the same Viewer and use Case to pass the name of the report. But I can’t Dispose of the document I am getting an error: Public member 'Dispose' on type 'ISCDReportClientDocument' not found. I would appropriate any help on this one because I am stuck.

Here is my code:

Public Class GLReports

    Inherits System.Web.UI.Page

    Private boEnterpriseSession As EnterpriseSession

    Private boInfoObject As InfoObject

    Private boReportClientDocument As ReportClientDocument

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Session("UserID") Is Nothing Then Response.Redirect("..\Login.aspx")

        Dim blnIsError As Boolean = False

      

        Try

            Dim boSessionMgr As SessionMgr

            Dim boInfoStore As InfoStore

            Dim boEnterpriseService As EnterpriseService

            Dim boInfoObjects As InfoObjects

            Dim boReportName As String = Request("FormName")

            Dim boQuery As String

            Dim boReportAppFactory As ReportAppFactory

            If Session("boEnterpriseSession") IsNot Nothing Then

boEnterpriseSession = DirectCast(Session("boEnterpriseSession"), EnterpriseSession)

            Else

boSessionMgr = New CrystalDecisions.Enterprise.SessionMgr()

boEnterpriseSession = boSessionMgr.Logon("username ", " password ", " cms ", " authtype ")

Session.Add("boEnterpriseSession", boEnterpriseSession)

            End If

            If Session("boReportClientDocument") IsNot Nothing Then

boReportClientDocument = DirectCast(Session("boReportClientDocument"), ReportClientDocument)

            Else

boEnterpriseService = boEnterpriseSession.GetService("", "InfoStore")

boInfoStore = New CrystalDecisions.Enterprise.InfoStore(boEnterpriseService)

Select Case boReportName

Case "Test1"

                        boReportName = "rptTest1.rpt"

Case "Test2"

                        boReportName = " rptTest2.rpt "

End Select

boQuery = "Select Query"

boInfoObjects = boInfoStore.Query(boQuery)

boInfoObject = boInfoObjects(1)

boEnterpriseService = Nothing

'Retrieve the RASReportFactory

boEnterpriseService = boEnterpriseSession.GetService("RASReportFactory")

boReportAppFactory = DirectCast(boEnterpriseService.[Interface], CrystalDecisions.ReportAppServer.ClientDoc.ReportAppFactory)

'Open the report from Enterprise

boReportClientDocument = boReportAppFactory.OpenDocument(boInfoObject.ID, 0)

'Add the reportClientDocument to session

Session.Add("boReportClientDocument", boReportClientDocument)

            End If

            'Set the ReportSource of the viewer to the report in Session

CRViewer.ReportSource = Session("boReportClientDocument")

          

            boReportClientDocument.Close()

            boReportClientDocument.Dispose()

        Catch ex As Exception

blnIsError = True 'if any error occured then no need to udpate the batch status

lblMessage.Text = "Error, " & ex.Message

lblMessage.ForeColor = System.Drawing.ColorTranslator.FromHtml("Red")

            cGeneral.WriteLog(ex)

        End Try

    End Sub

End Class

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Milena,

The report is in session so you don't want to dispose of it. Only when you are done with the report then close it and dispose.

Don