The code hide row through conditional formatting in the Websheet.

Post Reply
abcthing
Posts: 5
Joined: Thu Apr 30, 2020 1:15 am
OLAP Product: TM1
Version: 11.0.0.19
Excel Version: 2016

The code hide row through conditional formatting in the Websheet.

Post by abcthing »

1. demo
This test rule is hide the third row when A1=1.
hiderow2.gif
hiderow2.gif (416.68 KiB) Viewed 2198 times
2.method
(1) Modify the SheetRow class in the tm1webcore.jar.

Code: Select all

    public boolean isVisible() {
        //------add-----------
        for(SheetCell cell: m_Cells) {
             ConditionalStyle style =  cell.getConditionalStyle();
             if(style!=null) {
                  if(style.getStyle("backgroundColor").equals("transparent")) {
                        return false;
	          }
             }
        }
        //-------------------

        return this.m_Visible;
    }
(2) Modify your excel file, set background Color to no color for conditional formatting.
NEWTM1P0.jpg
NEWTM1P0.jpg (211.32 KiB) Viewed 2286 times
Last edited by abcthing on Tue Jun 30, 2020 7:15 am, edited 15 times in total.
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: The code implementations hide rows through conditional formatting in the Websheet.

Post by tomok »

An interesting idea. I just wish your examples were not in Chinese.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
abcthing
Posts: 5
Joined: Thu Apr 30, 2020 1:15 am
OLAP Product: TM1
Version: 11.0.0.19
Excel Version: 2016

Re: The code implementations hide rows through conditional formatting in the Websheet.

Post by abcthing »

I modified these pictures.
Post Reply