This question about Using an extension, Documentation: Asked
Export in excel a Tabel
Hello,
Can someone help me how can I use this plugin to export a tabel in excel?
I try it but I have no more ideas.
--
TobiasVincze - 11 Feb 2021
Use the
buttons
parameter and set it to excel. I just tested it and it work fine. When you click the button it immediately downloads xlsx file using name of topic and containing data from table.
--
LynnwoodBrown - 11 Feb 2021
Hello,
I tray this:
%DATATABLE{buttons="excel"}%
| ABC | 123 |
| abc | 456 |
And I get this:
I can download the the first table but the other not.
--
TobiasVincze - 12 Feb 2021
Let me make sure I understand what you're saying. Do you have two tables on the same page and does the button work on one but not the second table?
--
LynnwoodBrown - 12 Feb 2021
The DATATABLE make a table from him self. But if the table I made there isn't a excel button. See the attachment in this question. I made a screenshot.
Thanks.
--
TobiasVincze - 12 Feb 2021
Ok, i think I see where your problem is. You need to go back and look at the documentation about the two ways to use the plugin:
DATATABLE macro or
HTML5. Your example of placing a DATATABLE macro before a table does not follow either of those approaches. Furthermore, the
button
parameter is part of the DATATABLE macro approach which requires having the query as part of the macro. Some of the features listed in the DATATABLE macro do not apply to the HTML5 method.
I did a test and with the HTML5 approach the export buttons show up automatically and there does not appear to be any control over which buttons are displayed. Here is the syntax to use for your example:
%JQREQUIRE{"datatables"}%
<div class="jqDataTablesContainer" data-paginate="true" data-searching="true" data-info="true" >
| ABC | 123 |
| abc | 456 |
</div>
Hope this answers your question.
--
LynnwoodBrown - 12 Feb 2021
Hello, Thanks for the answer.
This is a bad info for me. That means there is not possibility at a moment in foswiki to export a tabel in excel.
--
TobiasVincze - 18 Feb 2021
I don't understand what you mean. In both cases, the excel export works.
--
LynnwoodBrown - 18 Feb 2021
Hello,
I put this code in the editor what you wrote and save it and the excel button don't see it.
--
TobiasVincze - 22 Feb 2021
I tray this:
%JQREQUIRE{"datatables"}%
<div class='jqDataTablesContainer' data-buttons='excel' data-info='true' data-paginate='true' data-searching='true'>
| *ABC* | *123* |
| abc | 456 |
</div>
but not work. I don't know what is the parameter in the HTML5 format for the excel button.
--
TobiasVincze - 22 Feb 2021
This is only the one what work for me.
%JQREQUIRE{"datatablesjszip"}%
%JQREQUIRE{"datatablesbuttons"}%
<div class='jqDataTablesContainer' data-info='true' data-paginate='true' data-searching='true'>
| *ABC* | *123* |
| abc | 456 |
</div>
FYI. If you don't use a header in the table don't work java-script if you use the HTML5 version.
If anybody have a other solution than tell me.
--
TobiasVincze - 22 Feb 2021