Hello,
I'm having a hard time creating a download button.
I have a scheduled report every day.
I would like to create a button in the dashbard that downloads that report.
I cannot use js.
Can you help me?
I found a way to download the query created but so I also view the table and I don't want to show it, just download the result.
Tks
Bye
Antonio
Below is the code for the button.
I solved
I ask the most skilled if this solution can fit
bye
Antonio
<search>
<query>| loadjob savedsearch="antonio:enterprise:Report"
</query>
<done>
<eval token="date">strftime(now(), "%d-%m-%Y")</eval>
<set token="file_name">Report</set>
<set token="sid">$job.sid$</set>
</done>
</search>
<html>
<BR/>
<div style="float: left">
<a href="/api/search/jobs/$sid$/results?isDownload=true&timeFormat=%25FT%25T.%25Q%25%3Az&maxLines=0&count=0&filename=$file_name$_$date$.csv&outputMode=csv" class="button js-button">Download Data</a>
</div>
<style>
Hi @antonio147,
I'm not an expert of HTML but I think that it isn't possible without using a JS.
As a workaround, you could use the standard "Export" button present in every panel.
Ciao.
Giuseppe
Hi Giuseppe,
I managed to create a download button for a table that I showed above without using js.
so :
<row>
<panel>
<table>
<search>
<done>
<eval token="date">strftime(now(), "%d-%m-%Y")</eval>
<set token="file_name">Tabella_Completa</set>
<set token="sid">$job.sid$</set>
</done>
<query>| loadjob savedsearch="antoino:enterprise:AGGREGATO_DATE"
|rename 00_MESE_PRECEDENTE as "MESE_ATTUALE"
</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="count">20</option>
<option name="dataOverlayMode">none</option>
<option name="drilldown">none</option>
<option name="percentagesRow">false</option>
<option name="rowNumbers">false</option>
<option name="totalsRow">false</option>
<option name="wrap">true</option>
</table>
<html>
<a href="/api/search/jobs/$sid$/results?isDownload=true&timeFormat=%25FT%25T.%25Q%25%3Az&maxLines=0&count=0&filename=$file_name$_$date$.csv&outputMode=csv" class="button js-button">Estrai Pratiche</a>
<style>
.button {
background-color: steelblue;
border-radius: 5px;
color: white;
padding: .5em;
text-decoration: none;
}
.button:focus,
.button:hover {
background-color: #2A4E6C;
color: White;
}
</style>
</html>
</panel>
</row>
Now my need is to give the possibility to download a report that is in crontab on the Report panel.
I tried to insert it in a table and this is how it works but I can't put the table "hidden".
Also tried with the condition but it doesn't work.
Thanks for your answer
Antonio
Below is the code for the button.
I solved
I ask the most skilled if this solution can fit
bye
Antonio
<search>
<query>| loadjob savedsearch="antonio:enterprise:Report"
</query>
<done>
<eval token="date">strftime(now(), "%d-%m-%Y")</eval>
<set token="file_name">Report</set>
<set token="sid">$job.sid$</set>
</done>
</search>
<html>
<BR/>
<div style="float: left">
<a href="/api/search/jobs/$sid$/results?isDownload=true&timeFormat=%25FT%25T.%25Q%25%3Az&maxLines=0&count=0&filename=$file_name$_$date$.csv&outputMode=csv" class="button js-button">Download Data</a>
</div>
<style>