Using Parameter in JSViewer

Posted by: duonghb53 on 28 March 2021, 6:46 pm EST

    • Post Options:
    • Link

    Posted 28 March 2021, 6:46 pm EST

    Dear Support Team

    I have an issues.

    I want Parameter when select input from html form idYear but I can’t set parameter to JSViewer.

    I read JSViewer API but it has too little information:

    https://www.grapecity.com/activereportsnet/docs/v14/online/using-js-viewer.html

    What do I need to do?

    Please help me.

    Thank a lot.

    export class ReportViewerComponent {

    private viewer: any;

    private prms: any;

    @Input() idYear;
    

    @Input() set reportId(reportId: string) {

    if (!this.viewer) {

    this.viewer = GrapeCity.ActiveReports.JSViewer.create({

    element: ‘#viewerPlaceHolder’,

    //reportID: reportId,

    reportParameters: [{ name: ‘testPrms’, values: [‘4’] }]

    });

    }

      this.viewer.openReport(reportId);
      //console.log("ReportViewerComponent:" + this.idYear);
    

    }

    }

  • Posted 31 March 2021, 2:47 pm EST

    Hello,

    You can pass the parameter value directly through the reportParameter API as follow:

    reportParameters: [{ name: ‘ParameterName’, values: [VariableName] }]

    If issue still reproducible, then you can share the stripped down sample so that I can able to replicate the issue.

    Thanks,

    Mohit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels