Displayed and Actual values

  • Last update:  2022-02-10
  • I. Overview

    1. Version

    Rreport server version
    10.0

    2. Expected effect

    In the original data table, the encoded data is saved, while in the data presentation, the actual values need to be displayed, while the encoding and values are often saved in another table.

    For example, in the ordersdetail table of the built-in FRDemo database, there is only  ProductID, and the corresponding ProductName is in the products table. You want to display the product ID in the order details report as the corresponding product name, as shown in the following figure:

    截屏2021-01-22 下午4.49.54.png



    3. Implementation ideas

    1) Method 1: set the actual value and display value by using the display setting in cell attributes

    2) Method 2: using function split and combining with display setting.

    II. Method 1: Data Dictionary

    There are 4 types of data dictionary, including "database table, data query, customization, formula", which will correspond to different application scenarios. For details, please refer to: Data dictionary .

    1. Report design

    Create a new data set DS1, write the SQL query statement select * from ordersdetail in the database query.

    Design the table as following:

    截屏2021-01-25 下午2.12.38.png


    2. Setting up the data dictionary

    Select the cell of ProductID data column, select cell attributes > Form > data dictionary, set the actual value as the ProductID column in the customer table, and display the value as the ProductName column in the Products table, as shown in the following figure:

    截屏2021-01-25 下午1.39.45.png


    3. Save and preview

    Save the template and click preview. The effect is as expected in I.2.


    III. Method 2: formula setting

    1. Application scenarios

    When there are multiple products in a cell and it is separated by a symbol, the above method can not achieve the final effect.

    The actual results are not in accordance with the requirements. In this case, you can achieve the following result.

    1.png


    2. Report design

    Add the following two built-in dataset:

    截屏2021-01-25 下午2.23.07.png截屏2021-01-25 下午2.23.15.png

    Design the table as following:

    截屏2021-01-25 下午2.29.26.png

    Set the formula in cell C2: = split (B2, ","), and add the display setting which reference to Method 1.

    截屏2021-01-25 下午1.54.08.png

    2) Set C2 cell expansion direction: none, parent cell: default.

    3) Set D2 cell expansion direction: vertical, left parent cell: B2.


    4) Right click column B to hide.

    截屏2021-01-25 下午1.55.16.png


    3. Save and preview

    Save the template and click preview. The effect is as III.1.

    IV. Template download

    For completed templates, please refer to:

    %fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\ReportDesign\Displayed-Actual1.cpt

    %fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\ReportDesign\Displayed-Actual2.cpt

    Click to download the template:

    Displayed-Actual1.cpt

    Displayed-Actual2.cpt

    Attachment List


    Theme: Report Application
    • 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