Solution to Dislocation of Interlaced Colors During Report Splitting by Row

  • Last update:June 03, 2025
  • Overview

    Problem

    If you have configured Background Color Setting Every Other Row/Column and enabled Report Split in a report, you may encounter the dislocation of interlaced colors. You may want a solution to solve the issue and keep a consistent color in the same row, as shown in the following figure.

     0.png

    Implementation Method

    You can add a formula in Condition Attribute to achieve the effect.

    First, you should determine the columns requiring special processing based on the number of columns and total data. Then, you can adjust odd-numbered rows in these identified columns and set alternating row colors for all qualified rows.

    Example

    Data Preparation

    Create a general report, and create a database query ds1 with the SQL statement SELECT * FROM Sales_Volume.

     1.png

    Report Design

    1. Drag Salesperson, Product, and Sales_Volume data columns into cells A2 to C2. Design the table as shown in the following figure.

     2.png

    2. Select cell A2, and set Data Setting to List, as shown in the following figure.

     3.png

    Splitting Setting

    Choose Template > Report Split by Column/Row from the menu bar, and follow the steps on the opened report split page, as shown in the figure.

     4.png

    Condition Attribute Setting

    Select cell A2, add a condition attribute on the right attribute panel, set Attribute to Background, select blue as a color, and select Current Row from the drop-down list. Set Type to Formula, and enter the following formula:

    iconNote:
    Four conditions, which are connected by '&&' and '||', comprise the formula, and are calculated from left to right. When the report meets the requirement of Formula One, the background color is displayed according to Formula Two. When the report meets the requirement of Formula Three, the background color is displayed according to Formula Four.
    ROUNDUP(COUNT(A2[!0])/2,0)%2<>0&&(&A2+(1-ROUNDUP(&A2/ROUNDUP(COUNT(A2[!0])/2,0),0)%2))% 2=0||ROUNDUP(COUNT(A2[!0])/2,0)%2=0&&&A2%2=0

    The following table describes the formula.

    Category
    FormulaDescription

    Formula One

    A2[!0]

    All cells expanded from cell A2.

    COUNT(A2[!0])

    To count total rows in the current data.

    COUNT(A2[!0])/2

    To divide the total rows by the number of columns (2) to determine the number of rows per column.

    ROUNDUP(COUNT(A2[!0])/2,0)

    To apply the ceiling function to ensure an integer number of rows per column.

    ROUNDUP(COUNT(A2[!0])/2,0)%2<>0

    If the remainder of dividing the calculation result by 2 is not equal to 0, the number of the column is odd.

    Formula Two

    ROUNDUP(&A2 / ROUNDUP(COUNT(A2[!0])/2,0),0)

    To calculate the number of columns crossed by the current row.

    1-ROUNDUP(&A2/ROUNDUP(COUNT(A2[!0])/2,0),0)%2

    To adjust the offset based on whether the number of columns is even or odd.

    &A2+(1-ROUNDUP(&A2/ROUNDUP(COUNT(A2[!0])/2,0),0)%2)

    To add the current row number and the offset.

    (&A2+(1-ROUNDUP(&A2/ROUNDUP(COUNT(A2[!0])/2,0),0)%2))% 2=0

    To judge whether the number of rows is even after adjustment.

    Formula Three

    ROUNDUP(COUNT(A2[!0])/2,0)%2=0

    If the remainder of dividing the calculation result by 2 is equal to 0, the number of the column row is even.

    Formula Four

    &A2%2=0

    To judge if the number of the current row is even.

    The following figure shows the steps.

     5.png

    Effect Display

    PC

    Save the report and click Pagination Preview. The following figure shows the preview effect.

     6.png

    Mobile Terminal

    The report can be previewed on both the DataAnalyst app and the HTML5 terminal. The following figure shows the effect.

     7.jpg

    Template Download

    Attachment List


    Theme: Report Features
    Already the First
    Already the Last
    • 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