1- The main idea is taken from [ XlsxWriter.php] ( https://gist.github.com/kunicmarko20/e0292280344761efbc7ff376f7080fec ) .
1+ # Symfony export xlsx
2+
3+ The main idea is taken from [ XlsxWriter.php] ( https://gist.github.com/kunicmarko20/e0292280344761efbc7ff376f7080fec ) .
24
35Except:
46- PHPOffice\PHPExcel has been replaced with PHPOffice\PhpSpreadsheet;
57- The class is used as a service to be able to use it anywhere and make changes to the file.
68
7- ![ ] ( https://img.shields.io/badge/license-MIT-green )
9+ ![ license-MIT-green ] ( https://img.shields.io/badge/license-MIT-green )
810
9- 0 . [ Install] ( #Install )
10- 1 . [ Use Service] ( #Use-Service )
11- 2 . [ Customization] ( #Customization )
12- 3 . [ Use in SonataAdmin Export] ( #Use -in-SonataAdmin-Export )
13- 4 . [ Errors] ( #Errors )
11+ 0 . [ Install] ( #install )
12+ 1 . [ Use Service] ( #use-service )
13+ 2 . [ Customization] ( #customization )
14+ 3 . [ Use in SonataAdmin Export] ( #use -in-sonataadmin-export )
15+ 4 . [ Errors] ( #errors )
1416
15- # Install
17+ ## Install
1618
1719Run:
1820
@@ -34,7 +36,7 @@ composer update
3436php composer.phar update
3537```
3638
37- # Use Service
39+ ## Use Service
3840
3941| Method | Parameters | Return | Description |
4042| ----------------| :---------:| :---------:| :----------------|
@@ -83,9 +85,9 @@ class ExportController extends AbstractController
8385 }
8486}
8587```
86- ![ ] ( doc/0000.PNG )
88+ ![ Example of a result ] ( doc/0000.PNG )
8789
88- # Customization
90+ ## Customization
8991
9092| Method | Return | Official Documentation |
9193| ----------------| :---------:| :----------------|
@@ -148,9 +150,9 @@ public function index(): Response
148150}
149151```
150152
151- ![ ] ( doc/0001.PNG )
153+ ![ Example of a result ] ( doc/0001.PNG )
152154
153- # Use in SonataAdmin Export
155+ ## Use in SonataAdmin Export
154156
155157Install if missing ` SonataExporterBundle `
156158``` bash
@@ -189,15 +191,15 @@ protected function configureExportFields(): array
189191}
190192` ` `
191193
192- # Errors
194+ # # Errors
193195
194196If you see the error :
195- ` ` `
197+ ` ` ` log
196198Attempted to call an undefined method named "toIterable" of class "Doctrine\O RM\Q uery"
197199` ` `
198200Then make sure that the __`doctrine/orm`__ version is __`2.8`__ or __higher__.
199201
200202You may need to update :
201203- sonata-project/admin-bundle : ~`3.*`
202204- sonata-project/doctrine-orm-admin-bundle : ~`3.*`
203- - doctrine/doctrine-bundle : ~`^2.3`
205+ - doctrine/doctrine-bundle : ~`^2.3`
0 commit comments