# Mautic plugin - export to CSV

**URL:** <https://forum.mautic.org/t/mautic-plugin-export-to-csv/23449>\
**Category:** Development\
**Tags:** development\
**Created:** [April 1, 2022, 8:18am UTC](https://forum.mautic.org/t/mautic-plugin-export-to-csv/23449 "2022-04-01T08:18:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rarita.king](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rarita.king/32/412_2.png) [@rarita.king](https://forum.mautic.org/u/rarita.king)\
**Post date:** [April 1, 2022, 8:18am UTC](https://forum.mautic.org/t/mautic-plugin-export-to-csv/23449/1 "2022-04-01T08:18:45Z")

</div>

Hello, everyone!  
I’m developing my first plugin for Mautic (I’m now to Mautic and Symfony).  
So far I managed to generate a custom report and display it. But now I want to export it to a CSV file and here I am stuck.  
What is the best way to implement an export?

---

<div class="post-metadata">

**Author:** ![pierre\_a](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pierre_a/32/7031_2.png) [@pierre\_a](https://forum.mautic.org/u/pierre_a)\
**Post date:** [April 1, 2022, 4:24pm UTC](https://forum.mautic.org/t/mautic-plugin-export-to-csv/23449/2 "2022-04-01T16:24:19Z")

</div>

Hello @rarita.king,

In the “Reports” section you can create your report, then you can export the results in CSV (via the button at the top right in the report details).

Does this help you?

Pierre

---

<div class="post-metadata">

**Author:** ![rarita.king](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rarita.king/32/412_2.png) [@rarita.king](https://forum.mautic.org/u/rarita.king)\
**Post date:** [April 1, 2022, 6:21pm UTC](https://forum.mautic.org/t/mautic-plugin-export-to-csv/23449/3 "2022-04-01T18:21:36Z")

</div>

That I know, but I created a plugin that gets me custom data from the database and I want to export this data to a CSV file.

---

<div class="post-metadata">

**Author:** ![pierre\_a](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pierre_a/32/7031_2.png) [@pierre\_a](https://forum.mautic.org/u/pierre_a)\
**Post date:** [April 1, 2022, 8:39pm UTC](https://forum.mautic.org/t/mautic-plugin-export-to-csv/23449/4 "2022-04-01T20:39:56Z")

</div>

@rarita.king you can create a file and write this file on server with .csv extension. 😉
