SSRS Change XML Data Tags in Report Output

KANEDA 0149
KANEDA 0149 used Ask the Experts™
on
I have created a report from a stored procedure query that works fine.  This report is published to our report server and the 2nd piece I would like to incorporate is the option to export completed report as an XML format.

The challenge is change the XML tags to something custom.  In the screenshot shown below, this is the XML output from my SSRS report but I need it in the 2nd screenshot shown just below it.  I have also attached the 2 different XML samples.

For example;
» change <Report xsl:schemaLocation...> to <Bonaire> (hardcoded)
» change <table2> to <RevportHeader FileDate=...> (hardcoded)
» change <Detail Collection> to <RevportBody DataType="AccountData"> (hardcoded)
» change <Detail> to <AccountData> (hardcoded)
» change </Detail_Collection> to </RevportBody> (hardcoded)
» change </table2> to <RevportTrailer DataType="AccountData" RecordCount="13"> (hardcoded except the record count, that would be dynamic based on the number of rows from the report)
» lastly change </Report> to </Bonaire>

Example screenshot of XML filesXML-SSRS-Output.xml
XML-Expected-Output.xml
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Database Developer
Top Expert 2014
Commented:
I don't believe you can customize the standard XML output like that, but you might be able to create a custom query that directly generates the XML that you need (FOR XML), and simply render that text into a standard report where the user can copy/paste into a new XML document. Not ideal.

Author

Commented:
Darn... thanks Russell Fox!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial