Excel Export with complete datas
Excel Export with complete datas
![dg_datatables](https://www.datatables.net/forums/uploads/userpics/743/n1LA43D9R9TFU.jpg)
I'm using a table with over 30 columns. Some of the columns contains huge datas. For readable reason - and not making the table to wide - i'm cutting the datas in some columns like this:
{ "render": function (data, type, row) {
if (data.length > 25)
{
var anzklass = '<span title="'+data+'">';
anzklass += data.substring(0, 23) + '...';
anzklass += '</span>';
return anzklass;
}
return data;
}, "targets": 30 }
This works fine. All big datas will be cutted and the complete content will be seen in a mouse-over.
But:
I also need a Excel Export. I manage this with the normal "Buttons:[Excel]" function. This also works fine, but in the Excel-file i only see the cutted datas, not the complete data.
How can i solve this, that i can see in the screen the "cutted" datas and in the Excel-file the complete datas?
Thanks a lot in advice.
This question has an accepted answers - jump to answer
Answers
You will want to make the modification for only the display option. This render example will chow you how:
https://datatables.net/manual/data/orthogonal-data#Computed-values
Kevin
Hi,
My comment on this thread will be useful, that has an example of those different options for render. Likewise, this page on
columns.render
.Cheers,
Colin
I added the type request in line 2, like:
if (data.length > 25 && type === 'display')
But this doen't work. The datas will shortend in the Display AND in the Excel-file.
I changed the code like Colin's advice:
Sorry, but no change. Still cutted on display and Excel.
I'm poking around here too! Hope to get back shortly![:) :)](https://www.datatables.net/forums/resources/emoji/smile.png)
Got there - this example does it. It's creating an additional type, 'export', which is then picked up in the render function.
Hope this works for you,
C
It works! Great!
Thanks a lot.