- Home
- Forum
- Angular - EJ 2
- Grid Toolbar CsvExport
Grid Toolbar CsvExport
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
SIGN IN To post a reply.
3 Replies
TS
Thavasianand Sankaranarayanan
Syncfusion Team
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.
- Where does the grid columns separated with the ‘,’?
- Please provide the exact steps to achieve your scenario?
- Please reproduce it in the below provided sample?
Please get back to us for further assistance.
Regards,
Thavasianand S.
AN
Ane
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();
}
}
}
TS
Thavasianand Sankaranarayanan
Syncfusion Team
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.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
AN Ane
- Jan 28, 2019 11:52 AM UTC
- Jan 30, 2019 05:14 AM UTC