You just need to pass the query and the method will return you the binary excel data that can we used in the download widget. Also, the user can specify how many records he wants to write in one sheet.
I tried it with 100K records and with each row having 24 columns and it works fine.