我已设法在我的excel文件中创建一个dropmenu,我使用以下代码生成该文件。
您能告诉我如何使用PHPExcel在整个列中添加datepicker吗?我在http://phpexcel.codeplex.com/中寻找了可能的解决方案,但没有找到任何解决方案。
$column = 'I';
$lastRow = 1000;
for ($row = 2; $row <= $lastRow; $row++)
{
$objValidation = $objPHPExcel->getActiveSheet()->getCell($column.$row)->getDataValidation();
$objValidation->setType( PHPExcel_Cell_DataValidation::TYPE_LIST );
$objValidation->setErrorStyle( PHPExcel_Cell_DataValidation::STYLE_INFORMATION );
$objValidation->setAllowBlank(false);
$objValidation->setShowInputMessage(true);
$objValidation->setShowErrorMessage(true);
$objValidation->setShowDropDown(true);
$objValidation->setErrorTitle('Input error');
$objValidation->setError('Value is not in list.');
$objValidation->setPromptTitle('Pick from list');
$objValidation->setPrompt('Please pick a value from the drop-down list.');
$objValidation->setFormula1('"M,F"');
}