Posted on: 7/20/2015 3:18:46 PM | Views : 836

Hi guys.
Was wondering if somebody here has some advice for me, I've been bumping my head against this for a week now. I would like to create an excel spreadsheet with a database connection and a pivot table from code behind, using either C# or VB.Net. Initially I managed to do this with Microsoft.Office.Excel.Interop but numerous websites (including a few here) have told me this isn't a good idea for deployed web applications so I went looking for another alternatives, in this case the Open XML SDK.
With the Open XML SDK I've managed to create an Excel Spreadsheet as well as a connection to the database within it, but creating the Pivot Table is proving to be a bit of a problem. I've created a test Excel document and reflected the code using the Open XML SDK 2.0 Productivity Tool, but it seems as if the code that the Productivity Tool generates adds the Pivot Table fields manually, something which I can't do as I don't know which table will be used during prog ...

Go to the complete details ...