Pentaho Tools :

Pentaho C-Tools(CDE,CDF,CDA),Pentaho CE & EE Server,OLAP-Cubes,Analysis using Pivot4J, Saiku Analytics, Saiku Reporting, Ad-hoc Reporting using Interactive Reporting Tool,Dashboards,Reports using PRD, PDD,Data Integration using Kettle ETL,Data Mining usign WEKA,Integration of Servers with Databases,Mobile/iPad compatible Dashboards using Bootstrap Css,Drilldown dashboards,Interactive Dashboards

Wednesday, 2 July 2014

Columns Grand total in Table component of Pentaho CDE

Hi Guys,

Table component has no direct feature of adding column totals as of this post written date(July 2nd 2013)....

Here is the pentaho community & data tables shared java script  to find the Summation of columns in Table component.

Write below code in Draw Function of Table Component.

function f() {
    var grandTotalRow = "<tfoot><tr><td>Total</td>";
  for(i=1;i<4;i++) {
        var total=0;
         var rows = $('#' + this.htmlObject + ' tbody tr');
          rows.each(function() {
            var cellVal = parseFloat($('td:eq('+i+')', this).text().replace(',',''));
        grandTotalRow += "<td>"+total.toFixed(2);+"</td>";
          grandTotalRow += "</tr></tfoot>";
          if($('#'+this.htmlObject+' tfoot').length===0)


Sample output:

References :

Example :