Hi the community !
I have a client who want to be able to export the a certain number of row from the database saving of is forms but for the moment, when I check for example 3 record and press on backup to Excel I still have all the record exported and not just the 3 checked... Is it possible to do that ?
TO help you understand :
- I have 3 contact forms that work perfectly
- The 3 forms saves data in the database, in 3 differents table
- I need to export every week (manualy for the moment) all the new entry to add them to a Excel file to help him managing is contacts.
Thanks a lot !
I have a client who want to be able to export the a certain number of row from the database saving of is forms but for the moment, when I check for example 3 record and press on backup to Excel I still have all the record exported and not just the 3 checked... Is it possible to do that ?
TO help you understand :
- I have 3 contact forms that work perfectly
- The 3 forms saves data in the database, in 3 differents table
- I need to export every week (manualy for the moment) all the new entry to add them to a Excel file to help him managing is contacts.
Thanks a lot !
Hi Mushr00m ,
You can't use the built-in Excel export for this (it always exports all records) but you can hand code a little form to select the new records and export those. Or you could simply use PHPMyAdmin with a simple MySQL query and esport the result set.
Bob
You can't use the built-in Excel export for this (it always exports all records) but you can hand code a little form to select the new records and export those. Or you could simply use PHPMyAdmin with a simple MySQL query and esport the result set.
Bob
Yes I think the PhpMyAdmin is the simpliest way, but it must be realy easy to use because it's for a person that don't know anything about coding....
Hi Mushr00m,
Well, the easiest way for **the user** is a form with a button that says 'Click me'.
You can make the form with access for specified users only and set the OnSubmit Code to run a query to extract the new records and save them to an Excel file. If I do this I usually then run a second query to flag the exported records in the table to make it easier to pick out the new ones for the next run.
Bob
Well, the easiest way for **the user** is a form with a button that says 'Click me'.
You can make the form with access for specified users only and set the OnSubmit Code to run a query to extract the new records and save them to an Excel file. If I do this I usually then run a second query to flag the exported records in the table to make it easier to pick out the new ones for the next run.
Bob
Don't you think it's possible to use the checkboxes in the "table manager" to choose witch entries to backup ? They are already in the form to backup but they are not use for chossing the entries to backup... I don't know where to look to modify that.
It would be realy usefull beacause the component backup all the entries at one time, and being able to just check the one we want to export would be perfect !
It would be realy usefull beacause the component backup all the entries at one time, and being able to just check the one we want to export would be perfect !
Hi Mushr00m,
Not easily, it's still easier to build a custom form in the front-end. :-(
Bob
Not easily, it's still easier to build a custom form in the front-end. :-(
Bob
I was afraid you said that !🙂
I don't want to abuse, but do you know the code that I have to use to do so (in the onsubmit) ?
I don't want to abuse, but do you know the code that I have to use to do so (in the onsubmit) ?
Hi !
So I looked into the code that create the Excel file and I find a way to export just some entries in the XLS file. In my case I just want to export the last entries from the 30 last days. Here is the code that I change in admin.chronocontact.php function BackupExcell :
This :
To :
Maybe it can help somebody else !
If you still have the peace of code to use to create a custom form for the front-end to do the same thing I totaly want it to have the possibility to choose the number of day to export.
So I looked into the code that create the Excel file and I find a way to export just some entries in the XLS file. In my case I just want to export the last entries from the 30 last days. Here is the code that I change in admin.chronocontact.php function BackupExcell :
This :
$database->setQuery( "SELECT * FROM ".$tablename."" );
To :
$dateToday = date ( 'Y-m-j');
$dateLimit = strtotime ( '-30 day' , strtotime ( $dateToday ) ) ;
$dateLimit = date ( 'Y-m-j' , $dateLimit );
$dateLimit = $dateLimit." 00:00:00";
$database->setQuery( "SELECT * FROM ".$tablename." WHERE recordtime > '".$dateLimit."'" );
Maybe it can help somebody else !
If you still have the peace of code to use to create a custom form for the front-end to do the same thing I totaly want it to have the possibility to choose the number of day to export.
Hi Mushr00m,
Sorry - to busy at the moment to write export code :-(
Bob
Other readers not: if you make these changes they will apply to all ChronoForm form exports on your site.
Sorry - to busy at the moment to write export code :-(
Bob
Other readers not: if you make these changes they will apply to all ChronoForm form exports on your site.
This topic is locked and no more replies can be posted.