326
Views
11
Comments
Solved
[Ultimate PDF] Screen to PDF
Question

I want to download the page in PDF format, the button group of the current page will filter the data in the list, and the requirement is to click different buttons to download the pdf containing the corresponding data list. My idea is to modify the URL of the current page when clicking different buttons, and then use the URL under each button to download the PDF. But each download is the same page, I hope you can help, or share your thoughts, thank you

ToDo_v245.oml
2023-04-16 15-25-31
Krishnanand Pathak
Solution

Hi Lingchen,

I made some changes like in DownloadOnClick action.
Please check the updated oml attached.
Check the Demo here

Regards
Krishnanand Pathak

Updated_ToDo_v245.oml
2023-04-23 08-46-32
Lingchen Liu

First of all, thank you so much for your help,I modified according to the part you modified, but I made a mistake. Is it my problem?


2023-04-23 08-46-32
Lingchen Liu

There is no problem in downloading the file you modified,But I wonder what went wrong with mine.

2023-04-16 15-25-31
Krishnanand Pathak

OnReady action is missing in your.

Which will assign the domain local variable.

2023-04-16 15-25-31
Krishnanand Pathak

Also change the Url to local variable from input parameter

2023-04-23 08-46-32
Lingchen Liu


It has been solved, thank you very much, good life is safe, but there is a problem with the downloaded PDF layout, I will try to solve it first, wish you a happy life

2023-04-16 15-25-31
Krishnanand Pathak

As you said your issue is solved then Mark the answer as solution. It would be helpful for others also

2023-04-23 08-46-32
Lingchen Liu


Hello, I would like to ask where the problem occurred in my previous practice, the URL was not updated, didn't I get the updated address when downloading? Did you add the On Ready event so that the page would execute Render every time I clicked the button? Will it still be Ready? I'm a little confused about this part. I don't really understand it

2023-04-16 15-25-31
Krishnanand Pathak


Hi,

Format of URL expected was different by PrintToPDF.
OnReady is only to assign the domain variable using GetRequestDomain. Yes, we can also do this at OnInitialize as it an initialization.

If you want more details regarding screen events like OnInitialize, OnReady . Then check the below official documentation.
https://success.outsystems.com/documentation/11/developing_an_application/implement_application_logic/screen_and_block_lifecycle_events/

Regards
Krishnanand Pathak

2023-04-23 08-46-32
Lingchen Liu


Thank you,Krishnanand Pathak , I understand. I have learned about the life cycle of OnReady through debug, but I was not familiar with many places at the beginning. Thank you very much for taking time to answer my questions.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.