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

Pass Parameters to Report Viewer From another Window

1 Answer 137 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 17 Jun 2015, 03:38 PM

I must be missing something. I have a WPF app that I have a report that was designed within VS. I then followed the docs to create a Report Viewer. If I add a value to the report parameters from the designer the report works well. What I would like to do is display a window so the user can make choices mostly check boxes. Then pass the choices to the parameters of the report thru the report viewer.

Thank you,

John

 

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 19 Jun 2015, 12:06 PM
Hello John,

You can pass values to the report parameters programmatically in your application by using the ReportSource.Parameters collection.

For example, using a TypeReportSource you can pass a parameter value to the report via the following code:
var typeReportSource = new Telerik.Reporting.TypeReportSource();
 
// Specifying the assembly qualified name of the Report class for the TypeName of the report source
typeReportSource.TypeName = typeof(MyReport).AssemblyQualifiedName;
 
// Adding the initial parameter values
typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("MyParameter", "value"));
 
ReportViewer.ReportSource = typeReportSource;


Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or