Send the DataSource from FrontEnd to The List&Label Service

I’m using list&labels to integrate a web app with angular.
So I’m using webreportviewer and webreportdesigner.

I’m thinking of a great approach, but I’d like to know if it’s possible to implement, in my front-end application imagine I’m in a table (List of Articles), at this point I already have the data, would it be possible for me to send the dataSource from the front-end to the list&labels backend and for it to assemble the dataSet based on this dataSource?

This approach would eliminate the need for me to make another query in the backend to get the dataSource.

Try the following approach:

Implement an endpoint where you can send your data source as JSON - for example, like this:

[HttpGet, ActionName("MyCustomJsonData")]
Dictionary<string, string> MyCustomJsonDataDictionary = new Dictionary<string, string>();

public void MyCustomJsonData(string id, string jsonData)
{
    MyCustomJsonDataDictionary.TryAdd(id, jsonData);
}

When calling the WebReportDesigner, add customData with the ID to the call:

<ll-webreportdesigner backendurl="https://localhost:44382/WebReportDesigner" customData="MyCustomId" />

When the OnProvideListLabel call is made, check the provideListLabelContext.ClientCustomData property. This will give you the ID, and you can retrieve the corresponding JSON from the MyCustomJsonDataDictionary.

Finally, create a JsonDataProvider using this JSON data.

Hope this helps.

Thank you so much! I will try this.

1 Like

I have another question.

Is this a recommended approach? No matter how many strategies I came up with to reduce latency, implement distributed caching and so on.
Especially in a multi-tenant application like the one I’m working on, which will serve thousands of customers. Or is it still preferable to query the database directly via backend?

Your approach is quite unusual, typically applications go via the database. But with List & Label, the approach is irrelevant, and you can implement it the way you want.