Got more questions? Find advice on: SQL | XML | Regular Expressions | Windows
in Search
Welcome to AspAdvice Sign in | Join | Help

crystal reports via .net 2005

Last post 02-01-2008, 6:36 PM by kasejust. 0 replies.
Sort Posts: Previous Next
  •  02-01-2008, 6:36 PM 39219

    crystal reports via .net 2005

    I have a crystal report that is opened via a web application using vb.net 2005.  The problem we are seeing is that occasionally if a user has a session open and a new user initiates a session.  The second user will get the report with the first users information.  Does anyone know why this would happen? My code is shown below

     

    Try
                    oRep = New ReportDocument
                    Response.Clear()
                    Response.Charset = ""
                    Response.ClearContent()
                    Response.ClearHeaders()
                    Response.ContentType = "application/pdf"
                    ExportDirectory = New ExportOptions

                    oRep.Load(strPath)
                    oRep.SetDatabaseLogon("XXX", "XXXX")
                    oRep.Refresh()
                    oRep.SetParameterValue("@VAR1", VAR1)
                    oRep.SetParameterValue("@VAR2", VAR2)
                    oRep.SetParameterValue("@VAR3", VAR3)

                    ExportDirectory = oRep.ExportOptions
                    ExportDirectory.ExportFormatType = ExportFormatType.PortableDocFormat
                    oRep.ExportToHttpResponse(ExportDirectory, Response, False, "rpt1")
                Else
                    Err.Raise("6754")
                    Err.Description = ("data elements not passed")
                End If
            Catch ex As System.Exception


            Finally

                If Not IsNothing(oRep) Then
                    Response.Flush()
                    Response.Close()
                    oRep.Close()
                    oRep.Dispose()
                    GC.Collect()
                End If

            End Try

View as RSS news feed in XML