.NET programming tips and solution

When the Report is published in the IIS, this error "The definition of the report 'Main Report' is invalid The report definition is not valid. Details: Data at the root level is invalid. Line 1, position 1" will throw.

Possible Solutions:

1. check "Allow this precompiled site to be updatable" feature in publish web.

2. move the report to the IIS where the application is published

3. Check whether in code-behind class the page uses has the same name as the code behind class of the ReportViewer control.

So the easiest resolution to this problem is to add the code-behind class to a namespace.

4. Instead of ReportProcessing.CompileReport... use Copy Website

5. a. Be sure that the Microsoft.Reportviewer at at the GAC

b. When you publish your website with the mode non updatable, you must replace the rdlc files pubblished with the rdlc files that are in your visual studio project.