Showing posts with label Reporting. Show all posts
Showing posts with label Reporting. Show all posts

Monday, 7 February 2011

Generate RDLC dynamically with unique column headers

I use the great example from Gotreportviewer since about six month that uses Microsoft Reportviewer and my biggest problem is giving columns titles that different to field names.

There is my solution that has an additional property: List<string> Headers that contains column titles with the following restriction:

Number of headers must be equal to number of columns or TableRdlGenerator throws the following exception:
Error creating report: header and field columns must be set and have to be the same count of elements both of them!

The entire solution can be downloaded from my public folder on skydrive.