none
2010 ReportViewer and Report Builder 3.0 RRS feed

  • Question

  • Hi,

    I've created a report using Report Builder 3.0 against a SQL Server 2008 R2 database. The report runs fine and the output is as expected. I saved the report as a RDL file. I then opened Visual Studio 2010 and created a simple Windows application that has a ReportViewer control (10.0.0...). I copied the report to my solution directory and had the report load into the view using the following code:

    this.MainReportViewer.ProcessingMode = ProcessingMode.Local;
    this.MainReportViewer.LocalReport.LoadReportDefinition( new StreamReader( "RubbishReport.rdl" ) );
    this.MainReportViewer.LocalReport.ReportPath = "RubbishReport.rdl";
    this.MainReportViewer.RefreshReport();

    When I run the application the report viewer displays a message similar to:

    An error occurred during local processing. The report definition is not valid. The Report definition has an invalid target namespace. 'http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition' which cannot be upgraded.

    Can someone shed some light on this?

    Kind Regards

    Michael

     

    Tuesday, June 1, 2010 2:26 PM

Answers

  • The reports that are created with ReportBuilder 3.0 use the RDL 2010 schema but the ReportViewer in local mode can only process/render reports that use the 2005 or 2008 schema. If you publish the 2010 report to a report server and use the ReportViewer in remote mode you can render the 2010 RDL Report.

    Matt M.


    This posting is provided "AS IS" with no warranties, and confers no rights

     

    Tuesday, June 1, 2010 6:20 PM

