Hi,
With this forge component "Html2PdfConverter " it is possible to download a dynamic page? If so, would anyone have any examples?
I have the following scenario: I need to download a file with information from a detail screen.
I created the anonymous screen and followed the guidelines of this file:
https://success.outsystems.com/Documentation/How-to_Guides/Development/How_to_create_reports_using_HTML2PDF
But I don't know how to take the (inputid) of the details screen where I call the action "GeneratePDF" and then take it to the screen aggregate with the information to the download.
Regards,
Jessica.
Please remove the quotes after FirstParameterValue. The ID, coming from the aggregate is not a String, it's a reference.
Hi Jessica,
This is the problem:
FirstParameterValue:"EmployeeId"
Instead of "EmployeeId", you should replace it with: GetEmployeeById.List.current.Sample_Employee.id
The alternative I found was to use a site property and assign it the screen id. Then use this id in the preparation of the screen that will be converted to PDF.
It Works, but honestly, I don't know if this would be the best option.
My concern is the competition. If more than one user clicks at the same time...
Hi Jessica,Did you already try to create an input parameter on the screen that generates the pdf, and pass it when downloading?
Hi Eric,
Yes I already created the input id on the screen where I need to generate the PDF. In this case, I use the id to filter the aggregate and show the information (Name) in the expression. But my problem is how to get the id in Employee Detail and pass it to the GeneratePDF function. And finally configure it in EmployeePDF.
I´ am trying to set as Helder indicated, but I have problems yet.
MakeAbsoluteURL(GetEntryURL("EmployeePDF",FirstParameterName:"EmployeeId",FirstParameterValue: EmployeeId))
When you call the GeneratePDF action, you obviously have the ID of your record to pass on (because you are also setting it in Site property as per your example - But please don't do it like that :) ).
Instead, in your GeneratePDF, the URL you are passing should have the call to GetEntryURL, like:
MakeAbsoluteURL(GetEntryURL("EmployeePDF"))
Just change it to:
(Changing the appropriate names to your scenario)
I hope it helps.
Cheers.
Hi Hélder,
Thanks for the attention,
Into considerate the function "GetEntryURL", I´ am having problems to set the "FirstParameterValue"
Taking acount this cenarious could let me know what is the correct syntax do get the id on this function?
Considering this entity.
I made the following tests, but just have a correctly pdf dinamic information, when I test with the id hard code (In this case I inserted just to test the expression).
I´ looked for a exemple on outsystems´ documentation, but did found yet...
https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/HTTPRequestHandler_API#GetEntryURL
Syntax looks good. The screen "EmployeePDF" has an input parameter "EmployeeId"?
What's the problem you are having now?
Hi Helder,
yes, it has an input.
When you say the correct syntax: will be that?
GetEntryURL("EmployeePDF",FirstParameterName:"EmployeeId",FirstParameterValue:"EmployeeId")
When I use this syntax. the erro that occurs is:
Actually, I already test like that:
MakeAbsoluteURL(GetEntryURL("EmployeePDF",FirstParameterName:"EmployeeId",FirstParameterValue:"GetEmployeeById.List.current.Sample_Employee.id"))
And show the following error:
Perfect. Now it works.
Thanks a lot the help.
Cheers,
Jessica Marques.
Excellent Jessica!