Can we create lengthy column in separate raw when export to excel?
Can we create lengthy column in separate raw when export to excel?
sam371986
Posts: 4Questions: 1Answers: 0
I have 9 columns in my table list with 16000 raws. I am using server side datatable feature and I have implemented excel export feature of datatable also. My problem is from 9 columns 1 column is a comment (<th>comment</th>). May be it contains lengthy comments, so Can I add comment section in separate raw?
This discussion has been closed.
Answers
First with server side processing the export will only contain the data that is displayed. Please see the last FAQ in the service side processing section:
https://datatables.net/faqs/index#Server-side-processing
Modifying the Excel export is tricky. I'm not sure if or how you can move the comments section to a row in the export. One option for you may be to set the style of that column to wrap text. To wrap the text you can use style 55 from the style options built into the
excelHtml5
button type. This example shows how to apply styles).Someone else may have ideas of how to move the comment to the next row.
Kevin
@kthorngren Thanks. I had tried several method but to move the column as next row but not working. So I had tried to wrap the text. Wrapping the text is working but I am not sure am I followed correct method. Please check my code and correct me Thanks.
Not really. You perhaps could if you can workout how to add rows and manipulate the XML that Buttons outputs for Excel, but it isn't trivial as Kevin notes. There is no built in way to do what you are looking for I'm afraid - you'd need to write the code for it.
Allan
The code looks ok to me. Is there something not working?
Kevin
@kthorngren, Code is working. I just post the code because I am not sure am I followed correct method. Thanks.
@allan Thanks.