Hello to all.
I have working CCv6 table with select submission chekbox that i created from demo table "Articles list with advanced features" and csv export button that export all the records from the data table with data provider {var:read_submissions.[n].Submission} where read_submissions is db read function and Submission is model. Litererarly. all data nevertheless i defined Titles in the csv export function.
Question is - how to create csv export so it exported only selected records with only defined columns?
thank yo in advance -
Elita
Please answer this question ๐ I have the same doubt
Hi,
- in the Toolbar button view settings enable the "Submit button" option.
- In the selector view, set the "Value" to {var:table_view_name.row.Model.primary_key_name}
Now when you select some checkboxes and click the toolbar button you will get a list of primary keys under the "gcb" data var, use this in your "Read data" to select the records, the where conditions should be:
Model.primar_key/in:{data:gcb}
Then after the records are loaded you can use them in the CSV action or anywhere else.
โ
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi Elita,
โ
Yes, since you read the records using the read data that should work.
โ
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max, something is not right here.
Should I use separate Read Data function for this purpose?
If I put the code you provided Model.primary_key/in:{data:gcb} in Read action for either Read Data for the Table or Read Data for the Row
I got an error:
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '''' at line 1
โ
And what is the Select Type then? First maching record or All matcing records?
Hi Elita,
โ
The conditions need to be for the "Read data" of the table, and you need to set the select type to "All matching" since you are using the results for the table.
โ
Did you replace "primary_key" and "Model" in the syntax ?
โ
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Yupp. I Have Read Data for the Table view with "All matching" with Model named Submission. When I put code you provided e.g. Submission.aid/in:{data:gcb} I got an error mentioned above. only by opening the Table view. To be more precise - everything is working - Table opens, all other functions and views work untill I put that code in.
โ
P.S. If it matters - My Joomla version is 3.8.3 and other settings: PHP 7.1.15; MySQLi 5.7.21-0ubuntu0.16.04.1
Hi Elita,
โ
Your selector field name is set to gcb[] ?
โ
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hello, Max, yes. it is set to gcb[]. And value is set to {var:submissions_list.row.Submission.aid} where subbmisions_list is Table, Submission - Model and aid- submission id.
Then debuging is needed, in the csv event (The event to which the export button is pointing), use {debug:}, what do you get when you try to export ?
โ
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Figured everything out. Took some time. The only problem is - cannot get UTF-8 latin extended characters.
Any idea, Max?
Thank you in advance - Elita
Things to consider though:
1. How to get Latin extended characters properly shown in Excel; (like ฤ,ฤ,ฤผ,);
2. How to define data so Excel would not convert everything that look like date to date format; E.g. - if data is stored like 12/23/18.
โ
Hoping to get the solution -
Elita
Hi Elita,
- The file data has the same encoding of the database table, so when you open the file in excel you need to choose utf-8 as the view encoding.
- I think this also should be a configurable Excel setting.
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.