Prev
Level
ExcelExplorer Manual Next
Cell


EEColumn::IsEmpty

(ExcelExplorer 4.0)

Returns whether column is empty (contains at least one cell with actual data) or not.

boolean IsEmpty(  )
Parameters
None
Description

Returns TRUE if no cells with actual data (cells with type other than EE_CELL_EMPTY and EE_CELL_BLANK) is present in the specified column. Otherwise returns FALSE.

Note that all cells that belongs to the merged cells area are considered as non-empty. In the example below cell D3 contains text "merged" and cell E3 not contains actual data but within merged cells area - therefore this method called for the "E" column will returns FALSE (non-empty column).

Worksheet that used in the example below:

A B C D E F G
1
2 text
3 text merged
4 text
5
6
7

Print columns info - is it empty or not for the worksheet above


<?php


for( $i=0$i<7$i++ ) {
    echo 
'Column '.$i.' is ';
    echo 
$ee->Worksheet(0)->Column($i)->IsEmpty() ? 'empty' 'non-empty';
    echo 
"\n";
}

?>

Will output:

Column 0 is empty
Column 1 is non-empty
Column 2 is non-empty
Column 3 is non-empty
Column 4 is non-empty
Column 5 is empty
Column 6 is empty

 
Prev
Level
Home
Up
Next
Cell

 
© 2002-2009 EEPHP.com
All Rights Reserved.