Footer export issues

Footer export issues

kthorngrenkthorngren Posts: 20,425Questions: 26Answers: 4,794

First issue:

The Excel and PDF exports the footer but Copy, CSV and Print don't. This can be seen with the Basic Example. My understanding is the default is the footer is not included.

Second issue:

Exporting the FooterCallback example doesn't pickup the updated footer cells. See this test case:
https://live.datatables.net/sulehuso/1/edit

Its using the buttons.html5.js nightly to pick up the Excel export footer fix in this thread.

Copy:

Zenaida Frank   Software Engineer   New York    $125,250
Zorita  Serrano Software Engineer   San Francisco   $115,000Total:              undefined

The footer is on the same line as the last row. The Total cell looks like is far left.

Excel:

The Total is not shown in the correct cell. Its possible this is due to using Numbers on the Mac instead of Excel.

CSV:

"Zenaida","Frank","Software Engineer","New York","$125,250"
"Zorita","Serrano","Software Engineer","San Francisco","$115,000""Total:","","","","undefined"

Same as Copy the footer is on the same line as the last row. The Total is in the first cell not the 5th.

PDF:

The Total looks like it is in the wrong column.

Print:

Kevin

Replies

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Hi Kevin,

    Thanks very much for this! Amazing as always!

    The default for the footer is now true in 3.0. It looks like I missed a few. I've committed that fix and it will be in 3.0.1.

    For the undefined, that is caused by a new span tag that is used in DataTables 2 to wrap the content it writes into headers and footers being overwritten by the update. It can then no longer find that span, so it returns undefined. I think it would be correct for Buttons and DataTables to handle this situation, so I've made a couple of commits (1, 2) to address it.

    Thank you again!

    Allan

  • kthorngrenkthorngren Posts: 20,425Questions: 26Answers: 4,794
    edited March 1

    Perfect, thanks!

    The default for the footer is now true in 3.0.

    This example will need to be changed. Its always something :smile:

    Kevin

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Good point! Committed and will be deployed shortly.

    Allan

  • kthorngrenkthorngren Posts: 20,425Questions: 26Answers: 4,794

    I updated the test case and found that the CSV and Copy buttons still export the footer on the last row instead of a new row:
    https://live.datatables.net/sulehuso/2/edit

    Kevin

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Hmm - your example actually appears to be running okay for me, with the copy and csv exports showing the footer on its own line. This was the fix for that.

    I've stuck a random number on the end of the include for your example - maybe you were getting an old cached version?

    Allan

  • kthorngrenkthorngren Posts: 20,425Questions: 26Answers: 4,794

    Yep, sorry about that :smile:

    Kevin

Sign In or Register to comment.