i have a report created with crystal 10 and i access this report from visual studio 2005. using the code below
Private Sub ConfigureCrystalReports()
Dim reportPath As String = ConfigurationManager.AppSettings.Item("reportPath").ToString + "Report_RAData_Main.rpt"
CrystalReportViewer1.ReportSource = reportPath
CrystalReportViewer1.RefreshReport()
Dim crParameterFields As ParameterFields = CrystalReportViewer1.ParameterFieldInfo
Dim crParameterDiscreteValue As ParameterDiscreteValue = New ParameterDiscreteValue()
crParameterDiscreteValue.Value = Session("FromDate").ToString()
crParameterFields.Item("FromDate").CurrentValues.Add(crParameterDiscreteValue)
Dim crParameterDiscreteValue1 As ParameterDiscreteValue = New ParameterDiscreteValue()
crParameterDiscreteValue1.Value = Session("ToDate").ToString()
crParameterFields.Item("ToDate").CurrentValues.Add(crParameterDiscreteValue1)
CrystalReportViewer1.ParameterFieldInfo = crParameterFields
Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
myConnectionInfo.DatabaseName = ConfigurationManager.AppSettings.Item("UserCatalog").ToString
myConnectionInfo.UserID = ConfigurationManager.AppSettings.Item("UserId").ToString
myConnectionInfo.Password = ConfigurationManager.AppSettings.Item("Password").ToString
SetDBLogonForReport(myConnectionInfo)
End Sub
Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo)
Dim myTableLogOnInfos As TableLogOnInfos = CrystalReportViewer1.LogOnInfo()
Dim myTableLogOnInfo As TableLogOnInfo
For Each myTableLogOnInfo In myTableLogOnInfos
myTableLogOnInfo.ConnectionInfo = myConnectionInfo
Next
End Sub
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
ConfigureCrystalReports()
End Sub
my DSN points to a development database and when i change this to point to the production database the old data from the development database is still coming up. i have went inot the crystal report and set the datasource to the new datbase and i have also set use default DSN database to true.
would really appreciate any suggestions...quite urgent! thanks
Private Sub ConfigureCrystalReports()
Dim reportPath As String = ConfigurationManager.AppSettings.Item("reportPath").ToString + "Report_RAData_Main.rpt"
CrystalReportViewer1.ReportSource = reportPath
CrystalReportViewer1.RefreshReport()
Dim crParameterFields As ParameterFields = CrystalReportViewer1.ParameterFieldInfo
Dim crParameterDiscreteValue As ParameterDiscreteValue = New ParameterDiscreteValue()
crParameterDiscreteValue.Value = Session("FromDate").ToString()
crParameterFields.Item("FromDate").CurrentValues.Add(crParameterDiscreteValue)
Dim crParameterDiscreteValue1 As ParameterDiscreteValue = New ParameterDiscreteValue()
crParameterDiscreteValue1.Value = Session("ToDate").ToString()
crParameterFields.Item("ToDate").CurrentValues.Add(crParameterDiscreteValue1)
CrystalReportViewer1.ParameterFieldInfo = crParameterFields
Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
myConnectionInfo.DatabaseName = ConfigurationManager.AppSettings.Item("UserCatalog").ToString
myConnectionInfo.UserID = ConfigurationManager.AppSettings.Item("UserId").ToString
myConnectionInfo.Password = ConfigurationManager.AppSettings.Item("Password").ToString
SetDBLogonForReport(myConnectionInfo)
End Sub
Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo)
Dim myTableLogOnInfos As TableLogOnInfos = CrystalReportViewer1.LogOnInfo()
Dim myTableLogOnInfo As TableLogOnInfo
For Each myTableLogOnInfo In myTableLogOnInfos
myTableLogOnInfo.ConnectionInfo = myConnectionInfo
Next
End Sub
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
ConfigureCrystalReports()
End Sub
my DSN points to a development database and when i change this to point to the production database the old data from the development database is still coming up. i have went inot the crystal report and set the datasource to the new datbase and i have also set use default DSN database to true.
would really appreciate any suggestions...quite urgent! thanks