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