Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我可以使用PhpSpreadsheet创建多选下拉列表吗?_Php_Phpexcel_Phpspreadsheet - Fatal编程技术网

我可以使用PhpSpreadsheet创建多选下拉列表吗?

我可以使用PhpSpreadsheet创建多选下拉列表吗?,php,phpexcel,phpspreadsheet,Php,Phpexcel,Phpspreadsheet,是否可以创建多选下拉列表 Excel允许使用VBA创建下拉列表选项,但我没有找到生成Excel的选项,并使用PhpSpreadsheet添加了multiselect下拉列表 我发现样本只有一个下拉列表 $validation = $spreadsheet->getActiveSheet()->getCell('B5')->getDataValidation(); $validation->setType( \PhpOffice\PhpSpreadsheet\Cell\Da

是否可以创建多选下拉列表

Excel允许使用VBA创建下拉列表选项,但我没有找到生成Excel的选项,并使用PhpSpreadsheet添加了multiselect下拉列表

我发现样本只有一个下拉列表

$validation = $spreadsheet->getActiveSheet()->getCell('B5')->getDataValidation();
$validation->setType( \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_LIST );
$validation->setErrorStyle( \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION );
$validation->setAllowBlank(false);
$validation->setShowInputMessage(true);
$validation->setShowErrorMessage(true);
$validation->setShowDropDown(true);
$validation->setErrorTitle('Input error');
$validation->setError('Value is not in list.');
$validation->setPromptTitle('Pick from list');
$validation->setPrompt('Please pick a value from the drop-down list.');
$validation->setFormula1('"Item A,Item B,Item C"');

您找到解决方案了吗?对不起,我没有找到phpspread的任何解决方案。目前,我正在用分号导出并在excel中手动调整。phpexcel无法使用vba代码,不知道PHPSReadSheetCorrect,因此,用户导出文件并直接在excel中进行设置。我没有找到其他解决办法。