- Home
- Forum
- Angular - EJ 2
- Pivot View, CSV remote binding
Pivot View, CSV remote binding
Hi.
Acording to the documentation HERE for me to be able to use the CSV function of the pivot view, i need to suply a url, the problem is, my backend is protected using identity server, so i would also need to inform 2 headers, one for the bearer token, and one for the api-version identification. how can i solve this?
I saw that in another sample, syncfusion uses another method to download the CSV and later parses that using a function, is this the only options? sample
SIGN IN To post a reply.
2 Replies
1 reply marked as answer
SS
Saranya Sivan
Syncfusion Team
January 19, 2021 04:57 PM UTC
Hi Marcelo,
We are validating the reported requirement. And we will update you the further details in two business days.
Regards,
Saranya Sivan.
SS
Saranya Sivan
Syncfusion Team
January 21, 2021 05:04 PM UTC
Hi Marcelo,
We would like to inform you that your requirement can be achieved by adding the bearer token and API-version identification as a query string in the HTTP URL as mentioned in the below code snippet.
|
Client:
dataSourceSettings: {
type: 'CSV',
expandAll: true,
enableSorting: true,
allowLabelFilter: true,
allowValueFilter: true,
rows: [{ name: 'name' }],
columns: [{ name: 'isActive' }],
values: [{ name: 'age' }],
filters: [],
}
Server:
public class ValuesController : ApiController
{
// GET api/values
[HttpGet]
public HttpResponseMessage Get()
{
IEnumerable<KeyValuePair<string,string>> header= Request.GetQueryNameValuePairs();
//getting the value pairs from the query string
Console.WriteLine(header.ToList()[0].Value);//get the value in the header
HttpResponseMessage response = Request.CreateResponse();
return response;
}
}
|
Meanwhile, we have prepared a sample for your reference. Please find the sample link and video link below.
Client sample link: https://stackblitz.com/edit/angular-4aegs4-wkcunk?file=app.component.ts
Server sample link: https://www.syncfusion.com/downloads/support/directtrac/general/7z/CSVWebAPI143868584
Regards,
Saranya Sivan.
Marked as answer
SIGN IN To post a reply.
- 2 Replies
- 2 Participants
- Marked answer
-
MA MARCELO
- Jan 18, 2021 07:21 PM UTC
- Jan 21, 2021 05:04 PM UTC