Skip to content

Commit 583d7aa

Browse files
dimodidimodi
authored andcommitted
polishing
1 parent 404ad11 commit 583d7aa

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

knowledge-base/grid-csv-export-change-field-delimiter.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,36 @@ page_title: Grid export to CSV - change the default field delimiter (comma)
66
slug: grid-kb-csv-export-change-field-delimiter
77
position:
88
tags: grid, export, csv, field, delimiter, change, semicolon, comma, custom
9-
ticketid: 1576816
9+
ticketid: 1576816, 1699366
1010
res_type: kb
1111
---
1212

1313
## Environment
14+
1415
<table>
15-
<tbody>
16-
<tr>
17-
<td>Product</td>
18-
<td>Grid for Blazor</td>
19-
</tr>
20-
</tbody>
16+
<tbody>
17+
<tr>
18+
<td>Product</td>
19+
<td>Grid for Blazor</td>
20+
</tr>
21+
</tbody>
2122
</table>
2223

23-
2424
## Description
25+
2526
I want to change the default field delimiter when exporting the Grid to CSV file. How to set a different list separator?
2627

2728
I want to use a semicolon field delimiter for the exported CSV Grid instead of comma. How to achieve this?
2829

29-
>tip At the time of writing (**UI for Blazor 3.5.0**), the Blazor Grid [does not expose a built-in option for configuring the field delimiter](https://feedback.telerik.com/blazor/1577167-option-to-configure-the-field-delimiter-when-exporting-to-csv). You may vote for the enhancement and follow it to receive status updates.
30+
>tip The Blazor Grid [does not expose a built-in option for setting the CSV delimiter](https://feedback.telerik.com/blazor/1577167-option-to-configure-the-field-delimiter-when-exporting-to-csv). You can vote for the enhancement and follow it to receive status updates. It depends on a [feature of RadSpreadProcessing](https://feedback.telerik.com/document-processing/1356286-spreadstreamprocessing-implement-settings-for-changing-the-delimiter-and-quote-when-exporting-to-csv).
3031
3132
## Solution
3233

33-
A possible option is to manually modify the exported CSV file before it reaches the client to change the field delimiter.
34+
Modify the exported CSV file before it reaches the user to change the field delimiter.
3435

35-
For that purpose use the [`RadSpreadProcessing`](https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/overview) library - it allows you to create spreadsheets from scratch, modify existing documents or convert between the most common spreadsheet formats. In this case, we will focus on the [`CsvFormatProvider` which exposes setting to configure the field delimiter](https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/formats-and-conversion/csv/settings).
36+
Use the [`RadSpreadProcessing`](https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/overview) library. It allows you to create spreadsheets from scratch, modify existing documents or convert between the most common spreadsheet formats. In this case, we will focus on the [`CsvFormatProvider` which exposes setting to configure the field delimiter](https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/formats-and-conversion/csv/settings).
3637

37-
To change the CSV value delimiter, do the following:
38+
To change the CSV value delimiter:
3839

3940
1. Install the `Telerik.Documents.Spreadsheet.FormatProviders.Xls` NuGet package, so you can use the `CsvFormatProvider`.
4041
1. Handle the [Grid `OnAfterExport` event](slug:grid-export-events#onafterexport). The `Stream` it provides is finalized, so that the resource does not leak. Its binary data, however, is available, so you can copy the stream bytes to a new `MemoryStream` instance.
@@ -94,7 +95,7 @@ To change the CSV value delimiter, do the following:
9495
//Import the stream to a Telerik Workbook
9596
Workbook workbook = formatProvider.Import(importCsvStream, new TimeSpan(0, 0, 5));
9697
97-
//Create a new MemoryStream to export the modified Workbook
98+
//Create a new MemoryStream to export the modified Workbook.
9899
using MemoryStream exportCsvStream = new MemoryStream();
99100
100101
//Set the desired new CSV delimiter.
@@ -138,7 +139,6 @@ To change the CSV value delimiter, do the following:
138139

139140
## See Also
140141

141-
* [Format numbers and dates in the exported CSV file from the Grid](slug:grid-kb-number-formatting-of-the-csv-export)
142-
* [Custom cell formatting of the exported file with RadSpreadProcessing](slug:grid-kb-custom-cell-formatting-with-radspreadprocessing)
143-
* [Configure Document Processing Libraries](slug:getting-started-vs-integration-dpl)
144-
142+
* [Format numbers and dates in the exported CSV file from the Grid](slug:grid-kb-number-formatting-of-the-csv-export)
143+
* [Custom cell formatting of the exported file with RadSpreadProcessing](slug:grid-kb-custom-cell-formatting-with-radspreadprocessing)
144+
* [Configure Document Processing Libraries](slug:getting-started-vs-integration-dpl)

0 commit comments

Comments
 (0)