What version is your client?
Another approach you can try is opening your xagent with a window.open () in the onComplete event of your button. I don't remember off the top of my head if that works in xpinc. The advantage of this is your export will open in a new tab.