Saturday, September 4, 2010

ASP.NET ReportViewer control Dynamic reports with Object Data Source

I've been recently playing around with the built-in reporting control that ships with Visual Studio 2005+. At the time of writing, I'm working with Visual Studio 2008, with Microsoft.Reporting version 9.0. There aren't that many tutorials I found on the web for creating dynamic reports using Object Data Sources. For the uninitiated, an object data source is simply a strongly typed collection of objects with pre-defined properties. Visual Studio should pick up any classes with a method returning a strongly typed list of the objects.

Once you've got that bit sorted, now how to load the data source dynamically...

That's it. All sorted. Clear the data source from the report every time you want to regenerate the report.

No comments: