Create A Custom Table Report using Helical Insight

Posted on by By Sohail, in Business Intelligence, Data Visualization, Helical Insight, Javascript | 0

Create A Custom Table Report using Helical Insight (Dynamically Picking the Columns Names and Data)

If you have already had a Hands-On experience on the Helical Insight Tool [HI tool] then this blog would be helpful

For a creating a report there are 4 files required
1. EFW

the Report Layout lies on the HTML page, the SQL queries lies within the EFWD file and the visualization lies in the EFWVF File.
Hence once the Query is fired it comes to the visualization file to create a table as that’s our goal. With the help of the following code below it can be created with ease.

The below code here is a template of our EFWVF looks like
<Chart id=”1″>

//Your Visualization Code Goes Here


Chart ID here is 1 which is unique
Type is of custom
DataSource 1 is the Unique ID defined in the EFWVF File. ie (<DataMap id=”1″ )
Now within the <script> </script>
we Paste the following:

//The If Block Does Return A Message NO Data when there is No Data
if(data.length == 0)
$(‘#chart_1′).html(“<div ><h4 style=’text-align:CENTER;color:black; padding-top:60px;’>No Data Available For Current Selection</h4></div>”);
//The Else Block Returns The Table if there is a Table
//Here the funtion Tabluate Returns the Data in Tabular Form
function tabulate(elem, data, columns)
//Function Start
var table =“table”)
.attr(“class”,” table display compact width:100%;cellspacing:1 “)
thead = table.append(“thead”),
tbody = table.append(“tbody”);

//Append the header row
.text(function(column) { return column; })
.attr(‘class’, function(d, i){ return “colH_” + i; })
.style(‘@media print’,’display:none’)

// create a row for each object in the data
var rows = tbody.selectAll(“tr”)

// create a cell in each row for each column
var cells = rows.selectAll(“td”)
.data(function(row) {
return {
return {column: column, value: row[column]};
.text(function(d) { return d.value; })
.attr(‘class’, function(d, i){ return “col_” + i; })
.attr(‘align’, ‘left’)
return table;
//Function END

//Render the table
//Object.keys(data[0]) is the Data to fetch the Column Header
//data has the data of the Table
var subjectTable = tabulate( ‘#chart_1’, data, Object.keys(data[0]));
Save it in the same Directory with rest of the file

Run your report on HI and you get a table.

Keep in mind you can change the query and still get the new columns from the new query.


Best Open Source Business Intelligence Software Helical Insight is Here


A Business Intelligence Framework

Sohail Izebhijie

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments