You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/grid/export/csv.md
+15-9Lines changed: 15 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,11 +32,15 @@ To enable the grid CSV Export, add a [command button]({%slug components/grid/col
32
32
</GridToolBarTemplate>
33
33
````
34
34
35
-
Optionally, you can also set the `GridCsvExport` tag settings under the `GridExport` tag to choose:
35
+
Optionally, you can also set the `GridCsvExport` tag settings under the `GridExport` tag to subscribe to the [Grid export events](slug:grid-export-events) that allow further customization of the exported columns/data or configure the CSV export options:
36
36
37
-
*`FileName` - the name of the file. The grid will add the `.csv` extension for you.
38
-
*`AllPages` - whether to export the current page only, or the entire data from the data source.
39
-
* Subscribe to [Grid export events]({%slug grid-export-events%}) that allow further customizations of the exported columns or data.
Copy file name to clipboardExpand all lines: components/grid/export/events.md
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ You can customize the files exported to Excel and CSV by using the [OnBeforeExpo
21
21
-[OnAfterExport](#onafterexport)
22
22
-[For Excel Export](#for-excel-export-1)
23
23
-[For CSV Export](#for-csv-export-1)
24
-
-[For PDF Export](#for-pdf-export)
24
+
-[For PDF Export](#for-pdf-export-1)
25
25
26
26
## OnBeforeExport
27
27
@@ -258,14 +258,14 @@ To export a hidden Grid column that has its `Visible` parameter set to `false`,
258
258
*`Columns` - `List<GridPdfExportColumn>` - a collection of all exportable columns in the Grid. These are all visible `GridColumn` instances. You can customize the following attributes of the Grid column before exporting it into PDF:
259
259
260
260
*`Width` - define the width of the column **in pixels**.
261
-
*`Title` - define the column title to be shown in the Excel file header.
261
+
*`Title` - define the column title to be shown in the PDF file header.
262
262
*`NumberFormat` - provide an PDF-compatible number/date format
263
263
*`Field` - set the data bound field of the column.
264
264
265
265
To export a hidden Grid column that has its `Visible` parameter set to `false`, you can manually define an instance of the `GridPdfExportColumn` in the handler for the `OnBeforeExport` event and add that column to the `args.Columns` collection.
266
266
267
267
268
-
*`Data` - `IEnumerable<object>` - assign a custom collection of data to be exported to Excel, [for example only the selected items in the Grid]({%slug grid-kb-export-selected-rows%}).
268
+
*`Data` - `IEnumerable<object>` - assign a custom collection of data to be exported to PDF, [for example only the selected items in the Grid]({%slug grid-kb-export-selected-rows%}).
269
269
270
270
*`isCancelled` - `bool` - cancel the `OnBeforeExcel` event by setting the `isCancelled` property to `true`.
271
271
@@ -390,6 +390,8 @@ The `OnAfterExport` event fires after [OnBeforeExport](#onbeforeexport) and befo
390
390
391
391
*`Stream` - `MemoryStream` - The output of the Excel export as a memory stream. The stream itself is finalized, so that the resource does not leak. To read and work with the stream, clone its available binary data to a new `MemoryStream` instance.
392
392
393
+
>caption Get the stream of the exported Excel file
394
+
393
395
````RAZOR Excel
394
396
@* Get the output of the excel export as a memory stream *@
395
397
@@ -465,6 +467,8 @@ The `OnAfterExport` event fires after [OnBeforeExport](#onbeforeexport) and befo
465
467
466
468
*`Stream` - `MemoryStream` - The output of the CSV export as a `MemoryStream`. The stream itself is finalized, so that the resource does not leak. To read and work with the stream, clone its available binary data to a new `MemoryStream` instance.
467
469
470
+
>caption Get the stream of the exported CSV file
471
+
468
472
````RAZOR CSV
469
473
@* Get the output of the CSV export as a memory stream *@
470
474
@@ -536,10 +540,12 @@ The `OnAfterExport` event fires after [OnBeforeExport](#onbeforeexport) and befo
536
540
}
537
541
````
538
542
539
-
### For Pdf Export
543
+
### For PDF Export
540
544
541
545
*`Stream` - `MemoryStream` - The output of the PDF export as a memory stream. The stream itself is finalized, so that the resource does not leak. To read and work with the stream, clone its available binary data to a new `MemoryStream` instance.
542
546
547
+
>caption Get the stream of the exported PDF file
548
+
543
549
````RAZOR
544
550
@* Get the output of the PDF export as a MemoryStream *@
Copy file name to clipboardExpand all lines: components/grid/export/excel.md
+14-9Lines changed: 14 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,11 +32,14 @@ To enable the Grid Excel Export, add a [command button]({%slug components/grid/c
32
32
</GridToolBarTemplate>
33
33
````
34
34
35
-
Optionally, you can also set the `GridExcelExport` tag settings under the `GridExport` tag to choose:
35
+
Optionally, you can also set the `GridExcelExport` tag settings under the `GridExport` tag to subscribe to the [Grid export events](slug:grid-export-events) that allow further customization of the exported columns/data or configure the Excel export options:
36
36
37
-
*`FileName` - the name of the file. The grid will add the `.xslx` extension for you.
38
-
*`AllPages` - whether to export the current page only, or the entire data from the data source.
39
-
* Subscribe to [Grid export events]({%slug grid-export-events%}) that allow further customizations of the exported columns or data.
Copy file name to clipboardExpand all lines: components/grid/export/pdf.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ To enable the Grid PDF Export, add a [command button](slug:components/grid/colum
33
33
</GridToolBarTemplate>
34
34
````
35
35
36
-
Optionally, you can also set the `GridPdfExport` tag settings under the `GridExport` tag to subscribe to [Grid export events](slug:grid-export-events) that allow further customization of the exported columns/data or configure the PDF export options:
36
+
Optionally, you can also set the `GridPdfExport` tag settings under the `GridExport` tag to subscribe to the [Grid export events](slug:grid-export-events) that allow further customization of the exported columns/data or configure the PDF export options:
exportedPdfStream = new MemoryStream(finalizedStream.ToArray());
166
171
}
167
172
168
-
private List<SampleData> GridData { get; set; }
169
-
170
-
private bool ExportAllPages { get; set; }
171
-
172
173
protected override void OnInitialized()
173
174
{
174
175
GridData = Enumerable.Range(1, 100).Select(x => new SampleData
@@ -198,7 +199,7 @@ To customize the exported file, handle the `OnBeforeExport` or `OnAfterExport` e
198
199
199
200
The component allows you to control the data set that will be exported. It also provides built-in customization options for the columns such as `Width`, `Title` and more.
200
201
201
-
For more advanced customization (such as coloring the headers or bolding the titles) the Grid lets you get the `MemoryStream` of the file. Thus, you can customize it using the [`SpreadProcessing`](https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/overview)or the [`SpreadStreamProcessing`](https://docs.telerik.com/devtools/document-processing/libraries/radspreadstreamprocessing/overview) libraries that are available with your license. Find examples on how to [format the cells of the exported PDF file with RadSpreadProcessing](slug:grid-kb-custom-cell-formatting-with-radspreadprocessing) and how to [format the cells of the exported PDF file with RadSpreadStreamProcessing](slug: grid-kb-custom-cell-formatting-with-radspreadstreamprocessing).
202
+
For more advanced customization the Grid lets you get the `MemoryStream` of the file. Thus, you can customize it using the [`PdfProcessing`](https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/overview)library that is available with your license.
202
203
203
204
Read more about how to [customize the exported file](slug:grid-export-events).
0 commit comments