Hide cell by conditional formatting

  • Last update:  2021-01-18
  • I. Description

    When making a template, it is often encountered to decide whether the content of an area is displayed according to a certain condition (this content can be a data table, chart, embedded sub report, etc.). How to achieve this?

    For example, in pagination preview, if you select the parameter as order information, you can see that the subreport of 'order detail' is not displayed. When you select order detail, the subreport of order information is not displayed, as shown in the following figure:

    Kapture 2021-01-18 at 14.22.55.gif

    II. Implementation ideas

    It can be achieved by setting the row height or column width of the conditional formatting, and judge whether to hide the cells in the range according to the condition.

    III. Examples

    1. Creating three reports

    You can download from the template. There are two subreports and one main report. The dataset used for subreports is Orders and Ordersdetail.


    2. Adding parameters

    Add a report parameter named info to the template, and add a drop-down box widget in the parameter interface. The widget name of the parameter is info, the parameter value is custom and the actual value and display value are order information and order detail respectively, as shown in the following figure:

    2.png


    3. Conditional formatting setting

    Add conditional formatting as shown in the figure below to A4 cell where order information is located:

    3.png

    Then add a conditional formatting with row height: 0mm to cell A7 where the order detail is located, and fill in the formula: $info ='order information' , that is, when the parameter information value is 'order information', the line will be hidden.

    截屏2021-01-18 下午2.33.11.png

    Save the template and preview in pagination to see the effect in I.Description.


    IV. Template download

    For completed templates, please refer to:

    %fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\ReportApplication\FeaturesApplication\HidCell.cpt

    %fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\ReportApplication\FeaturesApplication\Ordersinfo.cpt

    %fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\ReportApplication\FeaturesApplication\OrderDetails.cpt

    Click to download the template:

    Main report: 

    HidCell.cpt

    Sub reports:

    OrderDetails.cpt

    OrdersInfo.cpt


    Attachment List


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