Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: recordselectionformula Post Reply Post New Topic
Author Message
billev
Newbie
Newbie
Avatar

Joined: 19 May 2007
Location: United States
Online Status: Offline
Posts: 9
Quote billev Replybullet Topic: recordselectionformula
     Posted: 21 Apr 2011 at 4:48pm
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?

Thanks,

Bill V
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum