Hello Team Helical,
I would like to know the implementation of custom excel export functionality in efw reports. I am using Helical Insight version 3.1
Thank You
Kevin.
Hello Team Helical,
I would like to know the implementation of custom excel export functionality in efw reports. I am using Helical Insight version 3.1
Thank You
Kevin.
Hello Kevin,
This plugin is implemented using the custom java functionality available in Helical Insight. We will explain the usage of this plugin with a samle report , in the similar way it can be used for any efw report
Steps to deploy :
Download the zip file Excel_Export_Plugin.zip (7.4 MB)
1.Copy the hwf folder in the βhi-repositoryβ
2.Copy library files into the path βhi\apache-tomcat-7\webapps\hi-ee\WEB-INF\libβ
3.Copy jsp file into the path βhi\apache-tomcat-7\webapps\hi-ee\WEB-INF\jspβ
4.Open βhwf-controllerβ folder and copy βhwfβ folder in the below path
β¦\hi\apache-tomcat-7\webapps\hi-ee\WEB-INF\classes\com
5.Open βapplication-context.xmlβ in the below server location :β¦\hi\apache-tomcat-7\webapps\hi-ee\WEB-INF\classes
Add the below bean :
<bean class="com.helical.efw.cache.ExportCache" id="exportCache">
<property name="cacheService" ref="cacheServiceImpl"/>
</bean>
6.Restart the Helical Insight server
Steps to use excel export functionality for ewf report :
1.Open the hi-repository in the server installation path :
β¦/opt/Helical Insight 3.1/hi/hi-repository
2.Open the βSample_Piechartβ report files path , it contains below files
pie_chart.html
pie_chart.efwd
pie_chart.efwvf
pie_chart.efw
3.Open the pie_chart.html file in edit mode
4.Add the code for excel button :
<div id="EXCEL" align='right' class="hi_export" style="padding-right: 100px; ><a href="#"><button>EXCEL</button></a></div>
5.In js script add the below code :
$("#EXCEL").on('click', function() {
<!-- var limit = -->
//var limit = parseInt(dashboard.getVariable('visitDateParam').length) * 2000 ;
var numberOfRecordsToExport =2000;
<!-- var numberOfRecordsToExport =" "; -->
Dashboard.setVariable('numberOfRecordsToExport',numberOfRecordsToExport);
var dataToSend = [
{
reportName: 'genderPieChart',
numberOfRecordsToExport: Dashboard.getVariable('numberOfRecordsToExport'),
dir: window.DashboardGlobals.folderpath,
map_id: 1
}
];
var url=window.DashboardGlobals.baseUrl + 'workflow.html?dir=hwf&fileName=ExportToExcel_v1.hwf' ;
openHWF = function(verb, url, data, target) {
var form = document.createElement("form");
form.action = url;
form.method = verb;
form.target = target || "_self";
if (data) {
for (var key in data) {
var input = document.createElement("textarea");
input.name = key;
input.value = typeof data[key] === "object" ? JSON.stringify(data[key]) : data[key];
form.appendChild(input);
}
}
form.style.display = 'none';
var excelFileName=DashboardGlobals.fileTitle;
var reportName = document.createElement("input"); //input element, text
reportName.setAttribute('type',"text");
reportName.setAttribute('name',"reportName");
reportName.setAttribute('value',excelFileName+"_");
form.appendChild(reportName);
document.body.appendChild(form);
$.notify({message: "Maximum 2000 records can be exported", icon: "fa fa-exclamation-triangle"}, {type: "info"});
form.submit();
};
openHWF('POST',encodeURI(url), {query: JSON.stringify(dataToSend), dataCountPerSheet: '2000'} ,'_self' );
Dashboard.setVariable('numberOfRecordsToExport','');
});
Test Case :
If we open report in open mode , the excel button will be displayed.
If we click on βEXCELβ button , the data of the chart will be downloaded in excel.
Note : The excel file name will be βEfw report nameβ
Thank You
Team Helical