Can I see a link to a page with button extensions working? Print, Excel etc.
Can I see a link to a page with button extensions working? Print, Excel etc.
Jeff A
Posts: 50Questions: 8Answers: 0
Can I see a link to a page with button extensions working? Print, Excel etc. I can't get them to show up at all.
Thanks,
Jeff
This discussion has been closed.
Answers
https://datatables.net/extensions/buttons/examples/html5/simple.html
thanks. this should help!
do you have the direct cdn link for the jszip and pdfmake files?
I don't think they have cdn's. I use them locally - their addresses are on here:
https://datatables.net/download/release#Buttons
oh we link to them ourselves..got it. thanks
OK I am able to get the Excel and PDF buttons working but now I have a different issue. Because I am moving the AVG row to the header using JS, the Excel and PDF file does not contain the header title row which is crucial. Do you know of a way way to put some condition around the JS that wont run it when exporting or making PDF?
I think I understand what you are looking for. Sounds like you want the top heading of the thead to be exported. Not sure if this will work but you could try
orderCellsTop
. This willalso move your sorting icons to the top row. But may affect your code if you use one of the header() APIs likecolumn.header()
.Kevin
hi kevin where do I add that "-optoin orderCellsTop"?
I added orderCellsTop: true, this worked to some extent. my headers are included in the Excel file but the AVG row is not showing
Sorry typo Should be
orderCellsTop
Sorry I misunderstood what you wanted. I thought you wanted to remove the average row and export only the column titles. Currently there is no built in support for exporting multiple headers. You might be interested in this thread, found by another user today:
https://datatables.net/forums/discussion/40854/how-to-add-second-footer-to-print-in-tfoot#latest
I haven't tried it so not sure if the code works.
Kevin
Do you know of a way to put some condition around my JS so that wont run it when exporting or making PDF (i.e. so it doesn't do the moving of AVG into thead)?
Only a single row will be exported in the header and/or footer of the export functions at this time I'm afraid. Working around it requires new code to be added, such as that in the link Kevin posted.
Allan