Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change databases but old data still coming up

Status
Not open for further replies.

cathiec

Programmer
Oct 21, 2003
139
0
0
IE
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
 
This may sound like a silly question because I'm not familiar with calling Xtal 10 reports from VS 2005 but I'm going to ask it anyway :)

Its not that the report has had its data saved along with the report itself ?
 
I have the same problem. In older versions of Crystal (v5,6) I could tell it NOT to save data with the report. How do I do that in the .net version?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top