You can create a custom REST web service, use Muhammed's approach to fetch the data, and then output the raw CSV as the response.
One complication here is that %DisplayFormatted only outputs to files. You could consider outputting to the file, then read that file and output it in your response, but in a web service it would be best to output to the response directly.
In that case, you might just iterate through the result set using %Next() and either use %Print(",") to output each row or build your own row by using %Get for each column to output and adding commas between columns.
If you already have a Zen report, you can change it to output as an Excel spreadsheet. This will work if the report is called from a web browser just as it does for PDFs.
If you don't have an existing Zen report, then I don't recommend creating a new Zen report. Use one of the approaches others are suggesting.
Log in or create a new account to continue