Multi-selection Fuzzy Search in a Drop-down Checkbox

  • Last update:August 10, 2026
  • Overview

    Problem Description

    In some scenarios, you may need to select multiple values in a drop-down checkbox and perform a fuzzy search based on each value, as shown in the following figure.

    1.1 问题描述.gif

    Solution

    The fuzzy search can be implemented using SQL statements, mainly with the LIKE operator or LIKE-like functions. The implementation varies among different databases, as described below.

    Fuzzy Search in Different Databases

    1. Oracle Database implementation

    The fuzzy search is implemented primarily using the regexp_like() function. Create a new data query (using the built-in emp table in the Oracle Database). The SQL statement is as follows:

    select * from emp where regexp_like(ename,'${ename}')

    iconNote:

    The query statement does not contain the % character.

    2. MySQL Database implementation

    The MySQL implementation is similar to Oracle, except it uses the rlike keyword. The SQL statement is as follows: select * from emp where ename rlike '${ename}'

    iconNote:

    The query statement does not contain the % character.

    Alternatively, you can use the regexp keyword. The SQL statement is as follows: select * from emp where ename regexp '${ename}'

    iconNote:

    The query statement does not contain the % character.

    3. SQL Server and other database implementations

    SQL Server does not have an equivalent keyword, so the traditional approach of string concatenation must be used. The SQL statement is as follows: select * from emp where ename like '%${ename}%'

    iconNote:

    1. The query statement contains the % character.
    2. This implementation applies not only to SQL Server but also to other databases.

    Example

    Template Design

    Data Preparation

    The FRDemo database (a SQLite database) is used here for demonstration.

    Create a new data query ds1. The SQL statement is SELECT * FROM Employe where Full_name like '%${Full_name}%', as shown in the following figure.

    3.1.1 数据准备.jpg

    Report Design

    Create a new general report. Drag the fields from the dataset ds1 into cells A2 to F2. The report body design style is as shown in the following figure.

    3.1.2 设计报表.jpg

    Parameter Panel Design

    1. Edit the parameter panel, click Add All, choose the drop-down checkbox as the parameter widget, and set Widget Value of the label widget to Full_name:, as shown in the following figure. 

    3.1.3_1设计参数面板.jpg

    2. Set Widget Name of the drop-down checkbox widget to Full_name, matching the name used within ${} in the data query ds1. Configure Data Dictionary. In the pop-up Data Dictionary window, set Type to Custom, and customize the actual values and display values.

    Set Returned Value's Type to String, and set Separator to %' or Full_name like '%. The following figure shows the settings.

    iconNote:

    The use of separators here depends on the database type. For details, refer to the SQL statements supported by the database and the way dataset parameters are defined. For example, in Oracle and MySQL databases, you can use | as the separator for the returned value's type, while in SQL Server and SQLite databases, you can use %' or Name like '% as the separator.

    3.1.3 设计参数面板_2.png

    Effect Preview

    1. PC

    Save the template and click Pagination Preview, as shown in the following figure.

    效果预览.gif

    2. Mobile terminal

    The preview effects on the DataAnalyst app and the HTML5 pages are the same, as shown in the following figure.

    移动端.gif

    Notes

    Problem description

    Save the template, click Pagination Preview, select multiple values for the query, and the following prompt appears.

    3.3 注意事项.jpg

    Solution

    The system has SQL injection prevention enabled. After evaluation, you can remove \b(?i)or\b from the list of Disabled Special Keyword, as shown in the following figure.

    3.3 注意事项_2.png

    Template Download

    Attachment List


    Theme: Parameter
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy