14 Answers, 1 is accepted

I suggest to provide the Service Url as an inline parameter, i.e Service Url property of the WebServiceDataSource can be set as an inline parameter @Url, and then the value of @Url can be provided as an Expression (i.e. taken from a Report Parameter) so that its value to be evaluated run time. Please refer to this screen shot - https://www.screencast.com/t/jtcgJ2EAK
Regards,
Silviya
Progress Telerik

Hi,
If you see in your screenshot it says "Invalid URI: The hostname could not be parsed" .. It should use the Design-time Value.
This aside, exactly the same message I get in the web viewer:
An error has occurred while processing Table 'table1':
Invalid URI: The hostname could not be parsed
Hi Marius,
Which version do you use? There is a known problem with our latest official release 13.2.19.918 related to WebServiceDataSource. It has been fixed in the Internal Build 13.2.19.1004 - 'WebServiceDataSource - Parameters are not correctly evaluated during processing'. You may upgrade to the Latest Internal Build.
Regards,
Todor
Progress Telerik

I am trying to implement the inline url, and have 2 problems:
1. It does not work
2.I need to concat the controller's method name to the url, different to each service data source.
when I see the service url it is written as "@url" (attached picture of the parameters in the report, and the result on the server)
angular client side code:
let rs = {
report: this.reportName,
authenticationToken: token,
parametersAreaVisible: false,
parameters: {
Url:'http://localhost:52913/api/alarms/'
}
} as unknown as JSON;
When I want to concat Url with method name do I do it on the parameters form like:
value= Parameters.Url,Value+"myMethodName
or on the ServiceUrl property like : @url myMethodName
maybe i need some brackets?
TX
Tally

OK I got it to work:
I had my own code problems, to make the problems above.
1. Add a parameter to the whole report, to represent the Url, lets call it Url
2. On the client side:angular client side code:
let rs = {
report: this.reportName,
authenticationToken: token,
parametersAreaVisible: false,
parameters: {
Url:'http://localhost:52913/api/alarms/'
}
} as unknown as JSON;
3.add an inline parameter to each web service data source. Name: @Url Type: inline Value: = Parameters.Url.Value +'myMethodName'
4.set the service url of this web service data source to @Url
Hope I have helped.

I'm using Telerik Reporting R3 2019 but still error: "Invalid URI: The hostname could not be parsed"
Hello Thanh,
The problem you experience may be due to a known issue with version 13.2.19.918. The problem is fixed in the Service Pack - version 13.2.19.1030 - Fixed-Web Service Data Source-Parameters are not correctly evaluated during processing. Test to upgrade to our latest version and check whether the problem will be fixed.
Regards,
Todor
Progress Telerik


I have a slightly different scenario, but still along the same lines as this.
Our reports use WebServiceDataSource with the Service URL defined as @Url and at run-time this value set using the DataSource parameter passed into the report form our web page. (i.e. = Parameters.DataSource.Value). This all works fine. The DataSource value would be:
https://<domain>/api/Reports/v1.0/Security
Our reports also include parameters, one of which is a list of customer sites. So I created another WebServiceDataSourcecalled dsSitesParam and set the Service URL to @Url1. The API would be similar to the DataSource value except the 'Security' text would be replaced with 'Sites', so at run-time we are using the same DataSource paramater but using the Replace function to change the 'Security' to 'Site'. (i.e. = Replace(Parameters.DataSource.Value,"Security","Sites")
At design time when using the hard-coded path to the Sites api and can download the site just fine. See screenshot dsSitesParam.
The reports also have a Sites parameter. When using a CSV Data Source for this parameter, it works fine. When I set it to use the dsSitesParam data source, the report fails to load with the following error:
Invalid URI: Hostname could not be parsed
Should I be able to use the Replace function of the DataSource value to change it to the correct API to be used for getting the list of sites?
Hi Shawn,
I tested the described scenario as I understood it and can confirm that you may use the Replace function when setting the WebServiceDataSource Url through an Expression. I have attached a demo report with the Web API project exposing the data services. The data services run on 'http://localhost:50160/api/data' and 'http://localhost:50160/api/site'. The parameter 'Parameter1' has AvailableValues coming from 'webServiceDataSource2', which Url is set with:
= Replace(Parameters.Url.Value,"data","site")
I suspect that there is something inaccurate in the final Url. You may use Fiddler to access the exact requests to check this.
Regards,
Todor
Progress Telerik

Todor,
Thank you for the reply. After some further testing and moving things around it came down to the order in which the parameters were being defined. I was trying the process the 'Sites' parameter which was using the 'Replace' function on a parameter ('DataSource') that was not yet defined. So I moved the 'Sites' parameter down the list so that it was being defined after the 'DataSource' parameter.
Working fine now.
Regards,
Shawn

Hi Marius,
Which version do you use? There is a known problem with our latest official release 13.2.19.918 related to WebServiceDataSource. It has been fixed in the Internal Build 13.2.19.1004 - 'WebServiceDataSource - Parameters are not correctly evaluated during processing'. You may upgrade to the Latest Internal Build.
Regards,
Todor
Progress Telerik
Hi Marius,
Which version do you use? There is a known problem with our latest official release 13.2.19.918 related to WebServiceDataSource. It has been fixed in the Internal Build 13.2.19.1004 - 'WebServiceDataSource - Parameters are not correctly evaluated during processing'. You may upgrade to the Latest Internal Build.
Regards,
Todor
Progress Telerik
[/quote]
Hello Todor
I am on version 14.1.20.618. Is this still a problem b/c i am getting it? I followed Silviya's example and i get data appearing when i go through the Configure Web Service Data Source, however, i still get this error.
Hello omar,
The issue is fixed and should not occur in version 14.1.20.618. Can you send us a runnable report that demonstrates the problem? For example, you may open a support ticket and attach the project there.
Regards,
Todor
Progress Telerik
Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).
Is this still an issue with 18.1.24.514? when I use @Url in Service Url of Web Service Data Source, make this Inline and the value being = Parameters.Url.Value, I get the error message "unable to cast object of type Telerik.Reporting.Processing.Expressions.ProcessingEvalProvider to type Telerik.Reporting.Expressions.IValueObject". It works if the actual Url is put in as a string constant.
Hi Jeff,
The known problem has been fixed with R3 2019 SP1 (13.2.19.1030).
Please, check the article section Using Inline Parameters in Service Url for details on the configuration.
Hello Jeff,
I tested locally with the Standalone Report Designer and the Download button of the WebServiceDataSource Wizard worked as expected when I provided valid Design-Time values for the parameters - see the linked muted video. Please, ensure you have provided such values as they are respected when testing the Web Service with the Download button. The actual parameter values are applied in run-time.