Exportation AS CSV

Wish to see a specific feature/change in future releases? Feel free to post it here, and if it gets enough "likes", we'd definitely include it in future releases!
Post Reply
jbarge
Posts: 18
Joined: 2020-01-28 18:26

Exportation AS CSV

Post by jbarge » 2020-02-19 08:59

Hi,
When clicking "Export CSV" button, is it possible to have filters running as "View Print" button :
- verticaly with current filters and selected rows,
- horizontaly with culumns selected.
Actualy Export CSV button runs with all the records of the table and all the columns.
Thanks for suggestions
Jean André BARGE

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Exportation AS CSV

Post by jsetzer » 2020-02-19 09:18

Hi,
I think both can be customized by modifying $options in the TABLENAME_init() function of your hook.

https://bigprof.com/appgini/help/advanc ... ist-object

Regards,
Jan
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

jbarge
Posts: 18
Joined: 2020-01-28 18:26

Re: Exportation AS CSV

Post by jbarge » 2020-03-07 15:09

Hi,
Following your suggestion, i modified Datalist associated with $options parameter of init hook as follow :

/* Personnalisation Datalist
$options->RecordsPerPage=20; */

/* Personnalisation Datalist pour Sauvegarde CSV */
$options->QueryFieldsCSV='';
if (isset($REQUEST['CSV_x'])) $options->DefaultSortField=3;
$options->QueryFieldsCSV["`membres`.`email`"]="Email";
$options->QueryFieldsCSV["`membres`.`tel_portable`"]="Tel portable";
$options->QueryFieldsCSV["`membres`.`nom`"]="Nom";
$options->QueryFieldsCSV["`membres`.`prenom`"]="Prenom";
$options->QueryFieldsCSV["`membres`.`adresse`"]="Adresse";
$options->QueryFieldsCSV["`membres`.`code_postal`"]="Code postal";
$options->QueryFieldsCSV["`membres`.`ville`"]="Ville";
$options->QueryFieldsCSV["`membres`.`pays`"]="Pays";

I had a partial result, but is-it possible to obtain the fields selected with the button "Hide/Show columns" and selected records obtained when clicking à the column left to the table ?
Thanks for suggestions
Regards
Jean André BARGE

jbarge
Posts: 18
Joined: 2020-01-28 18:26

Re: Exportation AS CSV

Post by jbarge » 2022-06-10 12:27

Bonjour,

Depuis la version APPGINI 22.12 les changements que j'avais apportés à l'objet DATALIST ne fonctionnent plus. Au lieu d'avoir le filtre sur les colonnes et les lignes, lorsque je clique sur le bouton "Exporter au format CSV", j'obtiens dans l'affichage du document CSV téléchargé une seule cellule intitulée COUNT(1) avec pour valeur le nombre de lignes. Si je commente mes modifications on retrouve le fonctionnement de l'exportation CSV d'origine sans filtre.
Qu'est-ce qui a pu changer avec le passage à la version 22.12 ?

Jean André BARGE

Post Reply