Skip to content

Commit 2fe4ba7

Browse files
author
phpNT
authored
Update ExportController.php
1 parent 1f912bb commit 2fe4ba7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

controllers/ExportController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ public function actionExcel()
3030
$objPHPExcel->getActiveSheet()->setTitle($title ? $title : $modelName);
3131
$letter = 65;
3232
foreach ($fields as $one) {
33-
$objPHPExcel->getActiveSheet()->getColumnDimension(chr($letter))->setWidth(20);
33+
//$objPHPExcel->getActiveSheet()->getColumnDimension(chr($letter))->setWidth(20);
34+
$objPHPExcel->getActiveSheet()->getColumnDimension(chr($letter))->setAutoSize();
3435
$letter++;
3536
}
3637
$letter = 65;
@@ -370,4 +371,4 @@ private function getFieldsKeys($fieldsSended) {
370371
}
371372
return $fields;
372373
}
373-
}
374+
}

0 commit comments

Comments
 (0)