<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to create a button for dashboard that exports CSV of specific panel in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-button-for-dashboard-that-exports-CSV-of/m-p/485123#M31822</link>
    <description>&lt;P&gt;I tried to inspect the javascript export button provided by Splunk and found the code that creates the ExportResultDialog in path /opt/splunk/share/splunk/search_mrsparkle/exposed/js/views/dashboard/element/Footer.js&lt;/P&gt;

&lt;P&gt;this object is responsible for showing the export Modal and initializing the object.&lt;/P&gt;

&lt;P&gt;I created this javascript code but it seems it has a lot of dependencies and js errors&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
     'splunkjs/mvc',
     'views/shared/jobstatus/buttons/ExportResultsDialog'

 ], function(mvc , ExportResultsDialog) {



    var btn = $('.toto')
    _export = function () {
      console.log(this)

         /* var sid = this.manager.getSid();
          console.log(sid)
          */
          //this.searchJobModel.set("id", sid);
        var exportDialog = new ExportResultsDialog({
            model: {
                //searchJob: this.searchJobModel,
                //application: this.model.application,
                //report: this.model.report
            },
            usePanelType: true,
            onHiddenRemove: true
        });

        exportDialog.render().appendTo($("body"));
        exportDialog.show();

     }

     btn.click( function () {_export()})



 });
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 24 Sep 2019 13:14:46 GMT</pubDate>
    <dc:creator>anasbk</dc:creator>
    <dc:date>2019-09-24T13:14:46Z</dc:date>
    <item>
      <title>How to create a button for dashboard that exports CSV of specific panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-button-for-dashboard-that-exports-CSV-of/m-p/485122#M31821</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I want to create a button that exports the result of a specific panel in csv format.&lt;BR /&gt;
I created the button using the  tag as the image shown below.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://www10.0zz0.com/2019/09/23/18/432585032.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;I tried to inspect the javascript code of export button provided by Splunk but it seems complicated &lt;BR /&gt;
I'm sure there is a better way to do that.&lt;/P&gt;

&lt;P&gt;Thanks in advance !&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 15:41:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-button-for-dashboard-that-exports-CSV-of/m-p/485122#M31821</guid>
      <dc:creator>anasbk</dc:creator>
      <dc:date>2019-09-23T15:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a button for dashboard that exports CSV of specific panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-button-for-dashboard-that-exports-CSV-of/m-p/485123#M31822</link>
      <description>&lt;P&gt;I tried to inspect the javascript export button provided by Splunk and found the code that creates the ExportResultDialog in path /opt/splunk/share/splunk/search_mrsparkle/exposed/js/views/dashboard/element/Footer.js&lt;/P&gt;

&lt;P&gt;this object is responsible for showing the export Modal and initializing the object.&lt;/P&gt;

&lt;P&gt;I created this javascript code but it seems it has a lot of dependencies and js errors&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
     'splunkjs/mvc',
     'views/shared/jobstatus/buttons/ExportResultsDialog'

 ], function(mvc , ExportResultsDialog) {



    var btn = $('.toto')
    _export = function () {
      console.log(this)

         /* var sid = this.manager.getSid();
          console.log(sid)
          */
          //this.searchJobModel.set("id", sid);
        var exportDialog = new ExportResultsDialog({
            model: {
                //searchJob: this.searchJobModel,
                //application: this.model.application,
                //report: this.model.report
            },
            usePanelType: true,
            onHiddenRemove: true
        });

        exportDialog.render().appendTo($("body"));
        exportDialog.show();

     }

     btn.click( function () {_export()})



 });
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Sep 2019 13:14:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-button-for-dashboard-that-exports-CSV-of/m-p/485123#M31822</guid>
      <dc:creator>anasbk</dc:creator>
      <dc:date>2019-09-24T13:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a button for dashboard that exports CSV of specific panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-button-for-dashboard-that-exports-CSV-of/m-p/485124#M31823</link>
      <description>&lt;P&gt;You can also just click the little download icon in the popup as you mouse over the panel. It is shown in your screen shot. Next to the search magnifier icon. Bottom right.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 17:39:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-button-for-dashboard-that-exports-CSV-of/m-p/485124#M31823</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2019-09-24T17:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a button for dashboard that exports CSV of specific panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-button-for-dashboard-that-exports-CSV-of/m-p/485125#M31824</link>
      <description>&lt;P&gt;I wanted to customize the button, found solution here:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/755018/export-to-csv-on-click-of-button.html"&gt;https://answers.splunk.com/answers/755018/export-to-csv-on-click-of-button.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 11:09:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-button-for-dashboard-that-exports-CSV-of/m-p/485125#M31824</guid>
      <dc:creator>anasbk</dc:creator>
      <dc:date>2019-10-10T11:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a button for dashboard that exports CSV of specific panel</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-button-for-dashboard-that-exports-CSV-of/m-p/485126#M31825</link>
      <description>&lt;P&gt;i wanted to make a custom search, not the button provided by Splunk&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 11:10:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-button-for-dashboard-that-exports-CSV-of/m-p/485126#M31825</guid>
      <dc:creator>anasbk</dc:creator>
      <dc:date>2019-10-10T11:10:28Z</dc:date>
    </item>
  </channel>
</rss>

