I have Crystal Reports in VS 2005 where I use the following:
myreport.DataDefinition.RecordSelectionFormula =
"{EmployeeTable.IDNum} = " & intID _
& " and {EmplHourTable.HourType} = " & "'D'"
We are accessing Access Database files (MDB). The Reports work as expected.
When the program is converted to VS 2010, the 1st time the report is run, the recordselectionformula is ignored but works for any subsequent runs.
The report runs with the following code:
CrystalReportViewer1.ReportSource = myreport
CrystalReportViewer1.Zoom(2)
Interestingly, if I duplicate the line CrystalReportViewer1.ReportSource = myreport, the report works fine the 1st time
CrystalReportViewer1.ReportSource = myreport
CrystalReportViewer1.ReportSource = myreport CrystalReportViewer1.Zoom(2)
Thoughts?