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: blazor/datagrid/print.md
+11-17Lines changed: 11 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,7 @@ documentation: ug
13
13
14
14
The **Print** feature in the Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid generates a print-ready view of DataGrid content for offline access and documentation. Initiate printing through the built-in toolbar option or programmatically using the [PrintAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_PrintAsync) method. The output reflects the DataGrid’s current state, including visible columns, sorting, and filtering, and opens the browser’s print dialog.
15
15
16
-
To enable printing from the toolbar, add the `"Print"` item to the [Toolbar](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_Toolbar) property.
17
-
18
-
**Example: Enabling Print Functionality**
16
+
To enable printing from the toolbar, add the **"Print"** item to the [Toolbar](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_Toolbar) property.
19
17
20
18
{% tabs %}
21
19
{% highlight razor tabtitle="Index.razor" %}
@@ -84,21 +82,19 @@ internal sealed class OrderData
84
82
85
83
## Page Setup for Printing
86
84
87
-
Print layout options such as `paper size`, `margins`, `headers` and `footers`, and `scaling` are controlled by the browser’s print dialog. These settings cannot be configured through **application code**. Refer to browser-specific setup guides:
85
+
Print layout options such as **paper size**, **margins**, **headers** and **footers**, and **scaling** are controlled by the browser’s print dialog. These settings cannot be configured through **application code**. Refer to browser-specific setup guides:
Printing can be triggered from external UI elements by calling the [PrintAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_PrintAsync) method programmatically. This opens the browser’s print dialog and reflects the current state of the DataGrid, including visible columns, sorting, and filtering.
97
95
98
96
This approach provides flexibility to integrate printing into custom workflows or toolbar actions beyond the built-in options.
99
97
100
-
#### Example: Programmatic Printing with External Button
101
-
102
98
{% tabs %}
103
99
{% highlight razor tabtitle="Index.razor" %}
104
100
@using Syncfusion.Blazor.Grids
@@ -172,17 +168,15 @@ internal sealed class OrderData
The Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid prints all pages in the dataset by default. To print only the currently visible page, set the [PrintMode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.PrintMode.html) property to `CurrentPage`.This configuration applies when printing is triggered using the built-in toolbar or programmatically through the [PrintAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_PrintAsync) method.
173
+
The Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid prints all pages in the dataset by default. To print only the currently visible page, set the [PrintMode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.PrintMode.html) property to **CurrentPage**.This configuration applies when printing is triggered using the built-in toolbar or programmatically through the [PrintAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_PrintAsync) method.
178
174
179
-
#### Available Print Modes
175
+
**Available print modes**
180
176
181
177
-**PrintMode.AllPages**: Prints the entire dataset across all pages. This is the default behavior.
182
178
-**PrintMode.CurrentPage**: Prints only the data displayed on the current page.
183
179
184
-
#### Example: Printing the Current Page
185
-
186
180
{% tabs %}
187
181
{% highlight razor tabtitle="Index.razor" %}
188
182
@using Syncfusion.Blazor.Grids
@@ -360,13 +354,13 @@ This is demonstrated in the below sample code,
360
354
The following image represents Hierarchial Grid with print toolbar item,
When printing a Syncfusion<supstyle="font-size:70%">®</sup> Blazor DataGrid that contains a large number of columns, the default page size used by the browser (such as A4) may not have enough space to display all columns. As a result, some columns may be hidden in the print preview or printed output.
366
360
To include more columns in the printable area:
367
361
368
-
- Switch to `landscape orientation` in the browser’s print dialog.
369
-
- Adjust the `scale setting` to reduce content size, fitting more columns on the page.
362
+
- Switch to **landscape orientation** in the browser’s print dialog.
363
+
- Adjust the **scale setting** to reduce content size, fitting more columns on the page.
370
364
371
365
These adjustments ensure visibility of all columns for wide grids.
372
366
@@ -438,11 +432,11 @@ In the below example, we have **CustomerID** as a hidden column in the datagrid.
438
432
}
439
433
``` -->
440
434
441
-
## Limitations of Printing Large Data
435
+
## Limitations of printing large data
442
436
443
437
Printing a large volume of data in a single page may cause performance issues in the browser. Rendering many rows and columns at once can slow down the page or make it unresponsive.
444
438
445
-
The DataGrid uses `virtualization` to improve performance during on-screen rendering. However, virtualization for rows and columns is `not feasible` during printing. All data is rendered at once, which increases the load on the browser.
439
+
The DataGrid uses `virtualization` to improve performance during on-screen rendering. However, virtualization for rows and columns is not feasible during printing. All data is rendered at once, which increases the load on the browser.
446
440
447
441
To avoid performance issues when printing large datasets, consider exporting the data to a supported format:
0 commit comments