Page 1 of 1

Exportation AS CSV

Posted: 2020-02-19 08:59
by jbarge
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

Re: Exportation AS CSV

Posted: 2020-02-19 09:18
by jsetzer
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

Re: Exportation AS CSV

Posted: 2020-03-07 15:09
by jbarge
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

Re: Exportation AS CSV

Posted: 2022-06-10 12:27
by jbarge
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