Export XLS does not have Association Mapping fields

361 views
Skip to first unread message

full_metal

unread,
May 22, 2012, 6:00:16 PM5/22/12
to sonata...@googlegroups.com
Dear Sonata Users,

The current export to XLS functionality works great out of the box. 
However, we have a very strong necessity to have the associated ID columns of referenced entities too. 

Example: I have a Transaction entity with a ManyToOne mapping with User entity. 

When I export to XLS, I get all the columns in the transactions table but I don't get the user_id column which is a foreign key. 

Can this be achieved? I have already tried an EAGER fetch, but it didn't help 

If it can't work out of the box or with a small tweak, whats the best alternative to get the data I want?

Thanks,
Amit

Thomas Rabaix

unread,
May 23, 2012, 4:14:02 AM5/23/12
to sonata...@googlegroups.com
This feature is not supported. However you can create a custom SourceIteratorInterface (https://github.com/sonata-project/exporter/blob/master/lib/Exporter/Source/DoctrineORMQuerySourceIterator.php)

The instance is returned by the Admin::getDataSourceIterator()



--
You received this message because you are subscribed to the Google Groups "sonata-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sonata-users/-/rTEdeZ2keg0J.
To post to this group, send email to sonata...@googlegroups.com.
To unsubscribe from this group, send email to sonata-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sonata-users?hl=en.



--
Thomas Rabaix
http://rabaix.net | http://sonata-project.org

diszo

unread,
Aug 16, 2012, 4:01:01 AM8/16/12
to sonata...@googlegroups.com
Hi Amit,

Here's the temporary solution of your problem.


Look on my previous post.

Saif Rehman

unread,
May 2, 2018, 9:43:46 AM5/2/18
to sonata-users
Thomas Rabaix, 
1) I want to customize the export query . 
2) I also want to export non-entity data with joins. is there is any way. kindly guide em.
3) Also how can I reuse the sonata admin export in my custom controller. (in my custom controller action I want to reuse sonata exporter to export the data . )

Any help Is much appreciated.
Reply all
Reply to author
Forward
0 new messages