Post Method to Pass Parameter in WebServiceDataSource
Environment
Product Version | 12.2.18.1129+ |
Product | Progress® Telerik® Reporting |
Description
The attached project demonstrates using a REST Web Service with Post
Method for the WebServiceDataSource. The Service returns a Person
with Name
and Surname
.
Solution
Configuration of the WebServiceDataSource in the report:
-
There are two report parameters-
NameParameter
andSurnameParameter
.The
MultiValue
property of the second one is set toTrue
.The
AvailableValues
come from a CSV DataSource. Note that the single values include quotes so that the corresponding JSON values can be properly configured. Set the
Value
property of the parameters with the default values.- Add the WebServiceDataSource and set the
Method
toPost
. -
Because the values will be defined through the parameters, set the
Body
as follows:{ "Name": "@name", "Surname": @surname }
You can see that the
Surname
is without quotation marks because it is an array of strings. -
In the Configure request parameters, add a parameter for the header and to set the
Value
andDesign-Time Value
of the report parameters.
Notes
- The
Content-Type
Header parameter that is necessary is case-sensitive. - The parameters passed through the
Body
of thePOST
request should beInline
parameters. - The demo application could be downloaded from our Reporting-Samples GitHub repository.