CustomHttpHeaders not working in <ll-webreportdesigner> (List & Label 30)

Hello,

I’m using List & Label version 30 and integrating the <ll-webreportdesigner> component in an Angular application. I’m trying to pass custom headers using the CustomHttpHeaders attribute, like this:

<ll-webreportdesigner
  backendUrl="https://localhost:44394/LLWebReportDesigner"
  CustomHttpHeaders="Authorization=Bearer my-token;X-Language=pt"
></ll-webreportdesigner>

However, these headers are not received on the backend. In my controller (which inherits from WebReportDesignerController), I try to access the headers via:

var authHeader = this.HttpContext.Request.Headers["Authorization"].FirstOrDefault();
var langHeader = this.HttpContext.Request.Headers["X-Language"].FirstOrDefault();

But both values are always null. I’ve confirmed that:

  • I’m using version 30 of List & Label;
  • CORS is correctly configured on the backend;
  • The headers do not appear in the network tab of browser dev tools either.

Is there anything I’m missing?
Is there a specific way or timing when CustomHttpHeaders needs to be set for them to take effect?

Thanks in advance for any help!

Best regards,
Domingos Matumona

Hi,

according to our development department you can use authType and authToken for authorization. Possible values for authType are:

  • Cookie
  • JWT
  • ThirdParty

In your case probably JWT should be the right one. For authToken you can pass your token.

The language is handled by the Web Report Viewer/Web Report Designer by itself.

Does it also answer your second thread Add custom http headers to Angular Client Side Report Designer and Viewer?

Regards,

Chris

Hello, I would like to send my own language that is defined in the FrontEnd and in the BE take this value and be able to apply the correct LLLanguage when creating the ListLabel instance.

You can create a JSON object in the frontend.

customData="{your JSON object}"

This can then be passed to List & Label in the OnProvideListLabel event of the WebReportDesignerController as a customdata object - analogous to authType and authToken.

The problem is that the customData comes with no value in the first execution of OnProvideListLabel, but an instance of ListLabel is already created defining a default language, and even if I try to overwrite it after receiving the customData, it doesn’t work accordingly. It translates some areas and the majority remain with Default (-1) set.

Currently, the language for the backend must be communicated earlier by the fontend, so that each ListLabel object to be created in the backend code for OnProvideListLabel can access it directly - globally.

We are currently investigating whether there is an even more elegant variant for this and will get back to you soon. In the short term, however, we can only provide you with the workaround just mentioned.