A button to save in CSV

How to create a CSV export button that generates an empty file.

Overview

The issue occurs when the export event is triggered without first reading the data records.
Ensure the list records are read and loaded before calling the export CSV function.

Answered
Connectivity v6
ba barredespace 14 Dec, 2017
Hi,

I am totally new to ChronoConnectivity and may be missing something obvious but I read a lot of posts and couldn't find a clear answer to my problem.
I try to create a list with a button (or a link) to export it in CSV format.
I read this post in particular but still no joy.

What I achieved so far :
  • My list is displayed all right with the right titles and sortable columns,
    My export function is good which I checked by triggering it in my index event,
    Both button and plain link trigger a download but the resulting file is empty a part from columns titles


  • Here are some screenshots :
    A button to save in CSV image 1
    A button to save in CSV image 2
    A button to save in CSV image 3
    A button to save in CSV image 4
    A button to save in CSV image 5
    A button to save in CSV image 6

    I suspect I missed something in the link parameters, URL and/or content…

    Any help appreciated,
    thank you
    --
    Pascal
    Max_admin Max_admin 17 Dec, 2017
    Answer
    1 Likes
    Hi Pascal,

    The "export_CSV" event is a new page, it does not appear that you have read the records first before calling the "export_csv" function, please try to do that.

    Best regards
    Max, ChronoForms developer
    ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
    ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
    ba barredespace 18 Dec, 2017
    Ah ! Ok ! Thanks ! It's working now.
    (feeling a bit stupid right now)😲

    Regards,
    --
    Pascal
    This topic is locked and no more replies can be posted.