Crystal Reports .Net 2005 ?

L

luqman

If I pass a session variable from another page to crystal report viewer and
open a connection 1st time, the report displays fine, however if I click on
Back Button of Browser, change the selection criteria and response.redirect
to crystal report viewer again, it shows blank report.

I have noticed that the selection formula must be passed to crystal report
viewer, before opening the connection, and once the connection is opened, it
is reused 2nd time and ignore the new selection formula, any idea how can I
handle this ?

Is it possible, to close the crystal report connection when user click on
Back Button of Browser ?

I am opening connection with the following code on page_load.

Protected Sub Page_Load(ByVal sender as Object, ByVal e As System.EventArgs)
Handles Me.Load

Dim myConnectionInfo as ConnectionInfo= New ConnectionInfo()
With myConnectionInfo
..UserID="myID"
..Password="myPassword"
..ServerName="myServer"
End With

With CrystalReportSource1
..Report.FileName="myReport"
End With

With CrystalReportViewer1
..ReportSouce=CrystalReportSource1.ReportDocument
..SelectionFormula=myFormula
End With

setDBLogonForReport(myConnectionInfo)

End Sub

Private Sub setDBLogonForReport(ByVal myConnectionInfo as ConnectionInfo)

Dim myTableLogOnInfos As TableLogOnInfos = CrystalReportViewer1.LogOnInfo
For Each myTableLogOnInfo As TableLogOnInfo In myTableLogOnInfos
myTableLogOnInfo.ConnectionInfo = myConnectionInfo
Next

End Sub

Best Regards,

Luqman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,701
Latest member
XavierQ83

Latest Threads

Top