The report definition has an invalid target namespace rsInvalidReportDefinition
I wrote a simple PowerShell script that follows the ideas of the accepted answer.
$file = (Get-Content "InputFileNameHere.rdl")
# Unwraps the Body and the Page element.
# Simple string replacement
$file = $file -replace '<ReportSections>',""
$file = $file -replace '<ReportSection>',""
$file = $file -replace '</ReportSection>',""
$file = $file -replace '</ReportSections>',""
# Parse the XML doc
$xml = [xml]$file;
# Set the XML namespace
$xml.Report.xmlns = "http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition";
# Delete ReportParametersLayout node
$xml.Report.RemoveChild($xml.Report.ReportParametersLayout);
# Save the file
Set-Content -Value $xml.OuterXml -Path "OutputFilenameHere.rdl"
Edit the first line to match your input file and the last line, save it as something.ps, run it and upload the new file.
Edit: The specific version of the report you set as the TargetServerVersion
property gets created in the BIN (\debug or wherever you build to) folder as long as you are not using any 2016 features.
I'm trying to find the same answer. You would think simply setting the solution's TargetServerVersion the way you did would cause it to use the right report definition (or optionally they could give you the option to add a pre-2016 report item)
Until then, if you right click the .rdl and "view code", you can change the following lines to make it work in SQL 2014 - just make a backup of your original .rdl in case you make a mistake:
1) Replace the report xmlns line with the following:
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
2) Remove the ReportSections and ReportSection lines, keeping the child tree structure body tag etc. below it). So remove these:
<ReportSections>
<ReportSection>
and these...
</ReportSection>
</ReportSections>
3) Remove the entire ReportParametersLayout section. So (e.g.) remove this:
<ReportParametersLayout>
<GridLayoutDefinition>
<NumberOfColumns>4</NumberOfColumns>
<NumberOfRows>2</NumberOfRows>
</GridLayoutDefinition>
</ReportParametersLayout>
Hit save, go back into the design and run the report. If you haven't modified the design it will work in SQL2014. The minute you change any fields it will revert to the 2016 schema.
If anyone sees a way to fix this behavior let us know. Thanks!
You can get reports in several different version formats from Visual Studio with the following steps:
- In project Property Pages set the
TargetServerVersion
to the desired format (in this caseSQL Server 2008 R2, 2012 or 2014
) - Build the project
- Find the rdl's in the desired format in the build output folder (specified in project Property Pages also:
Build => OutputPath
)
Try this step I found on this link and worked for me: Error while uploading a report
- Using SSDT in 2016, Set your target sql version to SQL Server 2008 R2, 2012 or 2014
- Clean the solution
- Rebuild the solution
- Copy the content of your Bin\debug folder and replace the content of the main folder with it (Be sure to have a backup)
- SSRS 2010 should render your project