Getting the report parameters from RDL that is in an XElement

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Im querying an RDL file and want to get the report parameter values out.
For example:
<ReportParameters><br/>
<ReportParameter Name="firstname <br/>
<DataType>String</DataType><br/>
<Nullable>true</Nullable><br/>
<Prompt>firstname</Prompt><br/>
</ReportParameter>
</ReportParameters>
I know somewhere its not that difficult but Im struggling to get it. I want to get the report parameter name and its datatype.
Any suggestions on how I could easily get the datatype from the report parameter?
Thanks.

This is my code to get the report parameter name.

<pre>var reportParameterElements = x.Descendants(_reportDefinitionNamespace + "ReportParameter");

foreach (XElement reportParameterElement in reportParameterElements)
{
// Get the name of the report parameter.
XAttribute parameterNameAttribute = reportParameterElement.Attribute("Name");
<br/>
<br/>
}
[/code]


View the full article
 
Back
Top