Upgrading Reporting Services Report from VS2008 to VS2010

跟風遠走 提交于 2019-12-11 05:15:34

问题


I am trying to convert a reporting services file from VS2008 to VS2010. It is filled and saved without using the ReportViewer.

The following steps causes the error.

  1. Open the project in VS2010. All works fine.
  2. Open the .rdlc file. It upgrades.
  3. Run the application again. It fails.

I downloaded the sample from http://www.gotreportviewer.com/objectdatasources/index.html and am using the method from http://knol.google.com/k/microsoft-sql-server-reporting-services-ssrs#Data_Sources to save the info.

Is there any way round this error? I need to be able to use VS2010 to update the report.

[Error]

{"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."}

[Code]

//Test Code
try
{
     ReportViewer viewer = new ReportViewer();
     viewer.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(LocalReport_SubreportProcessing);
     viewer.ProcessingMode = ProcessingMode.Local;

     //Either get this via the embedded resource, or directly via the path. -> better to use embedded resource!
     viewer.LocalReport.ReportEmbeddedResource = "AuthorBooks.AuthorBooks.rdlc";        //Namespace.ReportName.rdlc           
     //viewer.LocalReport.ReportPath = @"C:\Test Projects\ReportingServicesWorking\AuthorBooks.rdlc";

            viewer.LocalReport.DataSources.Add(
                new ReportDataSource
                (
                "AuthorBooks_Author",
                m_authors
                )
                );

            string mime, encoding, extension;
            string[] streams;
            Warning[] warnings;

            byte[] report = viewer.LocalReport.Render("PDF", null,
                out mime,
                out encoding,
                out extension,
                out streams,
                out warnings);

            string outputPath = @"C:\Test Projects\ReportingServicesWorking\TestSave.pdf";
            File.WriteAllBytes(outputPath, report);
            Process.Start(outputPath);
        }
        catch (Exception ex)
        {
            //Do stuff here.
        }

回答1:


Make sure ReportViewer 2010 redistributable is installed, and that this version of the ReportViewer control is used in your application.



来源:https://stackoverflow.com/questions/8724996/upgrading-reporting-services-report-from-vs2008-to-vs2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!