passing parameter to JSViewer openReport()

Posted by: hafiz.hassan on 22 April 2021, 7:54 pm EST

  • Posted 22 April 2021, 7:54 pm EST

    Hi,
    AR15 JSViewer API documentation contains below function:
    openReport(reportID: string, reportParameters?: Array<Parameter>)

    However, I get 'Internal server error' when I try to pass parameter.
    Below is my code:
     <script type="text/javascript">
    var viewer = GrapeCity.ActiveReports.JSViewer.create({
    element: '#viewer-id',
    displayMode: 'Continuous',
    reportService: {
    url: 'api/reporting',
    },
    settings: {
    zoomType: 'FitPage'
    },
    });

    function buttonA()
    {
    viewer.openReport("MyReport.rdlx", [{ name: 'param1', values: '12' }]);
    }
    </script>
  • Marked as Answer

    Replied 25 April 2021, 1:22 am EST

    Hello,

    Try to use the following code:
    viewer.openReport("RdlReport1.rdlx", [{ name: 'Test', values: ['Test'] }]);

    Thanks,
    Mohit
  • Replied 15 July 2021, 2:37 am EST

    Hi, i have the same issue, when i send the parameters to openReport, i obtain this error message from the Backend..
    The JSON value could not be converted to System.Collections.Generic.Dictionary`2[System.String,GrapeCity.ActiveReports.Web.Viewer.I.+ParameterValuesQuery+RequestFields]. Path: $.request | LineNumber: 0 | BytePositionInLine: 103.


    Im using this code


    report = "CycleSummaryReport.rdlx"
    viewer.openReport(report, [{ name: 'CycleId', values: [Cycle] }, { name: 'Version', values: [Version] }, { name: 'WorkOrder', values: [WorkOrder] }, { name: 'RecipeId', values: [Recipe] }]);

  • Replied 15 July 2021, 6:39 pm EST


    Hello,

    Your query has been replied here:
    https://www.grapecity.com/forums/ar-dev/pasing-parameters-jsviewer

    Thanks,
    Mohit
Need extra support?

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

Learn More

Forum Channels