1

I want export an excel file using Laravel-Excel package and want excel cell have drop down menu . now i do this for one cell of column but i want do this for all cell of column except column title.

 AfterSheet::class => function (AfterSheet $event) {

        /** @var Sheet $sheet */
        $sheet = $event->sheet;

        /**
         * validation for bulkuploadsheet
         */
        
        $configs ="DUS800, DUG900+3xRRUS, DUW2100, 2xMU, SIU, DUS800+3xRRUS,
        // DUG900+3xRRUS, DUW2100";
        $objValidation = $sheet->getCell('A2')->getDataValidation();
     
        $objValidation->setType(DataValidation::TYPE_LIST);
        $objValidation->setErrorStyle(DataValidation::STYLE_INFORMATION);
        $objValidation->setAllowBlank(false);
        $objValidation->setShowInputMessage(true);
        $objValidation->setShowErrorMessage(true);
        $objValidation->setShowDropDown(true);

        $objValidation->setFormula1('"' . $configs . '"');

    }

using this part of code $objValidation = $sheet->getCell('A2')->getDataValidation(); i can create drop down only for one cell of A column but i want do this for all cell of column A except column title. Thanks

https://laravel-excel.com/

mkt
  • 51
  • 1
  • 9
  • 1
    https://stackoverflow.com/questions/29815227/laravel-excel-librarymaatwebsite-how-to-create-a-drop-down-list-in-exports Does this answer your question? – Aless55 Nov 04 '21 at 10:43
  • Thanks. I have used that answer . but that did not use range for cell . – mkt Nov 04 '21 at 10:52

0 Answers0