symfony2admingenerator / GeneratorBundle

Admingenerator for Symfony. Parse YAML files to build customized backend.
MIT License
67 stars 29 forks source link

[Feature] multi-report excel builder #262

Closed ksn135 closed 8 years ago

ksn135 commented 8 years ago

Sometimes you need to export same list in several different excel formats. May be we should extend admin generator for such cases? Proposed new featured "multi-report" excel builder format:

builders:
    excel:
        params: 
            export:  # changed by @bobvandevijver proposal
               full:
                  credentials: 'hasRole("ROLE_ADMIN")'        
                  icon:   fa-files-o 
                  label:  Full report
                  filename: ~
                  filetype: ~
                  datetime_format: ~
                  fields: ~
                  display: 
                    - id
                    - guid
                    - dirty
                    - textState
                    - kind
                    - fullName
               short:
                  credentials: 'hasRole("ROLE_A")'        
                  icon:   fa-file-excel-o
                  label:  Short report
                  display: 
                    - id
                    - textState
                    - fullName
               simple:
                  credentials: 'hasRole("ROLE_B")'        
                  icon:   fa-table
                  label:  Simple report
                  fields:
                    fullName:
                      label:  List of items
                  display: 
                    - fullName

1) For each report new route auto-generated (/excel/) 2) Draw dropdown menu with all available reports for current user 3) Each report is independent and fully customisable Let's discuss it!

bobvandevijver commented 8 years ago

For the sake of non-BC breaking, I would like to propose a new param: exports. So, if you are in need of multiple exports, you use exports instead of the proposed display, while when export is not given, the older display is used.

Furthermore it should also inherit the defaults from the list (it still extends that). So you're not required to supply everything again. It should even be possible that the file name is inherited from the defaults, such that the different exports can have te same name (for when every one sees one export possibility for example).

I would say, lets do this :+1:

bobvandevijver commented 8 years ago

Closed with #264.