Wednesday, April 16, 2008

Deploying VS 2008 projects using MicrosoftReportViewer

Caveats to using MicrosoftReportViewer control to create Client side Reports on a tightly controlled Production Server:
  1. ReportViewer dll's are not in the .Net 3.5 Framework Redistributable. They are in a Visual Studio 2008 Runtime Redistributable http://www.microsoft.com/downloads/details.aspx?familyid=CC96C246-61E5-4D9E-BB5F-416D75A1B9EF&displaylang=en (which says it is for XP and Vista). After installing the Redist on the Server (2K3 Enterprise Ed), the report displays, but it did a fine job of locking up my Browser every time I attempted to print the report. A Messagebox alert popped up with "Unable to load client print control" and the browser displayed the yellow bar at the top of the page wanting to install a SQL Server Add-in. Sure you could probably find the .dll's (listed below) , add a reference, and set Copy Local=true (although it didn't work for me for the Microsoft.ReportViewer.ProcessingObjectModel.dll); just make sure your Production server IT support staff approves. I did not test to see if that would resolve the previously mentioned browser lockups.
    • Microsoft.ReportViewer.WinForms.dll
    • Microsoft.ReportViewer.WebForms.dll
    • Microsoft.ReportViewer.Common.dll
    • Microsoft.ReportViewer.ProcessingObjectModel.dll
    • Publishing using the VS 2008 Publish functionality does not include the necessary dll's. Just because it says "publish only files it needs to run", doesn't mean it includes all the files needed to run. Of course you don't find out you are missing some of the dll's (like the Microsoft.ReportViewer.ProcessingObjectModel.dll) until you try to display the ReportViewer report. Make sure to include that step in your verification plan.

        2 comments:

        Russ said...

        Did you ever find a way to publish those dlls without the exe?

        Dean-o said...

        No, I'm sorry. I hadn't tried to set up a VPC to do any more testing. In my case I was deploying the application to one of our internal servers with minimal likelihood that it would need to move to a server we did not control.