Buttons exportOptions columns exporting all header columns
Buttons exportOptions columns exporting all header columns
I have what I think is a very straightforward table - just three columns. I only want the second and third columns to be exported for excel, pdf, and printing. I'm using Buttons --> exportOptions --> columns and for some reason it's producing all three table header columns, but then only exporting columns one and two in the table body. As a result of their being three columns the data is spilling over into each row.
I tried to recreate the scenario here but for some reason I cannot get the Buttons to display so I don't know if it's being recreated or not...if somebody can tell me what I'm doing wrong in either case, I'd be most grateful
Answers
I fixed your test case. needed to add the buttons JS and CSS files.
I ran through all 4 buttons and they export 2 column headers and 2 columns of data. The test case is not reproducing your issue but working correctly. Maybe there is something you are missing to cause the test case to recreate the problem.
Updates here:
http://live.datatables.net/tucikewi/2/edit
Kevin
shoot, thanks Kevin....I thought I had included the nightly Buttons, maybe I overlooked something. Also, I've been thinking about it and I totally forgot that I modified the datatables.js file a couple days ago to allow for tables with multiple header rows to export all the header rows. I used the modifications that this poster provided:
How to add second footer to pri...
The code reroutes to this function below to grab the multiple header rows, so I'm hoping the issue is in here somewhere. I'm getting ready to dig in and I'm sorry about wasting anybody's time by not remembering I did this
Just wanted to give an update that the issue was in the new code to account for multiple headers. I was able to add a couple of lines of code to the solution and it works like a charm. The updated code can be found in the original post:
https://datatables.net/forums/discussion/comment/106434/#Comment_106434