RDLC Main Report Error

July 9, 2008 at 7:42 AMRampidByter

Lately I’ve been getting a ton of traffic directed to my log here regarding RDLC main report invalid errors.

To simply put verify that the Microsoft ReportViewer control is installed on the server these reports are being deployed to. Microsoft article on ReportViewer control is located here: http://msdn.microsoft.com/en-us/library/ms251671(VS.80).aspx

You can also download the ReportViewer control for use on the production system from the link below.

http://go.microsoft.com/fwlink/?LinkId=49981

The reason for the ‘invalid main report’ error, that is terribly descriptive huh, is due to the lack of the ReportViewer on the deployed system. This can be caused by the lack of Visual Studios (VS) being installed on the machine, as VS automagically installs the ReportViewer dependencies onto the system, and at that point will make the RDLC reports function.

If I can help anyone with RDLC related questions please email me at rob at coderrob dot com. I would like to see what has brought people looking for this answer, or if there is any additional content I should post regarding RDLC.

Posted in: ASP.Net | SSRS

Tags:

Deploying client-side report definition files ... or RDLC reports

December 3, 2007 at 9:20 AMRampidByter

I’m currently at work learning the nuances of the PHP language for an upcoming project. I was thinking about a way to start off the one sided conversation we’ll be having from now on, and then it hit me. I’d like to take a moment to help you solve a problem that plagued our development team for three days with RDLC reports.

 

Just recently I was attending a Microsoft MSDN event, and of all places while I was waiting at the line for the concession stand I overheard a group of three developers complaining about RDLC implementations, and Infragistics control sets. Having just rolled off a four month project where RDLC reports were part of my primary development tasks I learned quite a bit. I won’t touch on the Infragistics controls just yet as the pain of dealing with them is still very fresh within my thoughts.

 

The most important thing that I learned during this period of time is that deploying/publishing a website with RDLC reports is a big pain in the butt. What you’ll realize is after you’ve compiled and deployed your site the RDLC files drop from the 30+KB file sizes to a 1KB size. This change alone can throw some developers for a loop, but fear not this is normal. Unfortunately most of you out there that deploy these reports will be exposed right away to this wonderfully descript error:

 

“The definition of the report ‘Main Report’ is invalid”

 

Having stared blankly at this error, and considering we had no reports definitions named ‘Main Report’ this threw us for a loop. Looking up possible solutions to this error through Google amounted to a heap of nothing. There were forums after forums making off the wall suggestions to correct the problem, and even a few MSDN forums with advice that amounted to adding three .dll files to the GAC (global assembly cache) on the deployed server.

 

It wasn’t until we found this very obscure site that mentioned that by default the .Net framework does not include the ReportViewer control. In order to display reports correctly you’d need to additionally locate, download, and install the ReportViewer software on the website server. For our development systems this was never an issue as Visual Studio (VS) installs the ReportViewer once installed, but for our VS-less web hosting server this became an issue.

 

At the time of writing this blog entry you can find a reference to this Report Viewer control from the Microsoft download link below:

 

Microsoft Report Viewer Redistributable 2005 

 

Additionally you can search on the Microsoft.com website for the Microsoft Report Viewer Redistributable 2005 software. This will correct the ‘Main Report’ error, and hopefully at this point the reports will be displaying correctly. I’ve seen a lot of suggestions, everything from replacing the compiled versions of the RDLC reports with their source versions to including additional files into the GAC. The underling cause of this problem is most servers do not have Visual Studio (VS) installed, and without VS the report viewer control is not installed by default. Anyways, I hope you enjoyed my first blog, and I look forward to talking at you later.

Posted in: SSRS

Tags: