Duplicated
Last Updated: 11 Oct 2024 13:37 by ADMIN
Lennert
Created on: 17 Sep 2024 08:41
Type: Feature Request
1
Allow overriding the Telerik Reporting service DelegatingHandler or HttpClientHandler

Hi,
For our product we were looking into adding additional Request headers to the HTTP requests made by the Telerik Reporting library to the webservice data endpoints for our reports.
We tried adding the headers through a custom DelegatingHandler or HttpClientHandler, but found those were not being picked up.
Not when using the Web Report Designer or Blazor Report Viewer.

Any change we could register such a DelegatingHandler or HttpClientHandler?
Or any other suggestion on a how to add additional headers to the outgoing requests?

Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
3 comments
ADMIN
Dimitar
Posted on: 11 Oct 2024 13:37

Hello Lennert,

Thank you for the provided information about the request!

The requests triggered by the client will be visible in the Network tab of the browser's DevTools. I am referring to the requests made by the Report Viewer and the Web Report Designer to the Reporting REST Service for the report rendering. Any custom headers added to the requests made to those endpoints will be visible when the request is inspected in the Network tab, we have no control over this I am afraid.

With that being said, there already is a feedback item requesting the ability to add custom headers to those requests - Allow adding custom headers to requests from the report viewers that use Reporting REST Service (telerik.com), and I have thus marked this item as a duplicate.

Regarding the WebServiceDataSource, the requests for the data are made on the server with the HttpClient and are not visible through the Network tab. For that reason, I believe that it is safe to add those headers with the approach from the Using Parameters with WebServiceDataSource explained with examples - Telerik Reporting article.

The parameters of the WebServiceDataSource component can be connected to Report Parameter so their values do not have to be static. When you need to dynamically provide the value on the server, you may implement a custom IReportSourceResolver. In its Resolve method, you may set new values to those report parameters whose values will be passed to the request headers when the report engine gets to the stage where it makes the request to the service URL of the WebServiceDataSource component to get the data. The report parameters themselves are not visible by default so the end-users won't be able to see them unless the setting is manually changed.

For more details on how to implement such a resolver, you may refer to the Using Custom ReportSource Resolver and Custom ReportDocument Resolver - Telerik Reporting article.

I hope that the provided information is helpful. Please let me know if you have any further input.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Lennert
Posted on: 04 Oct 2024 14:52

Hi Dimitar,

Thanks for your comment.
To clarify, we are looking at adding a header parameter with the following restrictions:

  • the header should not be visible by the client (report viewer or web report designer)
  • the header value is not static. It is a dynamic value that is set by the backend.
  • the header should be added to all requests made by the backend to the webservice api endpoint, whether the data was request to render a report in the report viewer or for the various datasource requests made by the web report designer at design time or preview time.

Correct me if I'm wrong, but I don't think your suggestion on using report parameters would fit the above restrictions.

Kind regards,

Lennert


ADMIN
Dimitar
Posted on: 24 Sep 2024 08:32

Hi Lennert,

If I understand correctly, you would like to add additional request headers to the HTTP/HTTPS requests made by the WebServiceDataSource components used in the reports, is that correct?

Please note that this is already supported by the WebServiceDataSource component through its Parameters collection and they can be defined in the report design itself.

You may have a look at the Header Parameters section of the Using Parameters with WebServiceDataSource explained with examples - Telerik Reporting article for more details on how to do that.

If you connect the request parameters to report parameters, you will be able to also dynamically change the request parameter values through the ReportSource property of the WPF Report Viewer since you can use it to pass new values to the report parameters - Setting ReportSource to ReportViewers Explained - Telerik Reporting.

If this is not the scenario that you are having issues with, please share more details on it so that we can have a better idea of the problem.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.