var pivotTableObj1 = new ej.pivotview.PivotView({
dataSourceSettings: {
dataSource: data,
expandAll: false,
showGrandTotals: false,
values: [
{ name: 'unit_budget', caption: 'Unit Budget' },
{ name: 'production', caption: 'Units Completed' },
{ name: 'Units_Remaining', caption: 'Units Remaining', type: 'CalculatedField' },
{ name: 'Pct_Units_Completed', caption: '% Units Completed', type: 'CalculatedField' },
{ name: 'item_rate', caption: 'Labor Cost Per Unit' },
{ name: 'estimated_labor_cost', caption: 'Estimated Labor Cost' },
{ name: 'actual_employee_st_cost', caption: 'Actual Labor Reg' },
{ name: 'actual_employee_ot_cost', caption: 'Actual Labor OT' },
{ name: 'actual_employee_labor_cost', caption: 'Actual Labor Cost' },
{ name: 'Labor_Variance', caption: 'Labor Variance', type: 'CalculatedField' },
{ name: 'labor_budget', caption: 'Total Labor Budget' },
{ name: 'Remaining_Labor_Budget', caption: 'Remaining Labor Budget', type: 'CalculatedField' },
{ name: 'Pct_Budget_Completed', caption: '% Budget Completed', type: 'CalculatedField' }
],
filters: [
{ name: 'production_bool' }
],
rows: [
{ name: 'item', caption: 'Item Code' }
],
filterSettings: [
{ name: 'production_bool', type: 'Exclude', items: ['Labor'] }
],
formatSettings: [
{ name: 'unit_budget', format: '#,###.00' },
{ name: 'production', format: '#,###.00' },
{ name: 'Units_Remaining', format: '#,###.00' },
{ name: 'Pct_Units_Completed', format: 'P2' },
{ name: 'production', format: '#,###.00' },
{ name: 'item_rate', format: '$#,###.00' },
{ name: 'estimated_labor_cost', format: '$#,###.00' },
{ name: 'actual_employee_st_cost', format: '$#,###.00' },
{ name: 'actual_employee_ot_cost', format: '$#,###.00' },
{ name: 'actual_employee_labor_cost', format: '$#,###.00' },
{ name: 'Labor_Variance', format: '$#,###.00' },
{ name: 'labor_budget', format: '$#,###.00' },
{ name: 'Remaining_Labor_Budget', format: '$#,###.00' }
],
calculatedFieldSettings: [
{ name: 'Units_Remaining', formula: '"Sum(unit_budget)"-"Sum(production)"' },
{ name: 'Pct_Units_Completed', formula: '"Sum(production)"/"Sum(unit_budget)"' },
{ name: 'Labor_Variance', formula: '"Sum(estimated_labor_cost)"-"Sum(actual_employee_labor_cost)"' },
{ name: 'Remaining_Labor_Budget', formula: '"Sum(labor_budget)"-"Sum(actual_employee_labor_cost)"' },
{ name: 'Pct_Budget_Completed', formula: '"Sum(actual_employee_labor_cost)"/"Sum(labor_budget)"' }
]
},
gridSettings: gSettings,
allowCalculatedField: true,
showTooltip: false,
height: objHeight
});