Style Conditional and INDIRECT(ADDRESS(ROW(); COLUMN()))

Topics: Developer Forum, User Forum
Nov 3, 2011 at 11:48 PM
Edited Nov 3, 2011 at 11:55 PM

I can't get this working:

 

	$conditional = new PHPExcel_Style_Conditional();
	$conditional->setConditionType(PHPExcel_Style_Conditional::CONDITION_EXPRESSION);
	$conditional->setOperatorType(PHPExcel_Style_Conditional::OPERATOR_NONE);
	//$conditional->addCondition('INDIRECT(ADDRESS(ROW(); 8))>=200');
	//$conditional->addCondition('INDIRECT(ADDRESS(ROW(); COLUMN()))="-"');
	$conditional->addCondition('INDIREKT(ADRESSE(ZEILE(); 8))>=200');
	$conditional->addCondition('INDIREKT(ADRESSE(ZEILE();SPALTE()))="-"');
	$conditional->getStyle()->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_DARKBLUE);
	$conditional->getStyle()->getFont()->setBold(true);
	$conditional->getStyle()->getFont()->setSize(8);
	//$conditional->getStyle()->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); //no effect

	//apply conditional
	$conditionalStyles = $workSheet->getStyle('L2')->getConditionalStyles();
	array_push($conditionalStyles, $conditional);
	$workSheet->getStyle('L2')->setConditionalStyles($conditionalStyles);

 

 

Excel 2007 says there's unreadable data which gets removed if I proceed. Then, it states that conditional formatting was removed.

Any help is appreciated a lot.

 

[EDIT] I used following Code before, didn't work either.

$conditional->setConditions(array('AND( COND1; COND2)'));
 

[EDIT2] PHPExcel 1.7.6, 2011-02-27 @ XAMPPlite 1.7.3 (win32)