The Crystal Enterprise query language makes searching for Crystal Reports relatively easy. If you want to write a case
For instance, assume that you want to search for a Crystal Report that has the word "Cat" in it. One way to do this would be by using a SQL statement like this:
Select SI_ID From CI_INFOOBJECTS Where SI_PROGID = 'CrystalEnterprise.Report' And SI_INSTANCE = 0 And SI_NAME LIKE '%Cat%'
The LIKE operator in this statement is used to do a string comparison operation; the percentage characters (%) are wildcards. This creates a statement that selects all reports that have the substring "Cat" in their names. The comparison is case insensitive, which means that user can enter "Cat", "CAT", or "CaT": it does not matter.
Note: To create a case
Select SI_ID From CI_INFOOBJECTS Where SI_PROGID = 'CrystalEnterprise.Report' And SI_INSTANCE = 0 And SI_NAME LIKE '%[C][A][T]%'
The [] operator is basically an OR operator. If the LIKE statement is rewritten as '%[JKm]%' the search for this substring would pay attention to case: upper
Two pages follow the end of this lesson: the first, Searchform.csp, allows you to enter the name of the report you want to search for, and the second, Search.csp, searches for a report that includes that name as a substring.
Lesson 2e: Building a Home Page
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |