1 export button for all tables ?
1 export button for all tables ?
BartTechne
Posts: 24Questions: 6Answers: 0
Is this possible ? So that all the datatables can be exported in 1 pdf ?
This discussion has been closed.
Answers
this creates x datatables based on for loops and each with 1 pdf button for each table
This thread should help, it's asking the same thing.
Cheers,
Colin
helped a bit but i am not using the table ID but the class for every table
If you are trying the
$.merge()
option you should be able to use thetable()
API to individually get each table. See this simple example:http://live.datatables.net/gihiceju/1/edit
Kevin
Tried this
but my first printout of the table.length is allready 0 for some reason
got a bit further... only issues is my data is not in the in the export for some reason
You can use the
tables()
API to get all the Datatables or usetable-selector
to limit the Datatables. If you investigate the returned Datatable API you will see there is acontext
property which is an array containing each Datatable. You can use thelength
of that array for your loop.http://live.datatables.net/gihiceju/2/edit
Kevin
almost theire ! Now Only this error left
when alerting data it says 2 times an object.
Also tried this one... still nothing in the export except for the headers.
Maybe you need to do something like this:
If this doesn't help please post a test case example so we can help debug.
Kevin
now it works but it prints on 1 table but the data for each table is not seperated
http://live.datatables.net/gihiceju/8/edit?html,js,console,output
so the title is an H5 automatic generated
what i want in the pdf is:
H5 as title of the Datatable
datatable1
H5 as title of datatable2
Datatable2
or is this not a good way ?
i saw theire was a mistake in the url docs
http://live.datatables.net/gihiceju/10/
On that last URL there's a console error -
data
is undefined. I changed it to bedata_export
and it's working nicely : http://live.datatables.net/gihiceju/11/editColin
thanks ! not just 100% though. if you could help me with it ?
When the first/last name changes. thats a new datatable. but i would want a title between every export.
Is that something that would work ? so:
title - datatable1 (where title is an h5 on my HTML )
title - datatable2
or can you "name" your datatable ?
Also the footer is not on the table
This example shows how to customise the title, and this one shows how to add the footer,
Colin