custom formatting column of excel export

custom formatting column of excel export

montoyammontoyam Posts: 329Questions: 82Answers: 4

I am using the following as a guide to create an excel spreadsheet with some formatting: https://datatables.net/reference/button/excelHtml5

There are a couple links on that page to go to for further documenation, but I am not able to figure out how to add specific formatting outside of the built-in styles that are on that page.

I am trying to format a cell as 'Accounting', where zero's are displayed as dashes. When I view the xml of an existing worksheet that is formatted this 'Accounting' way, I see:

<c r="D7" s="4">
    <v>0</v>
</c>

so I try:

$('row c[r^="D"]', sheet).attr('s', '4');

but that makes it underlined, which is what is listed under the built-in styles.

Answers

  • colincolin Posts: 9,856Questions: 0Answers: 1,635

    What does the generated XML look like in that instance?

    Colin

  • montoyammontoyam Posts: 329Questions: 82Answers: 4
    edited August 11

    interesting...it changes s to a 2

    <c r="D7" s="2">
         <v>0</v>
    </c>
    
  • colincolin Posts: 9,856Questions: 0Answers: 1,635

    That is odd. Sorry, not sure why that would be the case,

    Colin

Sign In or Register to comment.