dbr.button direct link to excel

(3 posts) (2 voices)

Tags:

  1. cdavison, Member

    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.

    select 'dbr.button', 'Get CSV Data';
    select 'dbr.report', 'sp_DBR_mylinkdereport_CSV', 'new_window';
    -- select 'dbr.report', 'sp_DBR_mylinkdereport_CSV', StartDate=StartDate, EndDate=EndDate, Site=Site, SelectMachines=SelectMachines;
    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.

  2. myDBR Team, Key Master

    Hi,
    you can use the 'append'-option in dbr.report-command to do that.

    select 'dbr.report', 'sp_DBR_mylinkdereport', 'append=&export=xlsx';

    --
    myDBR Team

  3. cdavison, Member

    Fantastic! That did the trick. Thanks!


Reply

You must log in to post.