@shyamasundar-ks
as I thought you have a security related issue.
See Designer Scripting Reference (adobe.com) and look for exportData
There it says
For security reasons, if you provide the first parameter, the exportData method executes only
when performed on certified documents. If you do not provide the first parameter, the document
does not need to be certified and the user is prompted to provide a location and filename.
Only the user is prompted option will work OOTB. Certification can only be applied on the rendered PDF and you must have a valid certficate to certify. You can certify with Acrobat Pro (or AEM Forms server).
What is you use case here?