/// <summary>
        /// Writes design review totals
        /// </summary>
        /// <param name="sheet">The sheet to write to</param>
        /// <param name="design_review_type">the design review type</param>
        /// <param name="col_start">the column to start on</param>
        /// <param name="total_foreach_headers">the list of headers</param>
        /// <param name="feheaders">the data array for headers</param>
        /// <param name="vert_business_seg">the array of business segments</param>
        /// <returns></returns>
        private int WriteDesignTotals(Excel.Worksheet sheet, string design_review_type, int col_start, List <string> total_foreach_headers, object[,] feheaders, object[,] vert_business_seg)
        {
            int NUM_TOTAL_PAGE_HEADERS = 0;

            // fill in headers
            feheaders[0, col_start - 2] = Properties.Resources.string_design_review_type;
            int feheader_index = col_start - 1;

            for (int i = 0; i < total_foreach_headers.Count; i++)
            {
                SortedSet <string> set = dict_total[total_foreach_headers[i]];
                foreach (string h in set)
                {
                    feheaders[0, feheader_index++] = total_foreach_headers[i] + " " + h;
                    NUM_TOTAL_PAGE_HEADERS++;
                }
            }

            //write headers to sheet
            string range_text = Utility.GetRowRange(1, col_start, col_start + NUM_TOTAL_PAGE_HEADERS);

            //Utility.Log("Total Range:", range_text);
            Excel.Range rheader = sheet.get_Range(range_text);
            rheader.Value2   = feheaders;
            rheader.WrapText = false;

            int row_start = 2;

            //Go through all business segments
            for (int i = 0; i < vert_business_seg.GetLength(0); i++)
            {
                //get business segment string
                string business_seg = vert_business_seg[i, 0] as string;
                //create array to store data
                object[,] oadata = new object[1, NUM_TOTAL_PAGE_HEADERS + 1];
                //set column design review type
                oadata[0, 0] = design_review_type;

                int col_index = 1;
                // calculate totals for each header key
                for (int j = 0; j < total_foreach_headers.Count; j++)
                {
                    string             key = total_foreach_headers[j];
                    SortedSet <string> set = dict_total[total_foreach_headers[j]];
                    // for each header value calculate totals
                    foreach (string value in set)
                    {
                        BusinessSegment bs = dictionary_business_segments[business_seg];
                        oadata[0, col_index++] = bs.CalculateTotal(design_review_type, key, value);
                    }
                }

                // set data
                Excel.Range r_total = sheet.get_Range(Utility.GetRowRange(row_start + i, col_start, col_start + NUM_TOTAL_PAGE_HEADERS));
                r_total.Value2 = oadata;
            }
            //return columns written
            return(NUM_TOTAL_PAGE_HEADERS + 1);
        }
        /// <summary>
        /// Writes all generic totals information
        /// </summary>
        /// <param name="sheet">the sheet to write to</param>
        /// <param name="col_start">the column to start on</param>
        /// <param name="totals_headers">the list of headers</param>
        /// <param name="feheaders">the array that stores the headers</param>
        /// <param name="vert_business_seg">the business segment array</param>
        /// <returns></returns>
        private int WriteAllTotal(Excel.Worksheet sheet, int col_start, List <string> totals_headers, object[,] feheaders, object[,] vert_business_seg)
        {
            int           NUM_TOTAL_HEADERS = 0;
            List <string> list_drt          = ConfigLoader.list_drt;

            //fill in header info
            int feheader_index = col_start - 2;

            for (int i = 0; i < totals_headers.Count; i++)
            {
                SortedSet <string> set = dict_total[totals_headers[i]];
                foreach (string h in set)
                {
                    feheaders[0, feheader_index++] = totals_headers[i] + " " + h;
                    NUM_TOTAL_HEADERS++;
                }
            }

            //correct offset by copying header into new array
            object[,] feheaders_actual = new object[1, NUM_TOTAL_HEADERS];
            for (int i = 0; i < NUM_TOTAL_HEADERS; i++)
            {
                feheaders_actual[0, i] = feheaders[0, i + feheader_index - NUM_TOTAL_HEADERS];
            }

            //set headers in sheet
            string range_text = Utility.GetRowRange(1, col_start, col_start + NUM_TOTAL_HEADERS - 1);

            Excel.Range rheader = sheet.get_Range(range_text);
            rheader.Value2   = feheaders_actual;
            rheader.WrapText = false;

            int row_start = 2;

            //for each business segment
            for (int i = 0; i < vert_business_seg.GetLength(0); i++)
            {
                string business_seg = vert_business_seg[i, 0] as string;
                object[,] oadata = new object[1, NUM_TOTAL_HEADERS];

                //for each header
                int col_index = 0;
                for (int j = 0; j < totals_headers.Count; j++)
                {
                    //for each value associated with that header
                    string             key = totals_headers[j];
                    SortedSet <string> set = dict_total[totals_headers[j]];
                    foreach (string value in set)
                    {
                        BusinessSegment bs  = dictionary_business_segments[business_seg];
                        int             sum = 0;
                        // include all design review types in this total
                        foreach (string drt in list_drt)
                        {
                            sum += bs.CalculateTotal(drt, key, value);
                        }
                        oadata[0, col_index++] = sum;
                    }
                }
                //set data in sheet
                Excel.Range r_total = sheet.get_Range(Utility.GetRowRange(row_start + i, col_start, col_start + NUM_TOTAL_HEADERS - 1));
                r_total.Value2 = oadata;
            }
            // return columns written
            return(NUM_TOTAL_HEADERS);
        }