When using VS2015 or higher to edit an SSRS report, the XML generated is not compatible with Reporting Services 2012. We need to modify a couple of things. I'm trying to write a script that will just do that, programmatically.
I got the code to replace the xmlns definition and the code to remove the entire node .
I don't know how to REMOVE and KEEPING the childern. (using C#)
<ReportSections>
<ReportSection>
<Body></Body>
<Width></Width>
...
</ReportSection>
</ReportSection>
//THIS CODE DOES NOT WORK
//Remove <ReportSections></ReportSections> <ReportSection>/<ReportSection>
foreach (XmlNode child in rnode.ChildNodes)
{
if(child.Name.Equals("ReportSections",
StringComparison.InvariantCultureIgnoreCase))
{
child.ParentNode.AppendChild(child);
}
child.ParentNode.RemoveChild(child);
}
This is the code I wrote to delete including the childern.
//Remove <ReportParameters>...</ReportParameters> and all its content
foreach (XmlNode xNode in rnode.ChildNodes)
{
if (xNode.Name.Equals("ReportParameters", StringComparison.InvariantCultureIgnoreCase))
{
xNode.ParentNode.RemoveChild(xNode);
}
}