我具有以下使用PHPSpreadsheet生成条件表达式的功能:
public function conditionAequalsB($a,$b,$cell,$color = \PhpOffice\PhpSpreadsheet\Style\Color::COLOR_GREEN,$setBold = true){
$objConditional = new \PhpOffice\PhpSpreadsheet\Style\Conditional();
$objConditional->setConditionType(\PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION);
echo '='.$a.'='.$b.'<br>';
$objConditional->addCondition('='.$a.'='.$b);
$objConditional->getStyle()->getFont()->getColor()->setARGB($color);
$objConditional->getStyle()->getFont()->setBold($setBold);
$this->addConditions($cell,$objConditional);
}
public function conditionAnotequalsB($a,$b,$cell,$color = \PhpOffice\PhpSpreadsheet\Style\Color::COLOR_RED,$setBold = true){
$objConditional = new \PhpOffice\PhpSpreadsheet\Style\Conditional();
$objConditional->setConditionType(\PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION);
echo '='.$a.'<>'.$b.'<br>';
$objConditional->addCondition('='.$a.'<>'.$b);
$objConditional->getStyle()->getFont()->getColor()->setARGB($color);
$objConditional->getStyle()->getFont()->setBold($setBold);
$this->addConditions($cell,$objConditional);
}
但是条件-看起来像这样:
='Trial Balance'!D12='Trial Balance'!E12
='Trial Balance'!D12<>'Trial Balance'!E12
产生以下错误:Balance Sheet!I10 -> 3D Range references are not yet supported
这在PHPExcel中有效,但由于某些原因在PHPSpreadsheet中似乎无效。我有什么需要改变的吗?
我没有使用过作曲家的版本,但根据更改日志,日期为## [1.1.0]-2018-01-28。是版本问题吗?我希望不必使用Composer。