Hi Stefan,
Thanks for contacting Syncfusion support.
We have validated the reported issue at our end and we are not able to reproduce the reported issue in our online demo sample. Print page gets rendered properly without any error. But in some devices (IPad, IPhone,MAC) we face the popup blocker issue by browser while printing. Once we enable the popups, Print window is displayed in it. So kindly ensure the reported issue by enabling the browser popup. (safari) or PopUp blocker (Chrome)
After ensuring the above solution, if you are still facing the issue. Kindly get back to us with following details.
- Share the mac device details along with OS version.
- Share the screenshot of the issue you are facing.
- Are your facing empty Grid (without records) on print preview window?
- Share your Syncfusion Nuget package version.
Above requested details will be helpful for us to validate the reported issue at our end and provide solution as soon as possible.
Query: “it's says that there is WordExport. No such thing when you try it. But there is CSV, witch is not mentioned.”
Sorry for the inconvenience caused. We have logged an improvement task to update our UG documentation and it will be refreshed as soon as possible.
Query: “it is said that the id for the default exports are as such: args.Item.Id == "Grid_pdfexport" But there are not. You can bypass this as this:”
Yes. Exporting in DataGrid is carried out by calling the respective Export methods(ExcelExport(), PdfExport(), CSVExport()). These methods can be triggered from different source like External Button, Default ToolarItem, CustomToolbar Item.
In the demo sample, we have defined the DataGrid with Static ID property and used built Toolbar items (render with export icons). Hence we have used “Grid(Grid ID)” + “_pdfexport” to differentiate the toolbar items and export the Grid data to respective formats. It can be modified as per the toolbar item clicked handler.
Query: “If you put the default “ExcelExport”, “CsvExport”, “PdfExport” in the toolbar, without other configuration with Adaptors.ODataV4Adaptor they don’t trigger, and you have to implement them with args.Item.Id”
Yes, Default toolbar Items (ExcelExport, CsvExport, PdfExport) are used to render the toolbar items with their corresponding export icons. Even though we have defined the built in exporting toolbar buttons, it is necessary to handle the actions in OnToolbarClick event of Grid.
Refer the below code example.
|
@{
var Tool = (new List<string>() { "ExcelExport", "CsvExport","PdfExport", "Print" });
}
<SfGrid ID="Grid" @ref="DefaultGrid" TValue="Order" Toolbar="@Tool" AllowPdfExport="true" AllowExcelExport="true" AllowPaging="true">
<GridEvents TValue="Order" OnToolbarClick="ToolbarClickHandler"></GridEvents>
. . . . . . .
</SfGrid>
@code{
SfGrid<Order> DefaultGrid { get; set; }
public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args)
{
if (args.Item.Id == "Grid_excelexport") // GridID + "_excelexport" to identify excelexport toolbar click
{
await DefaultGrid.ExcelExport();
}
if (args.Item.Id == "Grid_pdfexport") // GridID + "_pdfexport" to identify pdfexport toolbar click
{
await DefaultGrid.PdfExport();
}
if (args.Item.Id == "Grid_csvexport") // GridID + "_csvexport" to identify csvexport toolbar click
{
await DefaultGrid.CsvExport();
}
}
|
For your convenience we have prepared a sample with ODataV4Adaptor and Exporting with default toolbar items.
Kindly get back to us if you have further queries.
Regards,
Vignesh Natarajan