Conditional Filling by Blank Rows

  • Last update:September 12, 2024
  • Overview

    Problem

    The existing filling-by-blank-rows function can only allow you to fill a page by blank rows until the row quantity on the page reaches the minimum multiple of the specified row quantity. How can you fill the page in certain conditions?

    For example, fill the page until the row quantity is seven when data on the page is not sufficient to occupy seven rows, and display the expanded rows when data on the page occupies at least seven rows.

    根据条件补足空白行 图1.gif

    Solution

    Method 1: Use the Complement function and set a condition attribute to hide the row height when data occupies more than seven rows.

    Method 2: When data occupies less than seven rows, fill the page until the row quantity is seven using a formula. When data occupies more than seven rows, no expansion is performed.

    Example

    Data Preparation

    Create a general report and create a data query named ds1. The SQL statement is as follows:

    SELECT * FROM SALES_BASIC$ {if(len(Quantity)=0,"","limit "+Quantity)}

    iconNote:
    The parameter here is Quantity, which is used with limit to limit the row quantity during data query.

    根据条件补足空白行 图2.png

    Table Design

    Design the table, drag required fields into cells, and set Data Setting to List for cell A2 where Region is located, as shown in the following figure.

    根据条件补足空白行 图3.png

    Widget Adding

    Add the Quantity parameter to the parameter panel, selet Number Widget as the widget type of Quantity, and set the widget value to 3, as shown in the following figure.

    根据条件补足空白行 图4.png

    Method 1: Filling by Blank Rows

    1. Select cell A2, choose Cell Element > Advanced on the right attribute panel, tick Complement, and set Row Quantity to 7, as shown in the following figure.

    根据条件补足空白行 图5.png

    2. Select cell A2 and click Condition Attribute on the right attribute panel. To add a condition attribute about the row height, set Formula to &A2>7&&LEN(A2)=0 and Row Height to 0, as shown in the following figure. Through this formula, the row height will be 0 when the condition is met.

    iconNote:
    The formula is used to hide all blank data added in rows 8 and above.

    根据条件补足空白行 图6.png

    Method 2: Filling Using a Formula

    1. Insert a blank column in the front of the table, set Expansion Direction to Vertical for cell A3, and insert the formula if(count(B2) < 7, RANGE(1, 7 - COUNT(B2)), 0).

    根据条件补足空白行 图7.png

    2. Select cell A3 and add a condition attribute about the row height in Common Condition. That is to say, when the current value is equal to 0, the row height is 0 (so that the row is hidden), as shown in the following figure.

    根据条件补足空白行 图8.png

    3. Hide column A.

    Effect Display

    PC

    Save the template and click Pagination Preview. The effect is the same as that shown in section "Problem."

    Mobile Terminal

    The template can be previewed on both the DataAnalyst and HTML5 apps. The following figure shows the display effect.Condtional Filling by Blank Rows-Method 1.cpt

    根据条件补足空白行 图9.gif

    Template Download

    Attachment List


    Theme: Report Application
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    5s后關閉

    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