Forums

Export data to excel in v4

jmarian1 15 Mar, 2012
Hi Bob. I need help on how to use the CSV action to my form. I have a table shown in the webpage and I need the data to export it to either excel or CSV or PDF, whatever is available in chronoform but I don't know how to do it using the CSV action in v4. I read your instruction and because the way I pull the data from database is a custom code, I am not sure how to do it. I have if-else statement to show the data based on selection. My question is, is there a way to use the CSV export action for the district radio selection alone or do I need to hard code the export thing. Please help. Any suggestion is helpful. Thank you. You can see the form at https://www.auw.org/doe/search-school

Anyway, I have radio selection and based on selection, two different template will show with almost the same data. If I select the district from my radio button, and select the district name from the drop down menu like below,
[attachment=2]Screen Shot 2012-03-14 at 10.22.32 PM.png[/attachment]
the table will show like this:
[attachment=1]Screen Shot 2012-03-14 at 10.24.26 PM.png[/attachment]
and the data show is manually coded to connect to the database using the custom code in my onSubmit event like below:
[attachment=0]Screen Shot 2012-03-14 at 10.34.43 PM.png[/attachment]
jmarian1 17 Mar, 2012
Just checking if someone did this before. How to use the CSV action in the OnSubmit page where data are showing. Any help or idea is appreciated.
Max_admin 17 Mar, 2012
Hi Jmarian,

In case you need to alter the WHERE code of the action on the fly, you can use the code below in a custom code action BEFORE the CSV export action:


<?php
//assuming your CSV action id is 55 (the red number in the wizard)
$form->set('csv_export_gh_55', 'where', 'CUSTOM_WHERE_HERE');
?>


You should generate "CUSTOM_WHERE_HERE" using some PHP of course🙂

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jmarian1 17 Mar, 2012
Thanks Max! I will give it a try and will let you know the result.
This topic is locked and no more replies can be posted.