Enumerating results view for data in an SSRS report

I have to inventory about 400 reports, and what I need to do is pull all the sql out of the reports. I'm able to XmlDocument load the results and navigate the information in VS and find the information i'm looking for. In each report I have to click \[code\]Results View\[/code\]I have to drill down results view for the following Elements.\[code\]{Element, Name="Report"}{Element, Name="DataSet"}{Element, Name="Query"}{Element, Name="Command Text"}\[/code\]I'm trying to get to the elemental Command Text, but i'm unsure of how to enurmate or access that level. here is the code i am using:\[code\] string[] Fil_Info = Directory.GetFiles(dir); foreach (string file in Fil_Info) { XmlDocument doc = new XmlDocument(); doc.Load(file); //Console.WriteLine(doc.Value.ToString()); XmlAttributeCollection attrColl =doc.DocumentElement.Attributes; foreach (XmlAttribute xmlAtt in attrColl) { XmlAttributeCollection attrColl2 = xmlAtt.Attributes; foreach (XmlAttribute xmlAtt2 in attrColl2) { } } }\[/code\]
 
Back
Top