<% //# SECOND DIMENSION //# Get the length of all columns (init value = # static columns) var columns_length = 3; %> <% _.each(datatable.getTables(), function(table, tableIndex){ _.each(table.getSubtables(), function(subtable, subtableIndex){ columns_length += subtable.getColumns().length + 1; //# columns length + 1 total column if (subtable.getColumns().length > 0) { %> <% } %> <% }); if(!table.hasOnlyOneSubtable()){ columns_length += 1; %> <% } }); %> <% //# FIRST DIMENSION %> <% _.each(datatable.getTables(), function(table, tableIndex){ _.each(table.getSubtables(), function(subtable, subtableIndex){ _.each(subtable.getColumns(), function(column, index0){ %> <% }); %> <% }); if(!table.hasOnlyOneSubtable()){ %> <% } }) %> <% var oldType = ''; //# which types belong together in 1 tbody, the tbody wont close after 1 tr, until it doesnt match one of the types below! var isJoinType = function(type) { return (type == 'subclass' || type == 'leveldetail' || type == 'subclassgroup' || type == 'subclassdetail') } //# ADD STRUCTURE COLUMN _.each(structure.getFields(), function(field, index){ //# PRINT START TBODY if(!isJoinType(field.getType())){ if(isJoinType(oldType)){ %> <% } if(field.getType() == 'level%'){ %> <% }else{ %> <% } %> <% } else if(!isJoinType(oldType)) { %> <% } //# PRINT EMPTY ROW IF ANY (and skip all the rest) if(field.getType() == 'empty'){ %> <% } else { //# PRINT START ROW %> "> <% //# ADD SUBTABLE _.each(datatable.getTables(), function(table, tableIndex){ _.each(table.getSubtables(), function(subtable, subtableIndex){ //# ADD COLUMNS _.each(subtable.getColumns(), function(column, i){ var curfield = column.getFields()[index]; if(curfield.getType() != 'level%'){ %> <% }else{ %> <% } }); //# ADD SUBTOTAL COLUMN var subtotalcolumnfield = subtable.getTotalColumn().getFields()[index]; if(subtotalcolumnfield.getType() != 'level%'){ %> <% }else{ %> <% } }); //# ADD TOTAL COLUMN (when more than 1 subtable!) if(!table.hasOnlyOneSubtable()){ var totalcolumnfield = table.getTotalColumn().getFields()[index]; if(totalcolumnfield.getType() != 'level%'){ %> <% }else{ %> <% } } }); //# ADD TOTAL COLUMN actual + conso var totalcolumnfield = datatable.getTotalColumn().getFields()[index]; if(totalcolumnfield.getType() != 'level%'){ %> <% }else{ %> <% } } oldType = field.getType(); %> <% if(!isJoinType(oldType) && oldType != 'emptyrow'){ %> <% } %> <% }); %>
<% if(subtable.getName() != 'false') print(subtable.getName()); else print('Actual'); %>
<%= subtable.getTotalColumn().getName() %> <%= table.getTotalColumn().getName() %> <%= datatable.getTotalColumn().getName() %>
class="tooltip-pivot text-right">
<%= column.getName() %>
  
<%= field.getName() %> style="width: 50px"><%= Ffof.App.Formatters.number(curfield.getValue(), curfield.getPerc()) %> style="width: 50px"><%= Ffof.App.Formatters.cellperc(curfield.getValue(), curfield.getValue()) %> style="width: 50px"><%= Ffof.App.Formatters.number(subtotalcolumnfield.getValue(), subtotalcolumnfield.getPerc()) %> style="width: 50px"><%= Ffof.App.Formatters.cellperc(subtotalcolumnfield.getValue(), subtotalcolumnfield.getValue()) %> style="width: 50px"><%= Ffof.App.Formatters.number(totalcolumnfield.getValue(), totalcolumnfield.getPerc()) %> style="width: 50px"><%= Ffof.App.Formatters.cellperc(totalcolumnfield.getValue(), totalcolumnfield.getValue()) %> style="width: 50px"><%= Ffof.App.Formatters.number(totalcolumnfield.getValue(), totalcolumnfield.getPerc()) %> style="width: 50px"><%= Ffof.App.Formatters.cellperc(totalcolumnfield.getValue(), totalcolumnfield.getValue()) %>