julien.mao Posted August 3, 2016 Share Posted August 3, 2016 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 More sharing options...
hozawa Posted August 3, 2016 Share Posted August 3, 2016 If the user just want excel sheet, do the user really need to login to JasperReports Server? If not, you can just use REST APIs to generate xlsx file.http://community.jaspersoft.com/documentation/tibco-jasperreports-server-rest-api-reference/v630/reports-service Link to comment Share on other sites More sharing options...
reportdev Posted August 9, 2016 Share Posted August 9, 2016 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now