This blog will let you know to export excel using apache poi hwf and customize the excel like adding more information like the filters used in the report, heading.

We should create an object in HTML file which contains the map-id from an efwd file, all the required input parameters for executing the query and more information such as filters used or the date of exporting the excel

var dataToSend = {		 	
           dir: window.DashboardGlobals.folderpath,   //directory of main folder
           map_id: 1,  							   //map id in efwd file
			FIlter_1: Dashboard.getVariable('weekValue'),
			Filter_2:  Dashboard.getVariable('monthValue'),
			Filter_3:Dashboard.getVariable('yearValue')		
//all the required parameters for executing query			
        };

openHWF('POST',encodeURI(url), {query: JSON.stringify(dataToSend), dataCountPerSheet: '100'} ,'_self' );

Where URL is the path of the hwf file from the main folder, dataToSend is the map created above to pass the data to the hwf file and the parameters for query execution, dataCountPerSheet is to specify the number of records per sheet and the function is called with all the required data as arguments.

In HWF file we can get all the data like the output of the query executed, all the extra information we sent through the object created earlier through post request like

JSONObject queryData = req.dataToQuery;
JSONArray data =  queryResult.data;

Start by creating an excel workbook and create a sheet in that workbook as follows

HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet worksheet = wb.createSheet("Sheet");

We can create as many sheets we require based on the number of records per sheet and should create every row we needed, every cell in that row. Set a cell value, apply styles and we can even merge cells. Should iterate through all the values in object and display as follows

HSSFRow paramrowH = worksheet.createRow( row number );
HSSFCell cellTitle = paramrowH.createCell( cell number );
cellTitle.setCellValue(" excel title ");
cellTitle.setCellStyle(cellTitlStyle);
worksheet.addMergedRegion(new CellRangeAddress( row start, row end, col start, col end));

Apache POI

In the above code, we have used cellStyle ‘cellTitlStyle’, we can create different cell styles, up to 4000. In each cell style, we can have different font styles which we can customize its color, family, size, italic or bold etc…. The created font can be used while creating cell style. While creating cell style we can customize its color, background color, borders, border colors, text alignment, vertical alignment and many more and for all these customizations there are predefined functions and colors which we should use.

HSSFFont titleFont = wb.createFont();
titleFont.setFontHeightInPoints((short) 16);
titleFont.setFontName("Arial");
titleFont.setColor(IndexedColors.BLACK.getIndex());
titleFont.setBold(true);
titleFont.setItalic(false);

HSSFCellStyle cellTitlStyle = wb.createCellStyle();
cellTitlStyle.setFillForegroundColor(IndexedColors.SKY_BLUE.getIndex());
cellTitlStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
cellTitlStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
cellTitlStyle.setVerticalAlignment(HSSFCellStyle.ALIGN_CENTER);
cellTitlStyle.setFont(titleFont);

Different styles for table heading and table data can be achieved by creating different styles and using them appropriately. We can create a separate function to create a heading so that we can call this function to create a heading in every sheet. We will keep a count of all the data rows so that we can create a new sheet and put the load into a new sheet. Should iterate through the data object from the request and create a row for every record and cell for every value in the record.

responseJson.put("reportName","EXCEL EXPORT");  // name of the excel exported

Output

For further queries please get back to us at support@helicalinsight.com

