Hi,

Here's the scenario, i have parent screen that has a filtering date. then i have a button "Download" ,

i want the result will be download to pdf . i used htmltopdf but i need to popup  the page first before click the button to convert the html to pdf.


any work around to make after filter the date then will automatically download the result as pdf?


Thanks.

Tams

Hi Tams,


You can create a (hidden) button and, after filtering by date, run JS at the end of the action to click in the button to trigger another screen action to download the PDF.

"$('#" + DownloadPdfButton.Id + "').click();"


Hi Gabriel,


One more question.  how can i hide the button once i clicked it? 

because after converting the html to pdf the button still remain on the pdf output. 


THanks,.

Tams



Gabriel Cardoso wrote:

Hi Tams,


You can create a (hidden) button and, after filtering by date, run JS at the end of the action to click in the button to trigger another screen action to download the PDF.

"$('#" + DownloadPdfButton.Id + "').click();"




Solution

You can use a css class with display:none and apply it to the button. 

.HiddenClass{
    display: none;
}

On the other end, if you want to click it with the cursor then make it disappear, you will need a control variable that will define if the click was made and have on the Extended Properties of the button something like:


class = if(IsClicked,"HiddenClass","Button")


And, on click, change IsClicked = True and do an Ajax Refresh to apply the "HiddenClass" to the button.


Gabriel

Solution