


Lightening web component(LWC) framework is helping JavaScript developers big time in creating good features and innovative user interfaces on Salesforce.
Recently, we had a requirement to make a feature to export an Excel document from LWC component. There were a few options through which I could even export a plain Excel document, but there was almost nothing, no support at all, for styling like colors, borders, alignment, wrap, border colors, etc.
This got me thinking how could technology fail in such a common arena, so I did some internal research and came out with a solution.
Let’s move further to discuss the solution at length-
In precise words, I decided to use a JavaScript library write-excel-file, which is available on npm. I integrated this library on Lightening Web Components and found out that it was throwing exception due to locker service.
Thereafter, I decided to customize the library write-excel-fileto make it compatible with LWC. You can download this version from here.
[… the rest of this page was left out: too long]