Helical Insight’s self-service capabilities is one to reckon with. It allows you to simply drag and drop columns, add filters, apply aggregate functions if required, and create reports and dashboards on the fly. For advanced users, the self-service component has ability to add javascript, HTML, HTML5, CSS, CSS3 and AJAX. These customizations allow you to create dynamic reports and dashboards. You can also add new charts inside the self-service component, add new kind of aggregate functions and customize it using our APIs.
Helical Insight’s self-service capabilities is one to reckon with. It allows you to simply drag and drop columns, add filters, apply aggregate functions if required, and create reports and dashboards on the fly. For advanced users, the self-service component has ability to add javascript, HTML, HTML5, CSS, CSS3 and AJAX. These customizations allow you to create dynamic reports and dashboards. You can also add new charts inside the self-service component, add new kind of aggregate functions and customize it using our APIs.
Helical Insight, via simple browser based interface of Canned Reporting module, also allows to create pixel perfect printer friendly document kind of reports also like Invoice, P&L Statement, Balance sheet etc.
Helical Insight, via simple browser based interface of Canned Reporting module, also allows to create pixel perfect printer friendly document kind of reports also like Invoice, P&L Statement, Balance sheet etc.
If you have a product, built on any platform like Dot Net or Java or PHP or Ruby, you can easily embed Helical Insight within it using iFrames or webservices, for quick value add through instant visualization of data.
If you have a product, built on any platform like Dot Net or Java or PHP or Ruby, you can easily embed Helical Insight within it using iFrames or webservices, for quick value add through instant visualization of data.
Being a 100% browser-based BI tool, you can connect with your database and analyse across any location and device. There is no need to download or install heavy memory-consuming developer tools – All you need is a Browser application! We are battle-tested on most of the commonly used browsers.
Being a 100% browser-based BI tool, you can connect with your database and analyse across any location and device. There is no need to download or install heavy memory-consuming developer tools – All you need is a Browser application! We are battle-tested on most of the commonly used browsers.
We have organization level security where the Superadmin can create, delete and modify roles. Dashboards and reports can be added to that organization. This ensures multitenancy.
We have organization level security where the Superadmin can create, delete and modify roles. Dashboards and reports can be added to that organization. This ensures multitenancy.
We have organization level security where the Superadmin can create, delete and modify roles. Dashboards and reports can be added to that organization. This ensures multitenancy.
We have organization level security where the Superadmin can create, delete and modify roles. Dashboards and reports can be added to that organization. This ensures multitenancy.
A first-of-its-kind Open-Source BI framework, Helical Insight is completely API-driven. This allows you to add functionalities, including but not limited to adding a new exporting type, new datasource type, core functionality expansion, new charting in adhoc etc., at any place whenever you wish, using your own in-house developers.
A first-of-its-kind Open-Source BI framework, Helical Insight is completely API-driven. This allows you to add functionalities, including but not limited to adding a new exporting type, new datasource type, core functionality expansion, new charting in adhoc etc., at any place whenever you wish, using your own in-house developers.
It handles huge volumes of data effectively. Caching, Pagination, Load-Balancing and In-Memory not only provides you with amazing experience, but also and does not burden the database server more than required. Further effective use of computing power gives best performance and complex calculations even on the big data even with smaller machines for your personal use. Filtering, Sorting, Cube Analysis, Inter Panel Communication on the dashboards all at lightning speed. Thereby, making best open-source Business Intelligence solution in the market.
It handles huge volumes of data effectively. Caching, Pagination, Load-Balancing and In-Memory not only provides you with amazing experience, but also and does not burden the database server more than required. Further effective use of computing power gives best performance and complex calculations even on the big data even with smaller machines for your personal use. Filtering, Sorting, Cube Analysis, Inter Panel Communication on the dashboards all at lightning speed. Thereby, making best open-source Business Intelligence solution in the market.
With advance NLP algorithm, business users simply ask questions like, “show me sales of last quarter”, “average monthly sales of my products”. Let the application give the power to users without knowledge of query language or underlying data architecture
With advance NLP algorithm, business users simply ask questions like, “show me sales of last quarter”, “average monthly sales of my products”. Let the application give the power to users without knowledge of query language or underlying data architecture
Our application is compatible with almost all databases, be it RDBMS, or columnar database, or even flat files like spreadsheets or csv files. You can even connect to your own custom database via JDBC connection. Further, our database connection can be switched dynamically based on logged in users or its organization or other parameters. So, all your clients can use the same reports and dashboards without worrying about any data security breech.
Our application is compatible with almost all databases, be it RDBMS, or columnar database, or even flat files like spreadsheets or csv files. You can even connect to your own custom database via JDBC connection. Further, our database connection can be switched dynamically based on logged in users or its organization or other parameters. So, all your clients can use the same reports and dashboards without worrying about any data security breech.
Our application can be installed on an in-house server where you have full control of your data and its security. Or on cloud where it is accessible to larger audience without overheads and maintenance of the servers. One solution that works for all.
Our application can be installed on an in-house server where you have full control of your data and its security. Or on cloud where it is accessible to larger audience without overheads and maintenance of the servers. One solution that works for all.
Different companies have different business processes that the existing BI tools do not encompass. Helical Insight permits you to design your own workflows and specify what functional module of BI gets triggered
Different companies have different business processes that the existing BI tools do not encompass. Helical Insight permits you to design your own workflows and specify what functional module of BI gets triggered