フィールド検証

  • 作成者:ayuan0625
  • 編集回数:9次
  • 最終更新:FRInternational 于 2021-01-08
  • I. Overview

    1. Problem description

    Field verification is to verify the field value. Only when the field value meets the preset formula conditions, can it pass the verification.

    For example, in front-end data verification, the reported data is matched with the existing data in a field of a server dataset.


    If the filled data is not included in the existing data in this field, a verification error message will pop up: "No match Region!" If the existing data can be matched, the verification is successful, as shown in the figure below:


    2. Implementation ideas

    Add built-in verification and use formula to verify cells.


    II. Examples

    1. Data preparation

    In the menu bar, click server > server dataset, create a new built-in data set Area, add a Region field to the table, and fill in two regions, as shown in the figure below:


    2. Design form

    Design the filling form, and add text control to A2 ~ E2 cells, as shown in the figure below:


    3. Setup submission

    In the menu bar, click template > Data Entry Attributes, create a new built-in SQL submission, and add the Sales_Volume Table in the database FRdemo, as shown in the following figure:


    3. Setting data verification

    In the menu bar, click template > Data Entry Attributes to create a new built-in verification condition, as shown in the following figure:

    Validation formula: inarray(A2, Area.group("Region"))>0

    Error information: "No match Region! "

    Note: the meaning of the verification formula is that the data filled in cell A2 should match the region column in the server data set area. If the filled data is included in the city, the verification passes; otherwise, the verification error message will pop up.


    4. Effect preview

    Save the report, click Data Entry Preview, fill in North China, click data validation, No error message shows.  If fill in South China, the verification fails with error message. As shown in the figure below:


    III. Template download

    Completed template, see %fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\DataEntry\DataEntryAttribute\FieldVerify.cpt

    Click download template: 

    FieldVerify.cpt


    Attachment List


    Theme: FineReport データ書き込み
    既に最初
    既に最後
    • Helpful
    • Not helpful
    • Only read