本文整理汇总了PHP中PHPExcel_Cell::getRangeBoundaries方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Cell::getRangeBoundaries方法的具体用法?PHP PHPExcel_Cell::getRangeBoundaries怎么用?PHP PHPExcel_Cell::getRangeBoundaries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPExcel_Cell
的用法示例。
在下文中一共展示了PHPExcel_Cell::getRangeBoundaries方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shrinkRangeToFit
/**
* Accepts a range, returning it as a range that falls within the current highest row and column of the worksheet
*
* @param string $range
* @return string Adjusted range value
*/
public function shrinkRangeToFit($range)
{
$maxCol = $this->getHighestColumn();
$maxRow = $this->getHighestRow();
$maxCol = PHPExcel_Cell::columnIndexFromString($maxCol);
$rangeBlocks = explode(' ', $range);
foreach ($rangeBlocks as &$rangeSet) {
$rangeBoundaries = PHPExcel_Cell::getRangeBoundaries($rangeSet);
if (PHPExcel_Cell::columnIndexFromString($rangeBoundaries[0][0]) > $maxCol) {
$rangeBoundaries[0][0] = PHPExcel_Cell::stringFromColumnIndex($maxCol);
}
if ($rangeBoundaries[0][1] > $maxRow) {
$rangeBoundaries[0][1] = $maxRow;
}
if (PHPExcel_Cell::columnIndexFromString($rangeBoundaries[1][0]) > $maxCol) {
$rangeBoundaries[1][0] = PHPExcel_Cell::stringFromColumnIndex($maxCol);
}
if ($rangeBoundaries[1][1] > $maxRow) {
$rangeBoundaries[1][1] = $maxRow;
}
$rangeSet = $rangeBoundaries[0][0] . $rangeBoundaries[0][1] . ':' . $rangeBoundaries[1][0] . $rangeBoundaries[1][1];
}
unset($rangeSet);
$stRange = implode(' ', $rangeBlocks);
return $stRange;
}
示例2:
$xfIndex = self::_GetInt2d($recordData, $offset);
// offset: var; size: 4; RK value
$numValue = self::_GetIEEE754(self::_GetInt4d($recordData, $offset + 2));
$cell = $this->_phpSheet->getCell($columnString . ($row + 1));
if (!$this->_readDataOnly) {
// add style
$cell->setXfIndex($this->_mapCellXfIndex[$xfIndex]);
}
// add cell value
$cell->setValueExplicit($numValue, PHPExcel_Cell_DataType::TYPE_NUMERIC);
}
$offset += 6;
}
}
/**
* Read NUMBER record
* This record represents a cell that contains a
* floating-point value.