Compress oData Json response

Hello 

I am using DataManager with Adapters.ODataV4Adaptor. I want the incoming Json information to be compressed. How do I need to do this.

Thanks a lot...


5 Replies

RS Renjith Singh Rajendran Syncfusion Team February 4, 2022 11:14 AM UTC

Hi Seckin, 
 
Greetings from Syncfusion support. 
 
By default, ODataV4Adaptor will bind the data from the service to grid. We will be handling this data binding in our source level itself. Now you can perform data related operations with the data bind to Grid.  
References :  
 
We are not clear about the exact scenario or requirement regarding compress the incoming json. 
 
  1. Share a detailed explanation of your complete requirement.
  2. Share the details regarding “compress the incoming json”.
  3. Share with us a video demo explaining your exact scenario or requirement.
 
The provided information will help us analyze the problem, and provide you a solution as early as possible. 
 
Regards, 
Renjith R 



SK Seckin Karabacakoglu February 4, 2022 11:43 AM UTC

Hi Renjith

I am using SfPivotView for some reports. I pull data from Odata service. The amount of rows can be too much. There is no problem in the query part in the database, but there may be slowness during the transfer of this data.

I turned on the compression feature on the Odata side. When you make a request with Postman, the data is compressed and it comes faster.


Reards

Seçkin



RS Renjith Singh Rajendran Syncfusion Team February 8, 2022 01:53 AM UTC

Hi Seckin, 
 
We have forwarded the reported scenario to the corresponding development team. We will update you further details on or before February 10, 2022. 
 
Until then we appreciate your patience. 
 
Regards, 
Renjith R 



SK Seckin Karabacakoglu February 16, 2022 11:29 PM UTC

Hi

is there any new information?


Regards



RS Renjith Singh Rajendran Syncfusion Team February 17, 2022 05:20 AM UTC

Hi Seckin, 
 
Sorry for the inconvenience. We have option to override internal methods of ODataV4Adaptor class. So we suggest you to check your scenario by overriding the ProcessResponse method of ODataV4Adaptor class. Inside this ProcessResponse method you can perform your custom action. Please refer and use as like the code below, 
 
 
<SfGrid TValue="Order" AllowPaging="true"> 
    <SfDataManager @ref="DataManagerRef" Url=https://services.odata.org/V4/Northwind/Northwind.svc/Orders/ Adaptor="Adaptors.ODataV4Adaptor"></SfDataManager> 
    ... 
</SfGrid> 
 
@code{ 
       ... 
       public SfDataManager DataManagerRef { get; set; } 
       protected override void OnAfterRender(bool firstRender) 
       { 
          if (firstRender) { 
            DataManagerRef.DataAdaptor = new NewODataClass(DataManagerRef); 
          } 
          base.OnAfterRender(firstRender);                  
       } 
       public class NewODataClass : ODataV4Adaptor 
       { 
           public NewODataClass(DataManager dm) : base(dm) 
           { 
           } 
           public override async Task<object> ProcessResponse<T>(object data, DataManagerRequest queries) 
           {                 
               HttpResponseMessage response = data as HttpResponseMessage; 
    
               //you can customize the response here 
 
               var ActualReturnValue = await base.ProcessResponse<T>(data, queries); 
               return ActualReturnValue; 
           } 
       } 
} 
 
 
Kindly check your scenario by using the above suggestion from your side and if you are facing any difficulties then kindly share with us the details for further assistance. 
 
Reference :  
 
Regards, 
Renjith R 


Loader.
Up arrow icon