Forums

Export CSV

BrunoPigi 03 Apr, 2024
I've created a form for downloading a database table as a CSV file. It consists of a submit button with a 'read DB' action, followed by a page with a 'CSV export' option.
Everything works, but the form freezes after the download. I'll attach some screenshots.
Do you have any experience with 'CSV export'?
Screenshot 2024-04-03 alle 16.41.41.jpg
Max_admin 03 Apr, 2024
Answer
Hi Bruno

Any download action will terminate anything after it and the page will freeze, always place the download action last

it's also better if you add a link to another form where the download occurs so that the user can click the link to download
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
BobN 22 Apr, 2024
1 Likes

Bruno,

If you email me at webmaster@friendsofsilverbrook.org, I'll send you screenshots of how I set up the download for CSV on this page: Photos To Reshoot (friendsofsilverbrook.org).

After getting stuck with the Download option, I took a different approach. I save the CSV file to disk upon entering the form.  Then I have a button that references the CSV file.  For 1,000 rows it's fast enough.

Thanks,

--Bob.

BrunoPigi 31 Jul, 2024

Hi Bob, sorry for the delayed response. Your solution is good, but it doesn't fit my needs. I tried creating a PHP script for downloading the CSV. It works, but I still have the issue of the page freezing (a refresh fixes it though). Here’s the script; it has the advantage of exporting all table fields without having to define them beforehand.

As you’ll see, I also tried redirecting to a page after the download, but it still freezes. :)

lollymaster 22 Aug, 2024

Ciao @BrunoPigi ,

per caso sei riuscito a risolvere in qualche modo?

Io ho lo stesso tuo problema, ma la pagina rimane freezata anche se inserisco redirect in javascript o php.

Grazie,lorenzo.

Max_admin 23 Aug, 2024

The easiest way to do this is to do a redirect with a "delay", the redirect should be to the page with the download, in some cases this page should be a different form

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
lollymaster 23 Aug, 2024

Hi Max,

thanks for your reply, but i don't know if i undestand your suggestion.

Now i have a page with a submit button that refrs at the submit page where i locate the php script.

I tried to put a redirect with 5 seconds before the php script but when the page breaks down, the redirect doesn't work.

Can you please explain step by step your suggestion?

Thanks a lot,

Lorenzo.

Max_admin 15 Oct, 2024

the delayed redirect may not work if the page "breaks down", why does the page break down ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.