Sunday, August 16, 2026

Custom Excel file format using SpreadsheetML in an AL codeunit

 By Steve Endow

[This blog post was 100% human written. None of this post was drafted, written, or edited by an AI.]

I recently worked on a very complex Business Central Per Tenant Extension for a customer.

I had to reproduce a "report" that was based on a 1,600 line SQL stored procedure that performed tens of thousands of calculations on GL data and custom configuration data, that was rendered in Power BI.

After weeks of work, I got the PTE developed, and after a few weeks of testing and reconciling, my report finally matched the customer's historical reports.  To the penny.

Except for the formatting.

The customer was used to reconciling an Excel version of the report with 50 rows and over 230 columns.  Both the rows and columns were shaded, and the report had a title and dates.  And given the scrolling involved in a report that large, the customer used the Excel "freeze panes" feature.

The Excel report my PTE was exporting from BC was black and white, no color, no shading, no title, and no frozen panes.  Every time they opened my Excel file, they had to do some basic formatting just to review it.

So I asked my buddy Claude:  "Is it possible to have formatting in the Excel file?"  I didn't know if AL could do that.

Is it possible? 

Setting up a globally accessible development workstation for under $400

 by Steve Endow

[This blog post was 100% human written. None of this post was drafted, written, or edited by an AI.]

In September 2020, I bought a Lenovo ThinkPad P1 Gen3 laptop.  For $3,271.

It was a massive waste of money.  Huge mistake.

This was back in the heyday of using Docker and BcContainerHelper for Business Central AL development.  The conversation at the time was that a powerful laptop would allow a BC AL developer to run Docker Desktop locally, allowing the dev to write code and test PTEs directly on the laptop.  And there was even a belief that "I can develop when I'm on the train, even if I don't have internet access!".  (I learned this last one wasn't really possible, because there were so many apps and services constantly calling for internet access.)

The laptop was absurdly expensive.  It was very heavy.  The 170W power adapter alone weighed a full pound.  It was very large and cumbersome, barely fitting in my backpack, and impractical to use on a flight.  And the battery life was terrible.  I hated using the laptop.

After that experience, I was on a mission to find a better solution.  A much cheaper solution.

Enter eBay.  Turns out there are truckloads of used Lenovo ThinkPads for sale on eBay.  

But isn't it risky to buy a computer on eBay?