New to Telerik Reporting? Download free 30-day trial

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 WebService with Post Method for the WebServiceDataSource. The Service returns a Person with Name and Surname.

Solution

Configuration of the WebServiceDataSource in the report : 1. There are two report parameters- NameParameter and SurnameParameter. The MultiValue property of the second one is set to True. The AvailableValues come from a CSV DataSource. Note that the single values include quotes so that the corresponding JSON values can be properly configured. 2. Set the Value property of the parameters with the default values. 3. Add the WebServiceDataSource and set the Method to Post. 4. 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.

  1. In the Configure request parameters, add a parameter for the header and to set the Value and Design-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 the POST request should be Inline parameters. The demo application could be downloaded from here.

In this article