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-
NameParameterandSurnameParameter.The
MultiValueproperty of the second one is set toTrue.The
AvailableValuescome from a CSV DataSource. Note that the single values include quotes so that the corresponding JSON values can be properly configured. Set the
Valueproperty of the parameters with the default values.- Add the WebServiceDataSource and set the
MethodtoPost. -
Because the values will be defined through the parameters, set the
Bodyas follows:{ "Name": "@name", "Surname": @surname }
You can see that the
Surnameis 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
ValueandDesign-Time Valueof the report parameters.
Notes
- The
Content-TypeHeader parameter that is necessary is case-sensitive. - The parameters passed through the
Bodyof thePOSTrequest should beInlineparameters. - The demo application could be downloaded from our Reporting-Samples GitHub repository.