I am developing an ASP.Net c# 4.0 application and am working towards a cross-tab report which will return a dynamically changing number of columns, like so:
Sales Region| ProductA|ProductB|ProductC|……..
NorthEast| 10,000 | 3,000 |2,000 |……..
SouthEast| 3,000 | 6,000 |2,500 |……..
……………………………………………
……………………………………………
TOTAL | 100,000| 32,500 |7,800 |……..
There is a non determined number of products and regions, so the table returned will have a variable number of columns and rows.
How can I design such a report in Visual Studio 2010, RDLC designer? I have already designed my stored procedure returning the results, but designing the table adapter to return the results gives me no columns (as they are not known).
I think you need a “matrix” report.
This tutorial might help you.
Unfortunately you probably need to rewrite the query (I believe you already used PIVOT to obtain the current query).