This is a migrated thread and some comments may be shown as answers.

Obtain List of Parameters from TRDX Report

3 Answers 139 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kyle Smith
Top achievements
Rank 1
Kyle Smith asked on 19 Dec 2013, 05:28 PM
Hello,
I have a need to be able to parse the list of Report Parameters from a TRDX report file. Can I do this through the Telerik Reporting API, or should I simply load and parse the TRDX as an XML document?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Kyle Smith
Top achievements
Rank 1
answered on 19 Dec 2013, 08:13 PM
I ended up just doing this to load a list of parameters:

var reportXml = XElement.Load(reportPath);
var parameters = reportXml.Elements(XName.Get("ReportParameters", "http://schemas.telerik.com/reporting/2012/3.4"))
                .Elements(XName.Get("ReportParameter", "http://schemas.telerik.com/reporting/2012/3.4"));

I'm still interested to know if I overlooked some part of the Telerik Reporting API that would have handled this for me.

Thanks!
0
Accepted
Stef
Telerik team
answered on 20 Dec 2013, 09:50 AM
Hello Kyle,

You can deserialize the XML report definition(trdx file) and iterate the ReportParameters collection. This approach also allows you to customize the report definition before processing/displaying it.

I hope this information helps you.

Regards,
Stef
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

0
Kyle Smith
Top achievements
Rank 1
answered on 20 Dec 2013, 01:38 PM
Thank you. That was exactly what I needed.
Tags
General Discussions
Asked by
Kyle Smith
Top achievements
Rank 1
Answers by
Kyle Smith
Top achievements
Rank 1
Stef
Telerik team
Share this question
or