gsp is divided into two, the top part is like a search filter, and the bottom part is the regular list that is provided by Grails
I have a template _list.gsp in my list.gsp. And I wanna create a button to make that _list.gsp template a MS Excel file.
But I want only the template to be on the Excel file. Not the rest of the page
How can I do this in the simplest and direct way possible?? Thank you!
Try this quite dirty trick in your index method:
Explanation: the trick is that an HTML page renamed as *.xls can be read by office software suites. What you're doing is telling the browser to download a file with that name, instead of navigating to a regular HTML file. If you want to use this in a button, you should proceed as with any HTML generating page, and then add this header to the response.
responseis global to actions in Grails controllers.