Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excel export. Wont Work #809

Open
jagltoro opened this issue Nov 17, 2014 · 3 comments
Open

Excel export. Wont Work #809

jagltoro opened this issue Nov 17, 2014 · 3 comments

Comments

@jagltoro
Copy link

I need help on activating Excel export into AdminGenerator.
I installed "liuggio/excelbundle" but i dont know how to activate that, there's no documentation about that anywhere.

@bobvandevijver
Copy link
Member

Just add the
new Liuggio\ExcelBundle\LiuggioExcelBundle(),
to your AppKernel.php, than it should work fine.

More information about the Excel can be found in their own documentation, see https://github.com/liuggio/ExcelBundle.

@jagltoro
Copy link
Author

I did it.. but no link or button is showed.

AppKernel

  $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
            new Admingenerator\GeneratorBundle\AdmingeneratorGeneratorBundle(),
            new Knp\Bundle\MenuBundle\KnpMenuBundle(),
            new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
            new Knp\Bundle\SnappyBundle\KnpSnappyBundle(),
            new NoiseLabs\Bundle\NuSOAPBundle\NoiseLabsNuSOAPBundle(),
            new Liuggio\ExcelBundle\LiuggioExcelBundle(),          
        );

Generator.yml

generator: admingenerator.generator.doctrine
params:
    max_per_page: 20
    model: Ivss\CommonBundle\Entity\Oficinas
    namespace_prefix: Ivss
    concurrency_lock: ~
    bundle_name: AdministradorBundle
    pk_requirement: ~
    fields: 
        personas: {label: "Atención diaria (Personas)"}
        area: {label: Dirección, getter: generico}
    object_actions:
        delete: ~
    batch_actions:
        delete: ~
builders:
    list:
        params:
            title: List for AdministradorBundle
            display: [oficina,area,personas]
            actions:
                new: ~
            object_actions:
                edit: ~
                delete: ~
    excel:
        params: ~
        filename: ~
        filetype: ~
    filters:
        params:
            display: ~
    new:
        params:
            title: New object for AdministradorBundle
            display: ~
            actions:
                save: ~
                list: ~
    edit:
        params:
            title: "You're editing the object \"%object%\"|{ %object%: Oficinas.oficina }|"
            display: ~
            actions:
                save: ~
                list: ~
    show:
        params:
            title: "You're viewing the object \"%object%\"|{ %object%: Oficinas.title }|"
            display: ~
            actions:
                list: ~
                new: ~
    actions:
        params:
            object_actions:
                delete: ~
            batch_actions:
                delete: ~

What should i do for exporting the view into excel?

@bobvandevijver
Copy link
Member

Just add the excel action to the list actions. Small example:

  list:
    params:
      title: List for AdministradorBundle
      display: [oficina,area,personas]
      actions:
        new: ~
        excel: ~

This adds the Excel button next to the new button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants