On a Design Studio, I have a button that calls PDF.exportApplicationScreen() to print the report on click event. The report has drop down selections, and other navigation buttons I would like to hide from print out; so prior to calling the PDF method, I'm changing the setVisible attribute to false for all the layout items I want to hide. Right after the method call to the PDF.exportApplicationScreen(), I reset the visible to true.
The problem is that by the time screen scraping starts, all the buttons are visible again, so all the layout items I hid appear in the PDF file (I tested the code without reset to visible to true and the report output works I would expected).
To get around this issue, I want to implement a sleep like function in the background process (loop until 2 seconds have elapsed). To do that, I need to get the current time, and then loop around until 2 seconds have elapsed but it doesn't appear to be an API to get the system time. Is there a workaround for this?
Thanks,
Wes