Web ReportViewer and Multi-value Parameter Bug (or how I spent my weekend)

This weekend, I was working on the second part of my Report Viewers article for DevX. As usual, it all started with an innocent idea which turned out into a whole-day affair. I wanted to demonstrate how to integrate the VS.NET 2005 web ReportViewer with a server report that takes a multi-value parameter. Of course, to save time to lay out the presentation layer, I decided to use absolute positioning for my web controls. Much to my surprise, the ReportViewer wouldn’t expand the multi-value parameter. It would helplessly repost the page each time I would click on a report parameter.

So, I got on an ambitious and arduous quest to find out what I am doing wrong. The most puzzling finding was that the Report Manager (which behind the scenes uses the web Report Viewer) would render the report just fine. This left me utterly perplexed and convinced that I am doing something terribly wrong.  And I’ve started changing stuff around. I fixed a bunch of other issues, including some mysterious DCOM events that were logged in the Event Viewer, but the ReportViewer won’t budge.

Finally, I created a new page, dropped the ReportViewer, and configured at design time, and sure it rendered the report just fine. It turned out that there is a bug with the ReportViewer and multi-value parameters because they use absolute positioning as well. As far as I know, the only workaround for now is to change the hosting page layout to use flow positioning instead.

So, stay away from absolute positioning until this ugly bug is fixed.

  • I’ve been struggling to integrate the AWReportViewer custom control, from the sample code accompanying your Reporting Services in Action book, into my application without success. I could really use some help with this.

    My web application delivers a variety of reports to law enforcement agencies. When complete, I will have a couple hundred reports, in 3 major categories, available online. What I originally did was create the individual reports on the report server, then programmed individual aspx pages to access each report. This was fine when there were only a few reports, but it has become something of an issue to maintain now that the reporting feature is gaining wider use.

    What I am attempting to do is create 3 tabs on my menu (for the 3 different categories of reports), each with a datagrid from your AWREPORTVIEWERDEMO page to access that category of reports, and using the AWReportViewer control to display the report.

    I have successfully integrated your code sample into my application except for the AWReportViewer control. It doesn’t display the report. It doesn’t appear to do anything. There are no error messages. When I step through the code the RenderReport() function is run, the visible property is set to true, but no report. Any help you could provide would be greatly appreciated!!! What can I provide to you that would be of assistance in debugging this issue?

    I can’t even begin to tell you how many questions I have on an hourly basis. Does there need to be changes to the libraries and recompile the assemblies? Is the code for those assemblies available as part of this sample? Can I use the native ReportViewer control instead (it doesn’t take into account the parameters though, although I did program individual pages to enter and validate the parameters before passing them to the report server)? There are questions I haven’t even begun to formulate. I’ve been programming for 25 years. I’ve been programming in “classic asp” (the term I recently found – which makes me feel like a freaking “golden oldie”) for the past 7 years, SQL Server and Oracle for the past 10 years. I started using VS about a year ago. C# is relatively new to me, but not entirely different from other languages I’ve worked with. And VB.NET isn’t your ordinary VB (as the name would loosely imply) but I’m managing that as well. I’ve found the Visual Studio interface to be fairly standard with other products I’ve used, and I’ve taken several official Microsoft training courses this last year to help me ramp up on Visual Studio and Reporting Services specific features. I’m one of those people that now knows enough to be dangerous, but still can’t see the big picture, so I’ve been programming this application in bite-sized chunks. Not the way I like to do things, but the only way that I can make it manageable. I’d be happy to share the code with you if that would make things easier.

    Any advice you could share with me on getting over this learning hump would also be appreciated. Your book is very organized and thorough. I blame Microsoft for my confusion. =)

    Thank you for your time.

    John F Tobey
    Systems Analyst
    Oregon State Police,
    Law Enforcement Data System
    (503) 378-3055 x55039

  • Hi John,

    Thanks for not blaming my book :-) You didn’t say which version of Reporting Services you are using but AWReportViewer is obsolete. Use the Visual Studio ReportViewer. You can hide the parameter area and implement your own. I demonstrate this in my latest book “Applied Microsoft SQL Server 2008 Reporting Services”.