var pivotTableObj3 = new ej.pivotview.PivotView({
dataSourceSettings: {
dataSource: data,
expandAll: false,
showGrandTotals: false,
values: [
{ name: 'crew_production', caption: 'Units Completed' },
{ name: 'estimated_labor_budget', caption: 'Estimated Labor Cost' },
{ name: 'st_hours', caption: 'Reg Hours' },
{ name: 'actual_employee_st_cost', caption: 'Actual Labor Reg' },
{ name: 'ot_hours', caption: 'OT Hours' },
{ name: 'actual_employee_ot_cost', caption: 'Actual Labor OT' },
{ name: 'Total_Labor_Cost', caption: 'Total Labor Cost', type: 'CalculatedField' },
{ name: 'Labor_Variance', caption: 'Labor Variance', type: 'CalculatedField' }
],
filters: [],
rows: [
{ name: 'date', caption: 'Schedule Date' },
{ name: 'item', caption: 'Item' }
],
filterSettings: [],
sortSettings: [
{ name: 'date', order: 'Descending' }
],
formatSettings: [
{ name: 'date', type: 'date', format: 'MMM dd, yyyy' },
{ name: 'crew_production', format: '#,###' },
{ name: 'estimated_labor_budget', format: '$#,###.00' },
{ name: 'st_hours', format: '#,###.00' },
{ name: 'actual_employee_st_cost', format: '$#,###.00' },
{ name: 'ot_hours', format: '#,###.00' },
{ name: 'actual_employee_ot_cost', format: '$#,###.00' },
{ name: 'Total_Labor_Cost', format: '$#,###.00' },
{ name: 'Labor_Variance', format: '$#,###.00' }
],
calculatedFieldSettings: [
{ name: 'Total_Labor_Cost', formula: '"Sum(actual_employee_st_cost)"+"Sum(actual_employee_ot_cost)"' },
{ name: 'Labor_Variance', formula: '"Sum(estimated_labor_budget)"-("Sum(actual_employee_st_cost)"+"Sum(actual_employee_ot_cost)")' }
]
},
gridSettings: gSettings,
allowCalculatedField: true,
showTooltip: false,
aggregateCellInfo: function(args) {
if (args.value === Infinity) {
args.value = 0;
}
},
height: objHeight
});