Jump to content
We've recently updated our Privacy Statement, available here ×

automatic export excel


julien.mao

Recommended Posts

Hello,

I created a report using jaspersoft studio; after i execute the report on jaspersoft server I can export it to excel using the buttons but is it possible to automatically export it to excel when I execute the report ? I don't want to click on the button export to excel everytime the report is generated.

Best regards,

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

You could just create a simple html page and pass the parameters to the server using REST API. I have used javascript in the below html page. 

<html>

<style>
label{
display:inline-block;
width:200px;
margin-right:30px;
text-align:right;
}
 
input{
 
}
 
fieldset{
border:none;
width:800px;
margin:0px auto;
}
</style>
 
<form name="data_entry" action="#">
 
<fieldset>
<p>
<label for="export">Export Options:</label>
 
<select id="exportoptions" name="export" size="1">
        <option value=".html">HTML</option>
        <option value=".pdf">PDF</option>
        <option value=".xls">XLS</option>
    </select>
 
</p>
 
<p>
<label for="Reportunit">Reporting Unit Number: </label>
<input type="text" id="runumber" name="runumber" size = "20">
 <a id="ru" href="" size = "5">Download Report for RU</a>
</p>
 
 
<p>
<label for="fiscal_year">Fiscal Year: </label>
<input type="text" id="fiscalyear" name="fiscalyear" size = "20">
 <a id="fy" href="" size = "5">Download Report for FY</a>
</p>
 
<p>
<label for="resetform">Reset Form: </label>
<input type="button" name="reset_form" value="Reset Form" onclick="this.form.reset();" size = "20">
</p>
 
</form>
 
<script type="text/javascript">//<![CDATA[
var sel = document.getElementById('runumber');
var sel2 = document.getElementById('fiscalyear');
var sel3 = document.getElementById('exportoptions');
 
sel.onchange = function () {
    document.getElementById("ru").href = 
"https://localhost:8081/jasperserver/rest_v2/reports/reports/JasperUsers/reporting_units" + sel3.value + "?RUNO=" + this.value;
};
 
sel2.onchange = function () {
    document.getElementById("fy").href = 
"https://localhost:8081/jasperserver/rest_v2/reports/reports/JasperUsers/reporting_units" + sel3.value + "?FY=" + this.value;
};
 
 
</script>
 
 
</html>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...