Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buttons extension datatables (export to excel) #827

Closed
atsoares opened this issue Jul 26, 2017 · 14 comments
Closed

Buttons extension datatables (export to excel) #827

atsoares opened this issue Jul 26, 2017 · 14 comments
Assignees
Milestone

Comments

@atsoares
Copy link

Hi,

Is it possible to use the datatable's extension (https://datatables.net/reference/button/) with the b:datatable?

I want to export to excel, and I know that there are some ways to do it using js, but I was wondering if i could do by another way using the reference above.

@stephanrauh stephanrauh self-assigned this Jul 26, 2017
@stephanrauh
Copy link
Collaborator

stephanrauh commented Jul 26, 2017

At first glance, this plugin looks interesting. We should investigate it.

@atsoares
Copy link
Author

as suggestion we could have also this one https://datatables.net/extensions/scroller/

@atsoares
Copy link
Author

I solved the excel export by using a js code as I said I would do. It was the fastest way to do it.

About the enhancement, it's really interesting not just the plugin to export but all others.

As right now I have to implement an infinite scroll to these tables, and even knowing how to procede with js and css, would be much better to have something like scroller.

@stephanrauh
Copy link
Collaborator

The button extension is already delivered with BootsFaces. The infinite scroller is not. Let's concentrate on the button extension first because infinite scroll gets its data from a file or an AJAX data source. In other words: the API doesn't match the current implementation of b:datatable.

stephanrauh added a commit to TheCoder4eu/BootsFacesWeb that referenced this issue Jul 30, 2017
@stephanrauh
Copy link
Collaborator

I've implemented a provisional version supporting the buttons extension. However, I think we have to remove the pdf library and the zip library from the BootsFaces.jar. Both add 1.1 Mb and 365 Kb, respectively. It's better to get them from a CDN.

@stephanrauh
Copy link
Collaborator

Live demo here: http://www3.bootsfaces.net/Showcase/forms/DataTable.jsf (the topmost demo).

@stephanrauh stephanrauh added this to the v1.2.0 milestone Jul 30, 2017
@chongma
Copy link
Collaborator

chongma commented Jul 31, 2017 via email

@ggam
Copy link
Collaborator

ggam commented Aug 1, 2017

Awesome!

@stephanrauh
Copy link
Collaborator

@TheCoder4eu Is the size of the BootsFaces.jar as important as it used to be? The latest addition to the data table catapults the size of the file beyond 3 megabytes. I suppose we can reduce the amount of JavaScript sent to the client easily, but it's difficult to reduce the size of the BootsFaces.jar unless we rely on a CDN hosted by a third party.

What's your opinion?

@TheCoder4eu
Copy link
Owner

@stephanrauh well, I think the best solution is CDN, since it is a feature mainly not used for rendering but for exporting data.
And I also would like to avoid excessive burden on the Jar too: if the libraries have a large footprint then a CDN should be more efficient than self-hosting the lib.

@gezertab
Copy link

Hello, datatable predefined buttons for excel,pdf etc not working. My code is
<b:dataTable
value="#{xxxxxxxxxxxxxxxxx}" var="xxxxx"
excel='true'
pdf='true'
customLangUrl="//cdn.datatables.net/plug-ins/1.10.15/i18n/Greek.json"
multi-column-search="true"
multi-column-search-position='top' >
All parameters working except excel/pdf . Any tips?

stephanrauh added a commit that referenced this issue Aug 19, 2017
@stephanrauh
Copy link
Collaborator

@gezertab Which version of BootsFaces do you use? The PDF and Excel export is a new feature of BootsFaces 1.1.3. We haven't published this version yet, but plan to do so next week.

@gezertab
Copy link

Ok then, i ll look forward for it. Currently Im using BootsFaces-OSP-1.1.2-dist.jar

Thanks for your reply

@stephanrauh
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants