NAV2013 | Excel Buffer


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
  • Font
  • Size
  • Backgroundcolor (preferably HTML coded)
  • Foregroundcolor
  • Hyperlinks

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.

Like this:

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.

 

Advertisements
This entry was posted in General and tagged , , . Bookmark the permalink.

4 Responses to NAV2013 | Excel Buffer

  1. marco rodry says:

    Hey Mark, another feature to include in default Interface is saving Excel document without open a dialog. This is usefull when we want to create Excel via nas. Also dialog windows must be optional . Bye Mark and thanks For Your blog! Marco

    Like

  2. Bruce says:

    Hi Mark,

    If you could provide the code sample for 2013, that would be appreciated. I know the table structure and functionality for the export to Excel in 2009 vs 2013 is different, so just importing the new table to a new custom number range is ok, but then we would have to change the functionality for the acct. schedule export to use the NAV 2009 coding ways. I am just testing out the performance of exporting to Excel in native NAV 2013 and with the ClosedXML way. I am not sure if there will be a performance gain, but if so, I would like to implement.

    Client has custom fnality where we export to Excel multiple tabs of acct. schedule data, where each tab is filtered based on a dimension filter. The export runs slower when exporting multiple tabs, and I think that is because the data has to traverse thru all of the data in NAV, but if there is a way to make the export run faster, the client would definitely appreciate. We I tested by manually running each dim filter and export to Excel, those numbers for each set of dim filter did add up to the total amount of time the report runs based on the custom fnality that was built.

    Thanks in advance,
    Bruce

    Like

  3. Pingback: Excel Buffer & Ease of Upgrade | NAV Skills Blog | Microsoft Dynamics

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s