Grid SaveAsPdf with auto paper size

1 Answer 22 Views
Grid
Krzysztof
Top achievements
Rank 1
Krzysztof asked on 28 Jan 2025, 01:19 PM | edited on 28 Jan 2025, 01:19 PM

Hi
I would like to use SaveAsPdf export in my application. I need to place the export button somewhere other than on the tollbar.
Is there a way to make such export in the background without auto clicking through each page in the gui, like in the case of using toolbar: ["pdf"]?

It must have the ability to export all pages and auto paper size.

Example:

https://dojo.telerik.com/PUvxeVje

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 31 Jan 2025, 09:32 AM

Hello, Krzysztof,

From what I can see in the provided example, you have achieved the requirement as I understand it - you are using a custom button to export all of the Grid pages. Could you please let me know if I am missing something from the requirement?

Looking forward to your reply.

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Krzysztof
Top achievements
Rank 1
commented on 31 Jan 2025, 09:38 AM

Hello Martin

Thanks for your reply.

Yes, I use custom button because I have to place it under the grid. Additionally, the requirement is to export all pages and set paperSize to auto because the solution will be used in a grid that has a different number of columns in different scenarios and setting a specific page size causes it to look bad in PDF.

Regards

Martin
Telerik team
commented on 05 Feb 2025, 07:21 AM

Hello, Krzysztof,

Thank you for the additional information, but it still seems to be that you have managed to achieve the requirement by yourself in the Dojo example you provided. All of the Grid records are being exported, and the paperSize is set to auto. Could you please let me know what is the issue you are experiencing with in the example you provided?

Krzysztof
Top achievements
Rank 1
commented on 05 Feb 2025, 10:19 AM | edited

Hi

Yes, export works correctly, it export what I want. The problem is that on the gui the user sees that the pages change during this export (in this case it happens very quickly). There is no such thing when we use export to pdf from the toolbar (toolbar: ["pdf"]).

I hope I explained the problem.

Updated example:
https://dojo.telerik.com/buemsOwD

Martin
Telerik team
commented on 10 Feb 2025, 09:19 AM

Hello,

Thank you for the additional details. I have modified the example with some of the internal logic that is used for the default export button. Let me know how that works for you.

Krzysztof
Top achievements
Rank 1
commented on 10 Feb 2025, 10:51 AM

Hello.
It works as I needed.

Thank you very much.

Tags
Grid
Asked by
Krzysztof
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or