custom formatting column of excel export

custom formatting column of excel export

montoyammontoyam Posts: 568Questions: 136Answers: 5

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: 15,142Questions: 1Answers: 2,586

    What does the generated XML look like in that instance?

    Colin

  • montoyammontoyam Posts: 568Questions: 136Answers: 5
    edited August 2020

    interesting...it changes s to a 2

    <c r="D7" s="2">
         <v>0</v>
    </c>
    
  • colincolin Posts: 15,142Questions: 1Answers: 2,586

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

    Colin

This discussion has been closed.