Editors Note : This article was moved from my old bolg.
The Excel Buffer table. Loved by many, unkown to most.
Here is the description on MSDN.
If you still don’t have a clue what I’m talking about, then allow me to explain. Else skip this paragraph and continue to the end of this blog post.
Excel is the most used application to use in combination with ERP but it was not always in Dynamics NAV (Navision).
The interface to Excel that we know as the Excel Buffer table was intruced in the same timeframe as Automation Control using that technology to provide the interface.
Currently the interface looks like this
The reason I call it an interface rather than a table is because that’s what it is. There is never data stored in the table on SQL Server. It is always used as a temporary table.
I’ve written small example application on Mibuso that demonstrates how this is used. With almost 7000 downloads it is by far the most popular one of my downloads on Mibuso. Probably because Google likes “Excel Buffer” and people download it who don’t have a clue about NAV.
So to create an interface with NAV the excel buffer is your friend. It allowes both reading from and writing to excel which most of us know best from the Bugetting functionality in NAV. See : How to: Import or Export a Budget (MSDN).
And now what. Now we know what to use Excel buffer is for. But the Excel buffer has it’s limmitations. Here are the ones I find missing:
- Multiple Sheets
- Backgroundcolor (preferably HTML coded)
Now before NAV2013 you could easily add this functionality yourself. Each cell is represented by a value of the list in the interface (let’s use dotnet terminology) and by adding members to the list which you then map to the properties of the cell.
That was possible because NAV was using the Office Automation libraries directly. However in NAV2013 they are using a wrapper dll to accomodate Office Interop.
And the wrapper DLL simply does not have the functions.
And this has been recognised by both the channel and Microsoft as an issue.
Here is a link to a discussion on Mibuso
And here are solutions provided by the NAV Team. (one and two)
But the workarounds by the NAV team are difficult and not as neat as we had in the old days.
Now there are three different ways you can handle this.
First one is to move back to Automation Control. Simply import the Excel Buffer from NAV2009 and you’re done. But that won’t work on the service tier and is dreadfully slow.
Second one if to implement ClosedXML as hinted by Arend Jan Kauffmann in his blog.
I can really recommend this solution. The ClosedXML is a wrapper around OpenXML (see humor here, laugh please) and basically provides the same interface we had with Automation Control to DotNet. It’s extremely fast and very easy to work with.
It allowes you to use the colors and hyperlink parameters and using of extra sheets and tons and tons more.
What I did is renumber the excel buffer table to something outside the customer number range (it does not have to be in the license, it’s an interface, not a table) and implement ClosedXML.
If enough comments are left on this blog I will make it available as download on Mibuso.
But the real solution would be to have the NAV team implement the things everyone creates on projects. I think my list is a good start.
Last week I was in Vedbaek and they asked me to provide a list of the things I need. Here it is. Do you have any other request? Please leave them as a comment of mail them to me.
Thanks for reading.