Dynamic grouped by section

  • Last update:  2021-04-06
  • I. Overview

    1. Expected effect

    In the document Grouped by Section, through "Group>Advanced>Custom>Conditional Grouping", grouping and summarizing by fixed age group is realized. Now we hope to realize the data grouping dynamically according to different segment length parameters. Results as shown below:

    1.gif


    2. Realization ideas

    This can be achieved by "Group> Advanced> Custom> Formula Grouping" in "Cell Element> Data Setting".

    II. Example

    1. Data preparation

    Create a new normal report, create a new dataset ds1, the SQL query statement is:

    SELECT Age,count(1) as Count FROM EmployeeInformation group by Age. As shown below:

    2.png


    2. Report design

    1) The design table is shown in the figure below:

    3.png

    2) Set the data of cell B2 to "Summary>Sum", as shown in the figure below:

    4.png


    3. Parameter pane setting

    1) Drag in a "label widget" and "number widget" in the parameter pane, set the widget value of the "label widget" to "Section length:"; the widget name of the "number widget" is "num", and the label name is "section length:". As shown below:

    5.png

    6.png

    2) Click "Predefined Widget" and drag the "Query Button" into the parameter pane, as shown in the figure below:

    7.png


    4. Group setting

    Select cell A2, set the data to "Group>Advanced>Custom>Formula Grouping", select the display mode as "Ordinary Grouping", enter the formula in the custom value: "["+((roundup($$$/$num )-1)*$num+1)+"~"+(roundup($$$/$num)*$num)+"]"

    The formula description is as follows:

    FormulaDescription

    ROUNDUP()

    Move away from the zero value and round the number upward (the direction in which the absolute value increases).

    $$$The actual value of the current cell
    $numSection length parameter
    "["+    +"]"Concatenate brackets [], or not write

    The steps are shown in the figure below:

    8.png


    5. Effect preview

    Save the report and click "Pagination Preview". The effect is the same as the expected effect in section I.1.

    Note: Both App and HTML5 are supported.

    III. Template download

    Refer to completed template:%FR_HOME%\webroot\WEB-INF\reportlets\doc-EN\ReportApplication\BasicApplication\Dynamic_grouped_by_section.cpt

    Click to download:

    Dynamic_grouped_by_section.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