Alex Rivera | Logout

Pivot table in C#

Asked 2009-07-01T15:07:52.750
11

I need to create a pivot table in .NET and can't use any third-party control (unless it's free). I tried to find documentation that explains how to create a pivot table (algorithm or steps) in general, but almost everything is related to Excel.

How can I create a pivot table in C#?

Edit
Report

1 Answer

2

Microsoft Access has the TRANSFORM command (which does a pivot), so you could use ADO.NET to query a Microsoft Access MDB file, and then use passthrough queries there to get to the data source that can't pivot (usually SQL Server/T-SQL). I did a proof of concept of this, and it worked. It was about 5000 LOC shorter than the VBScript implementation that did the pivot using arrays.

The usual disparaging remarks about Microsoft Access don't apply here, because you aren't actually storing data in Microsoft Access.

answered 2009-07-01T15:36:13.987

Your Answer