Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Mar 05, 2015 at 08:53 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.