Export excel with colored text or cell.

Export excel with colored text or cell.

nmathurnmathur Posts: 2Questions: 1Answers: 0

https://jsfiddle.net/nmathur/Ljkbzamp/14/

I have a requirement to color the text in the cell at the time of excel download. I have searched on the web and found many samples, but none of them were using "exportOptions - format". Please go through the sample shared above and help me to download the colored text.

Thanks

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    There are a few threads that should help, such as this example from this thread. Also, this example from this thread may help too.

    Colin

  • nmathurnmathur Posts: 2Questions: 1Answers: 0
    edited November 2021

    @colin Thanks for the response, I tried these earlier but was not sure how to use " var sheet = xlsx.xl.worksheets['sheet1.xml'];" and "$(this)".

    These samples are looping through worksheets, in my code, I am using format - body, and here data has the cell value which I will put in the excel file. Here I am not able to figure out how to apply the color attribute. I hope you can help me with this.

    Thanks.

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    The first link is the way to go, as that's iterating over the 'C' column, you would just need to change that to be the first, and instead of colouring the background, you'll need to colour the text,

    Colin

Sign In or Register to comment.