Object doesn't support this property or method
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Object doesn't support this property or method

  1. #1
    Join Date
    Nov 2005
    Posts
    1

    Object doesn't support this property or method

    I have a page that is supposed to display a crystal report on an active x object, on a web page. But everytime the link to display this page is clicked, I get a "The page cannot be displayed" error page.

    The reason is because:
    Error Type:
    Microsoft VBScript runtime (0x800A01B6)
    Object doesn't support this property or method: 'session(...).OpenReport'
    /PmxPRF/PrfRoot/reports/callreport.asp, line 68

    Line 68 on callreport.asp:
    Set Session("oRpt") = Session("oApp").OpenReport(path & RPTtoView, 1)

    Please help me... Thanks.

  2. #2
    Join Date
    Jul 2005
    Location
    Chennai
    Posts
    39

    Re: Object doesn't support this property or method

    Hi Plz Try this one!. i hope it will helps to you.

    Code:
    <%
    Set oConn = Server.CreateObject("ADODB.Connection")
    oConn.Open(Application("cnStr"))
    set session("oRs") = Server.CreateObject("ADODB.Recordset")
     
    session("oRs").ActiveConnection = oConn
    session("oRs").Open "SELECT * from master_products where prod_id='SQR_PROD-0003'"
     
    reportname ="ServiceCallReport.rpt"
     
    If Not IsObject (session("oApp")) Then							 
    Set session("oApp") = Server.CreateObject("CrystalRuntime.Application")
    End If																
     
    Path = Request.ServerVariables("PATH_TRANSLATED")					 
     
    While (Right(Path, 1) <> "\" And Len(Path) <> 0)					 
    iLen = Len(Path) - 1												 
    Path = Left(Path, iLen)											 
    Wend																																	 
     
    If IsObject(session("oRpt")) then 
    Set session("oRpt") = nothing
    End if
     
    On error resume next
    Set session("oRpt") = session("oApp").OpenReport(path & reportname, 1)
     
    If Err.Number <> 0 Then
    Response.Write "Error Occurred creating Report Object: " & Err.Description
    Set Session("oRpt") = nothing
    Set Session("oApp") = nothing
    Session.Abandon
    Response.End
    End If
     
    session("oRpt").MorePrintEngineErrorMessages = False
    session("oRpt").EnableParameterPrompting = False
    session("oRpt").DiscardSavedData
     
    set Database = session("oRpt").Database
    set Tables = Database.Tables
    set Table1 = Tables.Item(1)
    Table1.SetPrivateData 3, session("oRs") 
     
    On Error Resume Next
    session("oRpt").ReadRecords
     
    If Err.Number <> 0 Then											 
    Response.Write "Error Occurred Reading Records: " & Err.Description
    Set Session("oRpt") = nothing
    Set Session("oApp") = nothing
    Session.Abandon
    Response.End
    Else
     
    If IsObject(session("oPageEngine")) Then							 
    set session("oPageEngine") = nothing
    End If
    set session("oPageEngine") = session("oRpt").PageEngine
    End If
     
    viewer = Request.Form("Viewer")
    server.execute "ReportSource.asp"%>
    none of us is smart us all of us

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center