All replies

  • The reports that are created with ReportBuilder 3.0 use the RDL 2010 schema but the ReportViewer in local mode can only process/render reports that use the 2005 or 2008 schema. If you publish the 2010 report to a report server and use the ReportViewer in remote mode you can render the 2010 RDL Report.

    Matt M.


    This posting is provided "AS IS" with no warranties, and confers no rights

     

    Tuesday, June 1, 2010 6:20 PM
  • Only an unprofessional self absorbed organization like Microsoft will release a product with known deficiencies and not bother to tell its clients about the problems. All the time and effort spent converting a system from VS2008 to VS2010 is wasted.
    • Proposed as answer by Yevhen Balun Friday, November 4, 2011 1:56 PM
    Tuesday, June 1, 2010 8:47 PM
  • Hi Matt,

    I re-created the report using Report Builder 2.0 and it seems to have solved the problem. Will Microsoft be releasing an update to the Report Viewer to allow the use of Report Builder 3.0 reports?

    Thanks

    Michael

    Wednesday, June 2, 2010 10:15 AM
  • Hi Michael,

    How do you "re-create report using Report Builder 2" in a VS2010 project?

    Thanks,

    Zulu 

    Wednesday, June 2, 2010 3:26 PM
  • Hey Michael, we hope to bring the ReportViewer local processing RDL support inline with the latest version no later than the next release, unfortunately we couldn't get it in this time because of the ship timelines of SQL 2008 R2 and VS2010. The main differance between the two versions is the Map control which you can get in remote mode. The report designer in VS2010 and ReportBuilder 2.0 both output the same version of RDL so you can edit your RDLs in either one however if you use ReportBuilder you will have support for DataSources which get handled by the report server but in VS is something you have to handle.
     

    Matt M.


    This posting is provided "AS IS" with no warranties, and confers no rights

     

    Wednesday, June 2, 2010 5:28 PM
  • Hi Zulu

    By "re-create" I meant I had to create a new report in Builder 2.0 and re-add the columns, etc. A bit of a pain, but thankfully the reports were not that big.

    Michael

    Thursday, June 3, 2010 10:56 AM
  • Hi Michael,

    Thanks for the response. After converting over from VS2008, we have 75 reports in limbo. I best undo everything and go back to VS2008.

    Zulu 

    Thursday, June 3, 2010 4:01 PM
  • Just a thought Zulu, but maybe you could try changing the new reports to reference the previous XML namespace? For example I notice that in a VS2010 report the "xmlns" used by the rdlc reports is:

    xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition"

    whereas in VS2008 its:

    xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition"

    If you opened your new reports, which I assume now use the first XML namespace, change the namespace to use the second and then remove any XML nodes/attributes that are no longer recognised, then this may be a way of converting them back to VS2008.

    I've not tried to see if this works, but may be worth a shot.

    Michael

    Friday, June 4, 2010 7:34 AM
  • Hi Zulu,

    This post may be a little late, but you don't need to roll back VS2010 to VS2008.  VS2010 and ReportBuilder 2.0 and SQL 2008 R2 will work together the only issue is you can't roll forward to Report Builder 3.0.

    Tuesday, August 10, 2010 8:51 PM
  • Hi Matt, I have created some report with Report Builder 3.0 and I want to render them in local mode with Report Viewer 10.0, and if I have well understood this will be possible from the next release. Do you have an estimated date for the release?

    Thank You

    L.

    Friday, August 27, 2010 9:41 AM
  • How do I set the ReportViewer web control to process R2 2010 schemas in remote mode?
    Thursday, September 16, 2010 10:01 PM
  • Bump.. Same Issue.  How to show a Report Builder 3.0 report in ASP.Net web application??

    Is this not supported?

    Saturday, March 19, 2011 6:15 PM
  • WHY IS THIS STILL AN OPEN ISSUE?!? I'm running into this problem today, a year after this post, and there isn't any option but a half baked workaround?  That's pretty weak.
    Monday, May 23, 2011 6:43 PM
  • Can anyone provide new information on this issue?  Has an update been released?
    Thursday, June 2, 2011 9:45 PM
  • Can anyone provide new information on this issue?  Has an update been released?
    Wednesday, June 15, 2011 2:43 PM
  • It is also a problem for me. I am waiting also for a solution for this bug.

    Robby

    Thursday, June 16, 2011 3:13 PM
  •  

    It's resolved, just add a reference to Microsoft.ReportViewer.WinForms v 10.0.0.0 instead of v 9.0.0.0.

    Et voila, problemo solved! :)

     

    Also take a lot at the following link for a complete answer:

    http://social.msdn.microsoft.com/Forums/en-SG/vsreportcontrols/thread/20212689-20da-4315-8fb3-7190b4b93628

    Grtz.

     

     

     

    Thursday, June 23, 2011 6:28 AM
  • No it's not solved!

    I have a reference to Microsoft.ReportViewer.WinForms v 10.0.0.0. If you build a report with Report builder 3.0 and open it like this:
                    msReportViewer.Reset();
                    msReportViewer.LocalReport.ReportPath = reportRequest.ReportPath;
                    var reportParams = msReportViewer.LocalReport.GetParameters();

    You get an exception on 'GetParameters':

    Message: An error occurred during local report processing.

    InnerException: The definition of the report 'C:\Reports\Work Orders3.0.rdl' is invalid.

     

    Robby

    Friday, July 15, 2011 8:52 AM
  • Here is a somewhat rudimentary but effective workaround that I created based on the solution posted at http://stackoverflow.com/questions/5655307/report-builder-3-0-with-vs2010-error/5669369#5669369.

     public void LoadReportDefinition(ReportViewer reportViewer, string reportPath)
     {
     string strReport = System.IO.File.ReadAllText(Server.MapPath(reportPath), System.Text.Encoding.Default);
     if (strReport.Contains("http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition"))
     {
     strReport = strReport.Replace("<Report xmlns:rd=\"http://schemas.microsoft.com/SQLServer/reporting/reportdesigner\" xmlns:cl=\"http://schemas.microsoft.com/sqlserver/reporting/2010/01/componentdefinition\" xmlns=\"http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition\">", "<Report xmlns:rd=\"http://schemas.microsoft.com/SQLServer/reporting/reportdesigner\" xmlns=\"http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition\">");
     strReport = strReport.Replace("<ReportSections>", "").Replace("<ReportSection>", "").Replace("</ReportSection>", "").Replace("</ReportSections>", "");
     }
     byte[] bytReport = System.Text.Encoding.Default.GetBytes(strReport);
     reportViewer.LocalReport.LoadReportDefinition(new MemoryStream(bytReport));
     }
    
    

    Simply call this function instead of setting the local report path on your report viewer object.  Here's an example.

     ReportViewer1.LocalReport.ReportPath = Server.MapPath( "~/RelativePath/ReportName.rdl"); // Replace this line
     LoadReportDefinition(ReportViewer1, "~/RelativePath/ReportName.rdl"); // With this line
    
    
    Of course you could also extend the ReportViewer class if you prefer.

    Also, this solution may not work for all reports definition files because it is removing the ReportSections and ReportSection nodes from the report definition XML document, however it has worked for all of the reports that I have tried so far.

    Kevin

    • Proposed as answer by ti994a Wednesday, August 31, 2011 8:07 PM
    Wednesday, August 31, 2011 8:05 PM
  • This solution may work for reports not using new possibilities of Report Builder 3.0. But if you want to use some of them (like Rotate270 WritingMode) it still won't work!
    Friday, October 28, 2011 8:58 AM
  • Reports that are created with ReportBuilder 3.0 cannot be run in Local Mode with the VS 2010 ReportViewer control, they can however be published to a SQL Server 2008 R2 report server and run in Remote mode.

    The Report Designer in Visual Studio creates reports that use the 2008 RDL schema (this is the same as ReportBuilder 2.0 and SQL Server 2008 BIDs), reports that are created in ReportBuilder 3.0 use the 2010 RDL schema (SQL Server 2008 R2 BIDs). Since the local processing engine in the control is based on the 2008 RDL engine it doesn't know how to handle a 2010 schema.

    The Developer Preview version of the new ReportViewer control has been published and is also available in the Visual Studio Developer Preview, this version is based on the SQL Server Denali CTP3 engine so it supports all versions of RDL that currently exist. Hope this helps clear up some of the confusion on this.

    Matt M.

    --------------------------------------------------------------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights

    Friday, October 28, 2011 11:21 PM
  • So this reply means the VS2012 will support the ReportBuilder 3.0 reports in the ReportView Control in LocalMode?

    WTB


    • Edited by WilBest Monday, April 9, 2012 5:49 PM
    Monday, April 9, 2012 5:39 PM
  • I have VS2012 and found that ReportBuilder 3 reports still doesn't work for local run in LocalMode.  It only worked after I applied this solution: http://beatheadagainstwall.blogspot.co.nz/2011/03/invalid-target-namespace-when-deploying.html#comment-form
    Monday, September 17, 2012 11:43 PM