1
votes

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

1 Answers

1
votes

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