Category / Section
How to programmatically query a list of parameters in a report
Published:
Updated:
ReportSerializer helper and RDL models are available in Bold Reports library to find the reports' elements information. Please find the following steps to get the report in the C# object model by using the Report Serializer and querying the list of parameters information from ReportDefinition.
FileStream fileStream = new FileStream( reportFolderPath + "\Resources\sales.rdl", FileMode.Open, FileAccess.Read);
MemoryStream reportStream = new MemoryStream();
fileStream.CopyTo(reportStream);
reportStream.Position = 0;
fileStream.Close();
BoldReports.RDL.DOM.ReportSerializer reportSerializer = new BoldReports.RDL.DOM.ReportSerializer();
// Method to get the reports with ReportDefinition object model
var reportDefintion = reportSerializer.GetReportDefinition(reportStream);
BoldReports.RDL.DOM.ReportSerializer reportSerializer = new BoldReports.RDL.DOM.ReportSerializer();
var dataset = reportSerializer.GetSharedDataSet(readStream);
var reportDefintion = reportSerializer.GetReportDefinition(readStream);
// Property to get the parameters information from report.
var reportParameters = reportDefinition.ReportParameters;