diff --git a/Documentation/PHPExcel User Documentation - Reading Spreadsheet Files.doc b/Documentation/PHPExcel User Documentation - Reading Spreadsheet Files.doc index a85a316..06ee692 100644 Binary files a/Documentation/PHPExcel User Documentation - Reading Spreadsheet Files.doc and b/Documentation/PHPExcel User Documentation - Reading Spreadsheet Files.doc differ diff --git a/Documentation/markdown/ReadingSpreadsheetFiles/07-Reader-Options.md b/Documentation/markdown/ReadingSpreadsheetFiles/05-Reader-Options.md similarity index 100% rename from Documentation/markdown/ReadingSpreadsheetFiles/07-Reader-Options.md rename to Documentation/markdown/ReadingSpreadsheetFiles/05-Reader-Options.md diff --git a/Documentation/markdown/ReadingSpreadsheetFiles/05-Error-Handling.md b/Documentation/markdown/ReadingSpreadsheetFiles/06-Error-Handling.md similarity index 100% rename from Documentation/markdown/ReadingSpreadsheetFiles/05-Error-Handling.md rename to Documentation/markdown/ReadingSpreadsheetFiles/06-Error-Handling.md diff --git a/Documentation/markdown/ReadingSpreadsheetFiles/06-Helper-Methods.md b/Documentation/markdown/ReadingSpreadsheetFiles/07-Helper-Methods.md similarity index 100% rename from Documentation/markdown/ReadingSpreadsheetFiles/06-Helper-Methods.md rename to Documentation/markdown/ReadingSpreadsheetFiles/07-Helper-Methods.md diff --git a/Examples/15datavalidation-xls.php b/Examples/15datavalidation-xls.php index 22f7edc..2f8fa5e 100644 --- a/Examples/15datavalidation-xls.php +++ b/Examples/15datavalidation-xls.php @@ -62,7 +62,15 @@ $objPHPExcel->getActiveSheet()->setCellValue('A1', "Cell B3 and B5 contain data ->setCellValue('A3', "Number:") ->setCellValue('B3', "10") ->setCellValue('A5', "List:") - ->setCellValue('B5', "Item A"); + ->setCellValue('B5', "Item A") + ->setCellValue('A7', "List #2:") + ->setCellValue('B7', "Item #2") + ->setCellValue('D2', "Item #1") + ->setCellValue('D3', "Item #2") + ->setCellValue('D4', "Item #3") + ->setCellValue('D5', "Item #4") + ->setCellValue('D6', "Item #5") + ; // Set data validation @@ -93,6 +101,19 @@ $objValidation->setPromptTitle('Pick from list'); $objValidation->setPrompt('Please pick a value from the drop-down list.'); $objValidation->setFormula1('"Item A,Item B,Item C"'); // Make sure to put the list items between " and " !!! +$objValidation = $objPHPExcel->getActiveSheet()->getCell('B7')->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('$D$2:$D$6'); // Make sure NOT to put a range of cells or a formula between " and " !!! + // Set active sheet index to the first sheet, so Excel opens this as the first sheet $objPHPExcel->setActiveSheetIndex(0);