我有一个带有shedule的excel文件。它看起来像这样:
我需要获得当天的单元格值: john 8
我找到了示例,如何显示xls文件:
SqlDataReader userInfo = User.staffInfo("StaffCode, GroupIDs, Perms", User.getUsername());
string staffCode = userInfo["StaffCode"].ToString());
但我无法获得价值......
答案 0 :(得分:0)
我改变了代码,所有工作都是:
$intN = 0;
foreach($aSheet->getRowIterator() as $row){
$cellIterator = $row->getCellIterator();
$cellIterator->setIterateOnlyExistingCells(true);
// Iterate over the individual cells in the row
foreach ($cellIterator as $cell) {
$intN++;
// Display information about the cell object
if ($intN == $dateD){
echo 'Cell ' , $cell->getCoordinate();
echo ' is ' , $cell->getValue() , '<br />';
}
}
$intN = 0;
}