I'm running into the following problem.
Im trying to get some results from my database and I want to insert the results into a dropdown list.
In the examle file was the following example:
$objValidation->setFormula1('"Item A,Item B,Item C"');
so the results have to be comma seperated and the total results have to be between "".
Here is the code so far:
$configurations = Db::getInstance()->queryResults('SELECT * FROM configurations', array($siteNumber));
$objPHPExcel->getActiveSheet()->setCellValue('B7', "List:");
$configs = '"';
foreach($configurations as $config) {
$configs .= $config->configuration_name . ', ';
}
$configs .= '"';
$objValidation = $objPHPExcel->getActiveSheet()->getCell('B8')->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($configs);
Anybody has an idea why the dropdownlist does not get populated??
Thanks in advance!
Dump database results:
string(3100) "DUS800, DUG900+3xRRUS, DUW2100, 2xMU, SIU, DUS800+3xRRUS, DUG900+3xRRUS, DUW2100, 2xMU, SIU, DUS800+3xRRUS, DUG900+3xRRUS, DUW2100+3xRRUS, 2xMU, SIU, DUS800, DUG900+3xRRUS, DUW2100+3xRRUS, 2xMU, SIU, DUS800, DUS1800+3xRRUS, MU, SIU, DUS800+3xRRUS, DUS1800+3xRRUS, MU, SIU, DUS800, DUG900+3xRRUS, MU, SIU, DUS800+3xRRUS, DUG900+3xRRUS, MU, SIU, DUS800, MU, SIU, DUS800+3xRRUS, MU, SIU, DUS800, DUW2100, 2xMU, SIU, DUG900+3xRRUS, MU, DUS1800+3xRRUS, MU, SIU, DUW2100, MU, DUW2100+3xRRUS, MU, DUG900+3xRRUS, MU, DUG900+3xRRUS, DUW2100, 2xMU, DUG900+3xRRUS, DUW2100+3xRRUS, 2xMU, DUW2100, MU, DUW2100+3xRRUS, MU, RBS6102 DUS800+DUG900+DUW2100 outdoor+SIU, RBS6102hybrid DUS800+DUG900+DUW2100Remote outdoor+SIU, RBS6201 DUS800+DUG900+DUW2100 indoor+SIU, RBS6201hybrid DUS800+DUG900+DUW2100Remote indoor+SIU, RBS6102 DUS800+DUS1800 outdoor+SIU, RBS6201 DUS800+DUS1800 indoor+SIU, RBS6102 DUS800 outdoor+SIU, RBS6201 DUS800 indoor+SIU, RBS6102 DUS800+DUG900 outdoor+SIU, RBS6201 DUS800+DUG900 indoor+SIU, RBS6102 DUS1800 outdoor+SIU, RBS6201 DUS1800 indoor+SIU, RBS6102 DUG900+DUS1800 outdoor+SIU, RBS6201 DUG900+DUS1800 indoor+SIU, RBS6102 DUG900+DUW2100 outdoor, RBS6201 DUG900+DUW2100 indoor, RBS6102hybrid DUG900+DUW2100Remote outdoor, RBS6201hybrid DUG900+DUW2100Remote indoor, RBS6102 DUG900 outdoor, RBS6201 DUG900 indoor, RBS6102 DUW2100 outdoor, RBS6201 DUW2100 indoor, RBS6102 DUS1800+DUW2100 outdoor+SIU, RBS6201 DUS1800+DUW2100 indoor+SIU, Exp pakket G900 in RBS6102 UMTS, Exp pakket G900 in RBS6201 UMTS, Exp pakket G900 in RBS6102 LTE, Exp pakket G900 in RBS6201 LTE, Exp pakket U2100 in RBS6102 GSM, Exp pakket U2100 in RBS6201 GSM, Exp pakket U2100 in RBS6102 LTE, Exp pakket U2100 in RBS6201 LTE, Exp pakket U2100 in RBS6102 GSM/LTE, Exp pakket U2100 in RBS6201 GSM/LTE, Exp pakket U2100 OIL in RBS6102 GSM/LTE, Exp pakket L800 in RBS6102 GSM, Exp pakket L800 in RBS6201 GSM, Exp pakket L800 in RBS6102 LTE, Exp pakket L800 in RBS6201 LTE, Exp pakket L1800 in RBS6102 GSM, Exp pakket L1800 in RBS6201 GSM, Exp pakket L1800 in RBS6102 LTE, Exp pakket L1800 in RBS6201 LTE, expansie DUG1800+MU in Main-Remote, expansie DUG1800 in RBS6102, expansie DUG1800 in RBS6201, 3rd Carrier DUW2100 in bestaande Main-Remote met RBS6601 V1, 3th Carrier DUW2100 in bestaande Main-Remote met RBS6601 V2, 3rd Carrier DUW2100 in RBS6102, 3rd Carrier DUW2100 in RBS6201, Exp pakket add LTE1800 3x RRU, Exp pakket add LTE1800 3x RRU + 3x PSU 230V/48V, Exp pakket add LTE1800 3x RRU + 3x PSU 230V/48V + 1x DUS31, Exp pakket add LTE1800 3x RRU + 3x PSU 230V/48V + 1x DUS41, DU adapter frame t.b.v. RBS 6102, DU adapter frame t.b.v. RBS 6201, 3x DUMMY RUS t.b.v. ombouw macro naar OIL, 6x DUMMY RUS t.b.v. ombouw macro naar OIL, 1x PSU AC01 1,8kW incl bekabeling, 4x PSU AC03 2,5kW incl bekabeling, Battery set complete 1x RBS 6102, Battery set complete 2x RBS 6102, Battery set complete 1x MMC, Battery set complete 2x MMC, Battery set complete 1x RBS6102+1x MMC, Battery set complete 2x RBS6102+1x MMC, Battery set complete indoor 1 set, Battery set complete indoor 2 sets, Battery set complete indoor 3 sets"