Page 1 of 1

The code hide row through conditional formatting in the Websheet.

Posted: Wed Jun 24, 2020 11:49 am
by abcthing
1. demo
This test rule is hide the third row when A1=1.
hiderow2.gif
hiderow2.gif (416.68 KiB) Viewed 2197 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 2285 times

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

Posted: Wed Jun 24, 2020 12:58 pm
by tomok
An interesting idea. I just wish your examples were not in Chinese.

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

Posted: Wed Jun 24, 2020 1:31 pm
by abcthing
I modified these pictures.