Vb.net2005 Crystal report error

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")
       
        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
kasejust1993Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
The only thing that makes sense is that he is opening the first users PDF.

You might try using the user name or some other unique value as part of the pdf file name.

mlmcc
0
kasejust1993Author Commented:
How can I dynamically name the report?
0
mlmccCommented:
oRep.ExportToHttpResponse(ExportDirectory, Response, False, "rpt1" & CStr(CurrentTime))

Replace the CStr(CurrentTime) with the users login.

mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.