Data Filtering in Multi-Source Report

  • Last update:  2024-06-14
  • Overview

    Version

    Report Server Version

    11.0

    Expected Effect

    After you learned simple multi-source reports, complex multi-source reports, and multi-source sliced reports, you may want to achieve data filtering in multi-source reports.

    For example, you may want to filter the data record of Chen Yu in the column Salesperson, as shown in the following figure.

    6a10e5ead1c80e91997b13b546432d8.png

    Implementation Method

    You can perform data filtering within the main table cell in multi-source reports.

    Example

    Data Preparation

    Create a dataset named ds1. The database query statement is SELECT * FROM SALES_BASIC.

    Create a dataset named ds2. The database query statement is

    SELECT * FROM SALES_COST where 1=1

    ${if(len(Salesperson)=0,""," and Salesperson = '"+Salesperson+"'")}

    Report Design

    Design a table according to the effect shown in the following figure and drag the fields from the two datasets into corresponding cells.

    17e404ab7358685d6636605226235d8.png

    The following table shows the cell settings.

    Cell

    Setting

    B2, B3

    Merge cells B2 and B3 and input Region into the merged cell.

    C2, C3

    Merge cells C2 and C3 and input Salesperson into the merged cell.

    E2, E3

    Merge cells E2 and E3 and input Selling Cost into the merged cell.

    D2

    Drag the data column Product types in dataset ds1 into cell D2. 

    Set Expansion Direction to Horizontal and Parent Cell Setting by default.

    D3

    Drag the data column Product in dataset ds1 into cell D3. 

    Set Expansion Direction to Horizontal and Parent Cell Setting by default.

    B4, C4, and D4

    Drag the data columns Region, Salesperson, and Sales Volume in dataset ds1 into cells B4, C4, and D4, respectively. 

    Set Expansion Direction to Vertical.

    E4

    Drag the data column Selling cost in dataset ds2 into cell E4. 

    Set Expansion Direction to Vertical and Left Parent Cell to cell C4.

    Filter Condition Setting

    1. Double-click cell B4 and click the Filter tab at the top of the dialog box to add two filter conditions.

    Condition one is a common condition, with the data column Salesperson in dataset ds1 equals to the data column Salesperson in ds2. Condition two is a formula condition, with the formula added as len($Salesperson) =0 to achieve the effect of selecting all when the parameter is empty. The two conditions are linked with or.

    The effect has been achieved in dataset ds2, but the data in cell B4 comes from dataset ds1, which may contain data not present in the dataset ds2. Therefore, condition two must be added to prevent the data in the main table from decreasing when the parameter is empty.

    40f389e7302ad081f18ba9c9570db06.png

    2. Double-click cell E4 and click the Filter tab at the top of the dialog box to add the filter condition as the data column Salesperson equals to  cell C4, as shown in the following figure.

    bfbbb086eab6984fc53ecbf20fdfc19.png

    Parameter Panel Setting

    Click the b52c2b43d56949f981495797b7df33d.png icon to go to the parameter panel editing page, click the Add All button, and set the widget in the middle to Number Widget, as shown in the following figure.

    8b2bc583e7710b4ad38772f49104548.png

    Effect Display

    PC

    Save the template and click Pagination Preview. The preview effect is shown in the following figure.

    33314553255234112312.gif

    Mobile Terminals

    The template can be previewed on both the DataAnalyst and HTML5 apps. The effect is shown in the following figure.

    3331455325523411231.gif

    Template Download

    Click to download the template: Data Filtering in Multi-Source Report.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