private void outputTotalsRow(	int groupLevel, 
    								ICalculator[] calcForCurrentGroupingLevel){
    	if(distribOfCalculatorsInDataColsArray.length != dataCols.size()){
    		//TODO: improve
    		throw new IllegalArgumentException("dataRows and distributionOfCalculators arrays should have the same length"); 
    	}
    	
    	//if not totals afte each group
    	if(!getShowTotals() && groupLevel>-1){
    		return;
    	}
    	
    	IReportOutput output = getOutput();
    	output.startRow(new RowProps(ReportContent.DATA, 0, true));
    	
    	if(groupCols != null && groupCols.size() > 0){
    		//prepare and output the Total column
    		String totalString = getTotalStringForGroupingLevel(groupLevel);
    		output.output(new CellProps.Builder(totalString)
    							.horizAlign(HorizontalAlign.LEFT)
    							.build());
    		
    		if(groupCols.size() > 1){
    			//for all others grouping columns put whitespaces 
    			//(groupColumns.length-1 colspan because the first column was already 
    			//filled with the word "Total xxxx"
    			
    			//if you want a single cell spanning multiple rows decomment this
    			//output.output(new CellProps.Builder(IReportOutput.WHITESPACE)
    			//							.colspan(groupCols.size()-1) 
    			//							.build());
    			
    			//this is to display an empty cell for every remaining group column
    			for(int i=1; i<groupCols.size(); i++){
    				output.output(CellProps.EMPTY_CELL); 
    			}
    		}
        }
        
    	String formattedResult = null; 
    	
        //then iterate over data columns to display the totals for those having calculators
    	for (int i = 0; i < dataCols.size(); i++) {
			IDataColumn column = dataCols.get(i);
			if(column.getCalculator() != null){
				int calculatorIndex = distribOfCalculatorsInDataColsArray[i];
				Object calculatorResult = calcForCurrentGroupingLevel[calculatorIndex].getResult();
				
				//format the computed value 
				formattedResult = dataCols.get(i).getFormattedValue(calculatorResult); 
				
				output.output(new CellProps.Builder(formattedResult)
									.horizAlign(dataCols.get(i).getHorizAlign())
									.build());
			}else{
				//if the column doesn't have a calculator asociated 
				//then display an empty value (whitespace) with colspan 1
				output.output(CellProps.EMPTY_CELL);
			}
		}
    	output.endRow(new RowProps(ReportContent.DATA, 0, true));
    }