文字列を連結

  • 作成者:ayuan0625
  • 編集回数:7次
  • 最終更新:FRInternational 于 2021-03-31
  • I. Description

    In the process of setting up reports, we may often need to perform string splicing in cells. Some people may first reflect the use of the string splicing symbol '+'. Of course, this symbol is completely feasible for general string splicing. But if the content to be spliced is a digital string, then there is a problem. as the picture shows:

    1.png

    Note: The result we want to get is 0011201110, and the result obtained by ‘+’ splicing is 1201111

    II. Ideas

    The reason is that there is a mechanism in FR's formula processing. For the plus sign "+", if both sides are numeric strings, it will become a digital addition, and the result is the sum of two numbers.

    Example: The result of "001" + "1201110" is: "1201111" instead of: "0011201110".

    If you want to force the use of strings, you can use the string concatenation formula CONCATENATE(), and this problem will not exist.

    Formula 1: CONCATENATE("001", "1201110"), return result: "0011201110".

    Formula 2: CONCATENATE("abc", "def"), return result: "abcdef".

    III. Example

    1. Template Design

    1) Create a new normal report and set the formula in the cell, as shown in the figure below:

    Serial Number

    A(Formula)

    BC(Result)
    1"001" + "1201110"<====>="001" + "1201110"
    2CONCATENATE("001", "1201110")<====>=CONCATENATE("001", "1201110")
    3"00" + "1201110"<====>="00" + "1201110"
    4CONCATENATE("00", "1201110")<====>=CONCATENATE("00", "1201110")
    5"0" + "1201110"<====>="0" + "1201110"
    6CONCATENATE("0", "1201110")<====>=CONCATENATE("0", "1201110")
    7"abc" + "def"<====>="abc" + "def"
    8CONCATENATE("abc", "def")<====>=CONCATENATE("abc", "def")

    2)The content of the template is shown in the figure below:

    2.png


    2. Effect Preview

    1) PC

    Save the template and click Pagination Preview, as shown in the figure below:

    3.png

    2) Mobile

    4.png


    3. Summary

    1)'+' is fully applicable to the splicing of non-digital strings, but not applicable to digital strings;

    2) Concatenating strings with CONCATENATE() is compatible (recommended).

    IV. Template Download

    Click to download:

    String_CONCATENATE.cpt


    Attachment List


    Theme: FineReport 帳票実例
    既に最初
    既に最後
    • Helpful
    • Not helpful
    • Only read