Parameters in the post body

Posted by: bolsen on 13 May 2021, 1:46 am EST

  • Posted 13 May 2021, 1:46 am EST

    I am looking to get the value of a parameter into my post body. Is this possible?
    {
    "Client": " $CalculatedField "
    }
  • Replied 16 May 2021, 9:15 pm EST

    Hello, Brett,
    Yes, it is possible, you can use the interpolation syntax for the post body:
    https://www.grapecity.com/activereportsjs/docs/ReportAuthorGuide/Expressions/index#interpolation-syntax
    A report parameter can be referenced by its name prefixed with the @ character, for example, {@OrderId}. At runtime, it is replaced with the parameter value.
  • Replied 16 May 2021, 10:56 pm EST

    I cannot get this to work, it works if it is passed as a parameter to the URL but not as a payload. Is there an example of this working?
  • Marked as Answer

    Replied 16 May 2021, 11:10 pm EST

    The sample report is attached.

    PostBodyParams.zip
  • Replied 17 May 2021, 3:14 pm EST

    Great thank you, the issue was the way I was concatenating.

    Sorry another thing I'm really struggling with is if the parameter is left empty I want to ignore it or put a placeholder value. =IIF(Parameters!Client.Value <> "", "" & Parameters!Client.Value & "", "*" )
  • Replied 17 May 2021, 8:23 pm EST

    It seems that you are using v2.0.x version. I strongly recommend updating to the latest version 2.1.0
    It has simplified version of expression language:
    https://www.grapecity.com/activereportsjs/docs/ReportAuthorGuide/Expressions/index#interpolation-syntax
Need extra support?

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

Learn More

Forum Channels