问题
I used store a data into the DataTable and wants to create a Pivot Table using this data.
I have gone through many posts and also read the Microsoft's documentation on creating Pivot table through Open XML but couldn't get the solution. Can anyone please post some code to create Pivot table.
Thanks in advance.
回答1:
Install the Open XML SDK, it contains a tool called Open XML SDK Productivity Tool.
How to use it:
Open Excel and create a file containing a Pivot table. Save it and open it with the Productivity Tool. In this tool is an option to 'Reflect the code', that way you can see how to create the same Excel by using C# code.
来源:https://stackoverflow.com/questions/15479192/creating-pivot-table-in-excel-using-open-xml-and-c-sharp