Skip to content

Commit 15ebeeb

Browse files
984421: Updated the UG content and samples for Print in DataGrid
1 parent ed713ec commit 15ebeeb

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

blazor/datagrid/print.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ documentation: ug
1313

1414
The **Print** feature in the Syncfusion<sup style="font-size:70%">&reg;</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.
1515

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.
1917

2018
{% tabs %}
2119
{% highlight razor tabtitle="Index.razor" %}
@@ -84,21 +82,19 @@ internal sealed class OrderData
8482

8583
## Page Setup for Printing
8684

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:
8886

8987
* [Chrome](https://support.google.com/chrome/answer/1069693?hl=en)
9088
* [Firefox](https://support.mozilla.org/en-US/kb/how-print-web-pages-firefox)
9189
* [Safari](https://www.mintprintables.com/print-tips/adjust-margins-osx/)
9290
* [Internet Explorer](https://www.helpteaching.com/blog/) (legacy)
9391

94-
## Printing with an External Button
92+
## Print via programmatically
9593

9694
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.
9795

9896
This approach provides flexibility to integrate printing into custom workflows or toolbar actions beyond the built-in options.
9997

100-
#### Example: Programmatic Printing with External Button
101-
10298
{% tabs %}
10399
{% highlight razor tabtitle="Index.razor" %}
104100
@using Syncfusion.Blazor.Grids
@@ -172,17 +168,15 @@ internal sealed class OrderData
172168

173169
{% previewsample "https://blazorplayground.syncfusion.com/embed/BZVyCZsJTDndUnwJ?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %}
174170

175-
## Print Only the Visible Page
171+
## Print only the visible page
176172

177-
The Syncfusion<sup style="font-size:70%">&reg;</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<sup style="font-size:70%">&reg;</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.
178174

179-
#### Available Print Modes
175+
**Available print modes**
180176

181177
- **PrintMode.AllPages**: Prints the entire dataset across all pages. This is the default behavior.
182178
- **PrintMode.CurrentPage**: Prints only the data displayed on the current page.
183179

184-
#### Example: Printing the Current Page
185-
186180
{% tabs %}
187181
{% highlight razor tabtitle="Index.razor" %}
188182
@using Syncfusion.Blazor.Grids
@@ -360,13 +354,13 @@ This is demonstrated in the below sample code,
360354
The following image represents Hierarchial Grid with print toolbar item,
361355
![Print Hierarchial Grid Content](./images/grid-hierarchial-print.png) -->
362356

363-
## Printing a Large Number of Columns
357+
## Printing large number of Columns
364358

365359
When printing a Syncfusion<sup style="font-size:70%">&reg;</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.
366360
To include more columns in the printable area:
367361

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.
370364

371365
These adjustments ensure visibility of all columns for wide grids.
372366

@@ -438,11 +432,11 @@ In the below example, we have **CustomerID** as a hidden column in the datagrid.
438432
}
439433
``` -->
440434

441-
## Limitations of Printing Large Data
435+
## Limitations of printing large data
442436

443437
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.
444438

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.
446440

447441
To avoid performance issues when printing large datasets, consider exporting the data to a supported format:
448442

0 commit comments

Comments
 (0)