SAP Knowledge Base Article - Public

1206284 - How to select the records based on the first few characters entered by a user

Symptom

How do I select the records based on the first few characters entered by a user?

Resolution

Here are the steps:

  1. Add a static parameter in the report.
  2. Add "% - All Records" for the first value.
  3. Insert all the other records from the database below the "%" field.
  4. Create a formula using the following for the first letter value prompt ("@frlVal"):

    {
    numberVar i;
    stringVar stVal;
    i:= Length({?My Parameter});
    stVal:= left({?My Parameter},i)
    }


  5. Create the following condition in Selection Formula > Records:

    {
    if trim({?My Parameter})<>"%" then
    (
    if {Customer.Customer Name} = {?My Parameter} then
    {Customer.Customer Name}={?My Parameter}
    else
    {Customer.Customer Name} startswith {frl@Val}
    )
    else
    true
    }

Keywords

How to select the records based on the first few characters entered by the user? , 9025642 , KBA , BI-RA-CR , Crystal Reports designer or BusinessViews Manager , How To

Product

Crystal Reports 2008 V0