none
Converting an RDLC Report from VS 2008 to VS 2010 RRS feed

  • Question

  • Hi,

    I have a small project with an .rdlc file viewed by the ReportViewer Control and was developed using VS 2008. I opened the solution using VS 2010 and the project was converted successfully with no errors.

    However, running the app, the report was not able to see the data sources, so I had to open the .rdlc to check and it is asked me to "Convert to the 2008 RDLC Definition or Open in XML", so I chose the conversion. After the running the app, it keeps giving me an error with the following msg:

    "an error occurred during local report processing".

    I dugg into the inner exceptions:

    1- "The definition of the report 'xxx' is invalid".

    2- "The report definition is not valid. Details: the report definition has an invalid target namespace 'http://schemas.microsoft.sqlserver.reporting/2008/01/reportdefinition' which cannot be upgraded".

    I noticed that SQL Server is involved, I had SQL Server 2005 at the time this app was developed and now I have SQL Server 2008 installed. But the Production DB is SQL Server 2005.

    Any help on this?

    Thanks in advance

    Tuesday, August 24, 2010 8:28 AM

All replies

  • You're probably not actually using the 2010 ReportViewer, even though you converted to VS2010 project. You'll need to manually remove the references Microsoft.ReportViewer.Common and Microsoft.ReportViewer.WinForms (or Microsoft.ReportViewer.WebForms) in your project and point them to the 10.0.0.0 version. Also check your App.config (or Web.config) to make sure no 9.0.0.0 ReportViewer references remain there.
    Cephas Lin This posting is provided "AS IS" with no warranties.
    • Proposed as answer by Rick Martinez Wednesday, August 29, 2012 6:30 PM
    Tuesday, August 24, 2010 9:23 PM
    Moderator
  • I have the same issue. This is the first time I have tried upgrading a report created in VS2008 .NET 3.5 to VS2010 .NET 4.0.

    I allowed VS2010 to upgrade the report. Got ..

    Error 1 The report definition is not valid.  Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' which cannot be upgraded. C:\Users\wsk01022\Documents\Visual Studio 2010\Websites\ROW_Base_NET4\Parcels\Reports\ParcelStatusReport.rdlc 1 

    I updated references in web.config and my pages with reports to reportviewer 10.0.0.0. Same error.

    I've tried in 4 different websites. I built a nice simple 1 page site with a report in VS2008 this morning to test on - same error.

    Not a real friendly upgrade - ie it's broken in VS2010.

    Now what? do I need to change the 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' in the report XML files to something else? Naturally there is no 'http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition'.

     

    • Proposed as answer by jpalatine Saturday, April 2, 2011 8:45 PM
    Monday, August 30, 2010 8:00 PM
  • I've been chasing this through various threads today trying to find a solution that works. No success so far. I've told the management our sites won't be migrating to .NET 4 until Microsoft makes a functioning upgrade path.

    Please tell whomever developed this broken functionality that they should have just not allowed old reports to be used with .NET 4 rather than include a completely broken upgrade function (I've not seen anything that indicates the upgrade worked for anyone). No documentation on it either.

    Microsoft will make an open source user out of me yet.

    Monday, August 30, 2010 8:30 PM
  • Are you saying that you created an RDLC report in VS2008 and it points to schema 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition'? You should only be able to create RDLC 2005 reports, not RDLC 2008, in VS2008. VS2010 can upgrade your report from the 2005 schema to the 2008 schema.


    Cephas Lin This posting is provided "AS IS" with no warranties.
    Monday, August 30, 2010 9:03 PM
    Moderator
  • The schema was whatever VS2008 creates. I never had any reason to look at it in 2008.

    If VS2010 is what changed it to 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' then why in heck does it then tell me it is an invalid namespace (in the error message above)?

    regardless - VS2010 gives me the error after the 'upgrade'.

    Monday, August 30, 2010 9:11 PM
  • Try this: create an RDLC report in a VS2008 project, then open it in Notepad. What's the schema reference (should be http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition)?

    Add the same RDLC report to a VS2010 project, then double-click to open it, and accept the upgrade question. I'm assuming you get the error here. Regardless, open the upgraded RDLC report in Notepad again. What's the schema reference this time? If the upgrade succeeds, it should be http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition.

    Note: The only time VS2008 can create a 2008 report is when using the report project template provided by the SQL Server Business Intelligence Development Studio. This report is NOT an RDLC report, but an RDL report for being hosted on a SQL Server Reporting Services server. We do not support changing an RDL report to an RDLC report.


    Cephas Lin This posting is provided "AS IS" with no warranties.
    • Proposed as answer by Gerardo Chadid Monday, September 6, 2010 4:27 PM
    Monday, August 30, 2010 9:36 PM
    Moderator
  • for VS 2010 make sure that in the web.config the Version of the .rdlc is 10.0.0.0

    <

     

     

    buildProviders>

     

     

     

    <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

    </

     

     

    buildProviders>

     

     

     

     

     

     

    i have the same error on compilation, fixing this part of the web.config help me with the error.

     

    • Proposed as answer by FabioCshark Friday, September 10, 2010 6:37 PM
    Monday, September 6, 2010 4:30 PM
  • for VS 2010 make sure that in the web.config the Version of the .rdlc is 10.0.0.0

    <

     

     

    buildProviders >

     

     

     

     

    < add extension = " .rdlc " type = " Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0 , Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a " />

    </

     

     

     

    buildProviders >

     

     

     

     

     

     

     

    i have the same error on compilation, fixing this part of the web.config help me with the error.

     

    the web.config is the key to solve the problem.
    Friday, September 10, 2010 6:38 PM
  • Hi,   this is a very old post, I hope someone is still takingg a look once in a while.   

     

    I have Visual Studio .net 2010, and the .Net framework 4.0 installed on my machine, with SQL Server 2008.  When I create a new RDLC file in Visual Studio 2010, I get an RDLC file with .../Reporting/2008/01/... in it.      When I compile on my machine, all is well.   When the same project compiles on our build server, it throws up with the error

     

    the report definition has an invalid target namespace 'http://schemas.microsoft.sqlserver.reporting/2008/01/reportdefinition' which cannot be upgraded".

     

    Desperate for help!!     I did check and the references to Microsoft.ReportViewer.Winforms is in fact 10.0         Why is this .Net 2010 visual studio creating these 2008/01 rdlc files, and how can I fix it?

     

    Thanks!

    Mike

    Tuesday, February 1, 2011 11:39 PM
  • No!   Not for me!   When I create a new empty RDLC file, on my machine, with Visual Studio 2010 and .net framework 4.0 installed (AND pointing to the 10.0 .net framework), it creates an RDLC file with /2008/01/.

     

    Any way to fix this?

     

    Thanks,

    Mike

    • Proposed as answer by Amit_Saxena Friday, May 4, 2012 5:35 PM
    • Unproposed as answer by Amit_Saxena Friday, May 4, 2012 5:36 PM
    Tuesday, February 1, 2011 11:41 PM
  • Here is what I did and got it working. I opened the .rdlc file in Notepad

    and replaced the <Report xmlns:rd...> tag with following

     <Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition">

    Also, remove the <ReportSections> and <ReportSection> tag which are around <Body> tag. Leave the meat in between.

    • Proposed as answer by HongTat Thursday, November 7, 2013 2:57 AM
    Friday, May 4, 2012 5:39 PM
  • thank you Cephas, I removed the references from the project and added the 10.0 reference and it worked for me.
    Wednesday, August 29, 2012 6:31 PM
  • Thank Amit,

    Your method works and you have save my day.

    Thursday, November 7, 2013 2:58 AM