private static void AddHeaders(MigraDoc.DocumentObjectModel.Tables.Table table, string optionalHeader)
        {
            //Headers
            // Create a font
            Font font = new Font("Arial", 8);

            table.Borders.Width = 0.25;

            table.AddColumn(Unit.FromCentimeter(3));
            table.AddColumn(Unit.FromMillimeter(28));
            table.AddColumn(Unit.FromMillimeter(28));
            table.AddColumn(Unit.FromMillimeter(28));
            table.AddColumn(Unit.FromMillimeter(28));
            table.AddColumn(Unit.FromCentimeter(5));

            if(optionalHeader != null)
                AddRoleHeader(table, optionalHeader);

            MigraDoc.DocumentObjectModel.Tables.Row row = table.AddRow();
            row.HeadingFormat = true;
            row.Format.Font.ApplyFont(font);
            row.Format.Font.Bold = true;
            row.Shading.Color = Colors.PaleGoldenrod;
            Cell cell = row.Cells[0];
            cell.AddParagraph("Surname");
            cell = row.Cells[1];
            cell.AddParagraph("Firstname");
            cell = row.Cells[2];
            cell.AddParagraph("Home");
            cell = row.Cells[3];
            cell.AddParagraph("Work");
            cell = row.Cells[4];
            cell.AddParagraph("Cell");
            cell = row.Cells[5];
            cell.AddParagraph("Email");
        }
        private static int AddAttendanceHeaders(int month1, int month2, List<int> month1Events, List<int> month2Events, MigraDoc.DocumentObjectModel.Tables.Table table, string titleMessage)
        {
            //Headers
            // Create a font
            Font font = new Font("Arial", 8);
            int totalDays = month1Events.Count + month2Events.Count;
            table.Borders.Width = 0.25;

            table.AddColumn(Unit.FromCentimeter(3));  //Firstname
            table.AddColumn(Unit.FromMillimeter(28)); //Surname
            foreach (int day in month1Events)
            {
                table.AddColumn(Unit.FromMillimeter(56/totalDays)); //Weeks in month 1
            }
            foreach (int day in month2Events)
            {
                table.AddColumn(Unit.FromMillimeter(56/totalDays)); //Weeks in month 2
            }
            table.AddColumn(Unit.FromCentimeter(2)); //Member/Visitor
            table.AddColumn(Unit.FromCentimeter(5)); //Comments

            MigraDoc.DocumentObjectModel.Tables.Row row = table.AddRow();
            row.HeadingFormat = true;
            row.Format.Font.ApplyFont(font);
            row.Format.Alignment = ParagraphAlignment.Center;
            row.Shading.Color = Colors.PaleGoldenrod;
            row.Format.Font.Bold = true;
            Cell cell = row.Cells[0];
            cell.AddParagraph(titleMessage);
            cell.MergeRight = 1;
            cell = row.Cells[2];
            cell.AddParagraph(Months[month1-1]);
            if (month1Events.Count > 1)
            {
                cell.MergeRight = month1Events.Count-1;
            }
            cell = row.Cells[2+month1Events.Count];
            cell.AddParagraph(Months[month2-1]);
            if (month2Events.Count > 1)
            {
                cell.MergeRight = month2Events.Count - 1;
            }
            cell = row.Cells[2+month1Events.Count+month2Events.Count];
            cell.AddParagraph(" ");

            //Add the 2nd row
            row = table.AddRow();
            row.HeadingFormat = true;
            row.Format.Font.ApplyFont(font);
            row.Shading.Color = Colors.PaleGoldenrod;
            cell = row.Cells[0];
            cell.AddParagraph("Surname");
            cell = row.Cells[1];
            cell.AddParagraph("Firstname");
            int colCount = 2;
            foreach (int day in month1Events)
            {
                cell = row.Cells[colCount];
                cell.AddParagraph(day.ToString());
                cell.Format.Alignment = ParagraphAlignment.Center;
                colCount++;
            }
            foreach (int day in month2Events)
            {
                cell = row.Cells[colCount];
                cell.AddParagraph(day.ToString());
                cell.Format.Alignment = ParagraphAlignment.Center;
                colCount++;
            }
            cell = row.Cells[colCount++];
            cell.AddParagraph("Role");
            cell = row.Cells[colCount];
            cell.AddParagraph("Comments");

            return totalDays + 3;
        }