Download excel file is not working after doing a second click
As part of a requirement, I have to create an excel file and download it using a link or a button that part I have already completed it by creating an activity which retrieves the needed data with a report definition and then I use the OOB activity MSOGenerateExcelFile to create and download the file, then in the section with a link I am calling the activity I have created on a onClick event and a refresh this section action at this point everything is working fine but when I click the link again the file is not being download as it should be even though the activity is executed as I could identify in the tracer.
I tried using run script but with no success, the script looks like this:
var URL = new SafeURL("myClass.GenerateExcelFile");
url = URL.toURL();
Finally, this js file is added to my harness and that function is called in the run script event of the link.
Do you know, guys, what I am doing wrong? or do I miss something important in my code that is not allowing me to download the file.
Thanks in advance.
***Edited by Moderator: Pallavi to update platform capability tags***