Is there a way to have a button that will open another report and directly download it as Excel. I want to have two buttons on a report, one that opens a new report in a new window and creates a table, and another that when clicked downloads the report as a CSV.
I have the following code that generates a new window calling another report to get the data in HTML table form.
1.
select
'dbr.button'
,
'Get CSV Data'
;
2.
select
'dbr.report'
,
'sp_DBR_mylinkdereport_CSV'
,
'new_window'
;
3.
-- select 'dbr.report', 'sp_DBR_mylinkdereport_CSV', StartDate=StartDate, EndDate=EndDate, Site=Site, SelectMachines=SelectMachines;
4.
select
'dummy result set for the button'
;
I want to do the same as above but have it go straight to Excel. I know you can append &export=csv
to the end of a URL, but I was hoping there was a way to do this from within dbr.report in order to save some coding. I also know that once the HTML table loads, you can export it from within that report, but I was hoping to reduce execution time by going straight to CSV.