´╗┐ How To: Pass Values to Report Parameters
Progress® Telerik® Reporting R2 2018

How To: Pass Values to Report Parameters

This topic explains how to update the report parameters with values passed from the custom UI instead of using report viewer's default parameters area. The report and all required parameters for it are packed in a ReportSource object. To update the report source, the setReportSource(rs) method is used.

  1. Add an element that triggers the refresh of the viewer in html page:

    HTML
    <button (click="onButtonClick(value)">Update parameter value</button>
  2. Declare the variable for the viewer and update the viewer's report source with a new parameter value:

    JavaScript
            import { Component, ViewChild } from '@angular/core';
    ...
    export class AppComponent {
    @ViewChild('viewer1') viewer;
    ...
      onButtonClick(param: string) {
    var rs = {
            report: 'Telerik.Reporting.Examples.CSharp.Invoice, CSharp.ReportLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null',
            parameters: {OrderNumber: param}
        };
    
    this.viewer.setReportSource(rs);
    }

    SetReportSource method will automatically reload the report with new parameters into the view.

See Also

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy