excel showing date as serial number
excel showing date as serial number
mikepre98
Posts: 8Questions: 1Answers: 0
i have a code to export datatable to excel but when i export and go check the values for some reaon the field "DT_CANDIDATURA" is shown as a serial number instead of normal text, anyone know why that is?
Answers
Please link to a test case showing the issue so we can debug it.
If you remove your
customize
function does it still happen?Thanks,
Allan
hello Allan, im using server side processing to fill the table, is it possible to make the test case with it?
and ive summed it down to a line thats causing it its:
$('row c', sheet).attr( 's', '50');
whatever atribute i set, it turns the date from normal to serial number, but if just remove that line it turns normal
the thing is that i need that line to costumize the excel
i fixed it, had to create a new style just for that cell and specify the numFmtId, is there a way to add a costum format to the date, i wanted to use YYYY-MM-DD, but its formatting automatically as DD/MM/YYYY
nevermind got it all working, thank you for the attention still
i have another question, how do i put borders only on top and bottom of the excel? only way i found is borders on all sides
That has nothing to do with DataTables. Try the Excel help line.
i meant on the export to excel part, how do i set the border to just top and bottom instead of the default all sides border
I see. Never used customise Excel myself. I expect someone else will step up.
While not easy It is possible to add styles to the built-in styles. See this thread for some ideas.
Kevin
Is there a way to do it like ive been doing the costum styling?
I was looking at the borderId in the <xf> tags, but if i change it from either 0 or 1 to any other number, the excel gets corrupted, but 0 removes the border and 1 adds the all sides border, ive been looking to see if i could find any info on the borderId's available but i cant find anything.
Got it working, had to edit the buttons.html5.min.js itself, had to remove the left and right from the borders tag.
thanks to everyone who tried to help