Please add a feature to export the grid to a PDF file.
---
ADMIN EDIT
We have made two examples you can use for the time being to get a PDF document from the grid:
---
Hello Gert,
We have this tentatively planned for late 2024, but this is preliminary unofficial information.
The only official source of truth is the item status, which is currently Unplanned. When we schedule the task, the status will change and all followers will receive a notification.
Regards,
Dimo
Progress Telerik
Hi,
when will this request be implemented?
Hello Michael,
Indeed, we do realize that this is one of the most popular feature requests and the product management will consider it in the imminent 2024 planning, which will happen in the following weeks.
At this point, I can't confirm anything officially, but as soon as we have a more defined plans, we will update our Telerik Blazor roadmap page and this item's status.
For the time being, the suggested alternative is to generate (export) the PDF document directly from the Grid data with our PDF processing tool.
Regards,
Dimo
Progress Telerik
The Kendo Library approach is really more of a print the current DOM to pdf. This is completely useless if your grid has more than one page. I tried loading up the grid into a Kendo UI grid to try to get the additional pages but the rendered Blazor grid wasn't recognized as a Kendo UI grid apparently.
Marin, you had said that with .Net 5 they hoped to include exporting to PDF natively. Now that the latest release is .Net 7 and we still don't seem to have a built in way to export to PDF should we just give up on that happening? Looking at the road map I don't see anything about exporting for the grid.
The sample for the server version is working for us somewhat but we are missing some major things in the PDF document side. The grid we are exporting needs to have a repeating header on each page. To solve for that we were initially assuming a certain number of rows per page and inserting a header row when we counted up to that many rows. The problem comes from when the cells need to grow vertically and that count isn't static.
Do you have a solution for how to add a header to each of the grid pages at the top that doesn't involve a static number of rows per page?
Hi Ros,
That sample uses the Kendo Drawing API functionality to generate a PDF in the browser with JS based on the DOM.
Thus, it cannot have a server-side part directly. What you could consider, is either generating the headers with JS (see below), or sending the PDF from the browser to the server (instead of saving it for the end user) so the endpoint in the server can edit and handle the PDF it got according to your needs.
If you want to make a more complex PDF (such as add headers, footers, alter page size and so on), I recommend you review the documentation and examples of that product. Here is a few of them to get you started:
Note that there is some integration between the Kendo jQuery Grid and the Kendo Drawing API that is not available for the Blazor Grid component.
If you are having difficulties with the Kendo Drawing API after reviewing its API, functionality and resources, I recommend you open a new forum thread or support ticket with your questions for the particular situation/question, as this thread here is related to a built-in export of the Blazor Grid, that will likely not come through a jQuery library. Also, it will not combine external page elements either, it will handle exporting only the current grid data, so such a highly custom solution you are looking for will either be something you will have to code, or consider using actual reporting solutions to generate your complex reports based on data and report definitions, rather than trying to hack UI elements.
Regards,
Marin Bratanov
Progress Telerik
Hi Ros,
The sample you mentioned uses javascript and exports only the rendered DOM elements. This is why the pageable Grid in this example converts only the current page with rows.
Yet, you can achieve the desired result by using a custom PDF export. The other sample from my colleague's answer shows the needed result - Export Grid to PDF on the Server. This example shows how to build a custom PDF export on the server. You can test it to see if it covers your app requirements in the meantime.
Regards,
Hristian Stefanov
Progress Telerik
Hi Folks,
In https://github.com/telerik/blazor-ui/tree/master/common/pdf-jpg-export-js
any ideas how to make pdf document pageable ? By default in just add everything to one page. Just want to make it if content is over one page start to add it to next page. Also is it possible to add headers to each page in case if it is possible to make it pageable.
Thnks,
Ros
Hello all,
We have made a new example that shows how you can generate a PDF on the server based on the grid data source request which will also let you customize the file as needed. You can find sample projects for this here: https://github.com/telerik/blazor-ui/tree/master/grid/pdf-export-server.
Regards,
Marin Bratanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi all,
You can find an example of using Kendo JS libraries to generate a PDF (and a JPG) out of the current DOM (for example, the current page of grid data) in this sample project: https://github.com/telerik/blazor-ui/tree/master/common/pdf-jpg-export-js.
You can use that in for the time being in projects that need this urgently, or you could generate larger PDF files (e.g., with all the data) through the Telerik Document Processing libraries (see here, here and here for starting points). If you need to do that with data according to the current grid filter, for example, you can cache the grid DataSource request (example) and re-run it on your backend (examples) without paging to get those filtered results.
A built-in PDF export from the grid the was put off because of performance reasons with WebAssembly scenarios. We are expecting improvements from .NET 5 to help with that, and we are also going to work on that internally (in our own product), and such a feature will eventually be implemented, so you can keep following this item for status updates. This page will be updated with a release number when we know when it will be available.
In place of this feature, we created grand total footers too.
Regards,
Marin Bratanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.