Sunday 15 January 2012

php - Getting row value of last cell containing data in a Ms Excel file using PhpExcel -



php - Getting row value of last cell containing data in a Ms Excel file using PhpExcel -

i'm using phpexcel process ms excel file received customer. want row value of lastly cell containing info in file, use:

$sheet = $objphpexcel->getactivesheet(); $highestrow = $sheet->gethighestrow();

but $highestrow larger right value can see in file. when press "ctrl + end", focus moves 'blank' cell has row value equal $highestrow.

i don't understand how ms excel determines 'last cell'. anyway, need lastly cell contains data.

the gethighestrow() method homecoming highest row contains in sheet. include style information, images or other elements aren't cell content.

use gethighestdatarow() method highest row number cells have actual content. note blank space or null value in cell can qualify content.

php phpexcel

No comments:

Post a Comment