I used the below blog
to code the download to excel functionality. Download functionality is working fine but I got the exception as below everytime.
Error in getCachedWebResoucre method: you must flush before accessing the resource content.
I searched in SDN for this error and found the thread
which gave me a resolution to get rid of the deprecated method. However on using this I am unable to download the excel file and everytime on trying to open the file I get this error below
"The file you are trying to open, "abc.xls", is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?
And when I open the file, I am not seeing any data. Any idea on how to get rid of this?