Posted 13 May 2021, 10:46 am EST
I am looking to get the value of a parameter into my post body. Is this possible?
{
“Client”: " $CalculatedField "
}
Forums Home / ActiveReports / ActiveReportsJS
Posted by: bolsen on 13 May 2021, 10:46 am EST
Posted 13 May 2021, 10:46 am EST
I am looking to get the value of a parameter into my post body. Is this possible?
{
“Client”: " $CalculatedField "
}
Posted 17 May 2021, 6:15 am 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.
Posted 17 May 2021, 7:56 am 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?
Posted 17 May 2021, 8:10 am EST
The sample report is attached.
Posted 18 May 2021, 12:14 am 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 & “”, “*” )
Posted 18 May 2021, 5:23 am 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