Cloning Validation => No output

Topics: Developer Forum, User Forum
Feb 27, 2009 at 1:43 PM
Hello,

First of all: I'm using PHPExcel SVN version 25510 in combination with PHP 5.2.6 (ubuntu version)

My problem:
When I clone a cell validation, php won't give me any output:
<?php
set_include_path(get_include_path() . PATH_SEPARATOR . '../functies/');
include 'PHPExcel.php';
include 'PHPExcel/IOFactory.php';

$report = new PHPExcel();

$report->setActiveSheetIndex(0);

$objValidation = $report->getActiveSheet()->getCell('B3')->getDataValidation();
$objValidation->setType( PHPExcel_Cell_DataValidation::TYPE_DECIMAL );
$objValidation->setErrorStyle( PHPExcel_Cell_DataValidation::STYLE_STOP );
$objValidation->setAllowBlank(true);
$objValidation->setShowInputMessage(true);
$objValidation->setShowErrorMessage(true);
$objValidation->setErrorTitle('Fout bij ingeven');
$objValidation->setError('Uw invoer is niet geldig. De punten moeten tussen 0 en 10 liggen.');
$objValidation->setPromptTitle('Geldige invoer');
$objValidation->setPrompt('Enkel cijfers tussen 0 en 10 zijn toegelaten.');
$objValidation->setFormula1(0);
$objValidation->setFormula2(10);
$report->getActiveSheet()->getCell('B3')->setDataValidation($objValidation);

$report->getActiveSheet()->getCell('B4')->setDataValidation(clone $objValidation);

header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="myfile.xlsx"');
header('Cache-Control: max-age=0');

$objWriter = PHPExcel_IOFactory::createWriter($report, 'Excel2007');
$objWriter->save('php://output');
?>


Developer
Feb 28, 2009 at 1:46 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.