added code to export data on the exportdata button click