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 AJeff 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

Answers

  • Jeff AJeff A Posts: 50Questions: 8Answers: 0

    thanks. this should help!

  • Jeff AJeff A Posts: 50Questions: 8Answers: 0
    edited July 2017

    do you have the direct cdn link for the jszip and pdfmake files?

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    I don't think they have cdn's. I use them locally - their addresses are on here:
    https://datatables.net/download/release#Buttons

  • Jeff AJeff A Posts: 50Questions: 8Answers: 0

    oh we link to them ourselves..got it. thanks

  • Jeff AJeff A Posts: 50Questions: 8Answers: 0

    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?

  • kthorngrenkthorngren Posts: 21,310Questions: 26Answers: 4,948
    edited July 2017

    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 like column.header().

    Kevin

  • Jeff AJeff A Posts: 50Questions: 8Answers: 0

    hi kevin where do I add that "-optoin orderCellsTop"?

  • Jeff AJeff A Posts: 50Questions: 8Answers: 0
    edited July 2017

    I added orderCellsTop: true, this worked to some extent. my headers are included in the Excel file but the AVG row is not showing

  • kthorngrenkthorngren Posts: 21,310Questions: 26Answers: 4,948

    where do I add that "-optoin orderCellsTop"?

    Sorry typo :smile: 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

  • Jeff AJeff A Posts: 50Questions: 8Answers: 0
    edited July 2017

    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)?

  • allanallan Posts: 63,480Questions: 1Answers: 10,467 Site admin

    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

This discussion has been closed.