I'm trying to write a record selection formula using the version of Crystal Reports bundled with Visual Studio. Net 2003 that will allow a user to select the last name of a person using a text box. Here is my attempt that results in a runtime error.
Code:
string FormulaSelect;
"{Vendors.resLastName} = " + textBox3.Text;
myReport.DataDefinition.RecordSelectionFormula = FormulaSelect;
Runtime error:
Error in formula <Record_Selection>
'{Vendors.LastName}=smith'
A number, currency amount, boolean, date, time, date-time or string is expected here.
I am using the following MSDN sample I found on a web site:
Add a selection formula that contains the following:
{Customer.Last Year's Sales} > 11000.00
This formula returns records for customers whose sales from the previous year were greater than $11,000.00.
string selectFormula;
"{Customer.Last Year's Sales} > " + textBox1.Text;
Report.DataDefinition.RecordSelectionFormula = SelectFormula;
Any assistance would be appreciated.
Thanks,
Mark
Code:
string FormulaSelect;
"{Vendors.resLastName} = " + textBox3.Text;
myReport.DataDefinition.RecordSelectionFormula = FormulaSelect;
Runtime error:
Error in formula <Record_Selection>
'{Vendors.LastName}=smith'
A number, currency amount, boolean, date, time, date-time or string is expected here.
I am using the following MSDN sample I found on a web site:
Add a selection formula that contains the following:
{Customer.Last Year's Sales} > 11000.00
This formula returns records for customers whose sales from the previous year were greater than $11,000.00.
string selectFormula;
"{Customer.Last Year's Sales} > " + textBox1.Text;
Report.DataDefinition.RecordSelectionFormula = SelectFormula;
Any assistance would be appreciated.
Thanks,
Mark