We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Toolbar CsvExport

Thread ID:

Created:

Updated:

Platform:

Replies:

142320 Jan 28,2019 11:52 AM UTC Jan 30,2019 05:14 AM UTC Angular - EJ 2 3
loading
Tags: Grid
Ane
Asked On January 28, 2019 11:52 AM UTC

Hello,

I have exported the content of the grid to a CSV file but it separates the columns with a ',' and I want them to be separated by a ';'. How can I do that?

Looking forward to hearing from you, 

Ane Perez de Nanclares

Thavasianand Sankaranarayanan [Syncfusion]
Replied On January 29, 2019 05:11 AM UTC

Hi Ane, 

Greetings from Syncfusion. 

Query: I have exported the content of the grid to a CSV file but it separates the columns with a ',' and I want them to be separated by a ';'. 
 
We have analyzed your query but we are not sure about your requirement. So please provide the below details, it will help us provide better solution as soon as possible. 

  1. Where does the grid columns separated with the ‘,’?
  2. Please provide the exact steps to achieve your scenario?
  3. Please reproduce it in the below provided sample?
 
 
Please get back to us for further assistance. 
 
Regards, 
Thavasianand S. 


Ane
Replied On January 29, 2019 08:32 AM UTC

Hello, 

Here are the answers to the questions you made. If you need something else please tell me and I will send you all the information that you required as soon as possible. 
  • Where does the grid columns separated with the ‘,’? When you export the content of the grid to a CSV file the columns are separated by a ','. Here it is one example:
 
  • Please provide the exact steps to achieve your scenario?
<ejs-grid #grid id='Grid' [dataSource]='data' [toolbar]='toolbar' [allowExcelExport]='true' (toolbarClick)='clickHandler($event)'>

In the .ts:

import { GridComponent, FilterSettingsModel, IFilter, ExcelExportService, ToolbarItems } from '@syncfusion/ej2-angular-grids';
import { ClickEventArgs } from '@syncfusion/ej2-angular-navigations';

@Component({
selector: 'app-system-logs',
templateUrl: './system-logs.component.html',
styleUrls: ['./system-logs.component.css'],
providers: [ ExcelExportService]
})
export class ----Component implements OnInit {

toolbar: ToolbarItems[];
@ViewChild('grid')
grid: GridComponent;

constructor() {}

ngOnInit() {
this.toolbar = ['CsvExport'];
}

getContent() {
this.data = [
{ ------------------------------ },
{ ------------------------------ },
{ ------------------------------ }
];
}

clickHandler(args: ClickEventArgs): void {
console.log('Grid: ', args.item.id);
if (args.item.id === 'Grid_csvexport') {
this.grid.csvExport();
}
}

}

Thavasianand Sankaranarayanan [Syncfusion]
Replied On January 30, 2019 05:14 AM UTC

Hi Ane, 

We would like to inform you that by default a CSV (comma-separated values) file contains the values in a table as a series of ASCII text lines organized so that each column value is separated by a comma from the next column's value and each row starts a new line. Please refer the general documentation link below, 

So if you open the .csv, by default it will display as a comma separated value. Please get back to us if you need further assistance. 

Regards, 
Thavasianand S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;