Pass Parameters to Report Viewer From another Window

2 posts, 0 answers
  1. John
    John avatar
    6 posts
    Member since:
    Feb 2012

    Posted 17 Jun 2015 Link to this post

    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,



  2. Nasko
    Nasko avatar
    1045 posts

    Posted 19 Jun 2015 Link to this post

    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;

    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
Back to Top