public static WordDocument CreateDocument(Student student, AnnualGoal goal, string teacherName, string gradingPeriod, SchoolYearType year, string campus) { WordDocument doc = WordFactory.Document(); doc = doc.AddTitle("Special Education"); doc = doc.AddTitle("Data Collection Sheet"); doc = doc.AddStudentInfo(student.GetFullName(), student.LocalID, student.DateOfBirth, student.Gender, student.Grade, campus, year, teacherName, gradingPeriod); doc = doc.AddGoal(goal); return(doc); }
private static void CreateSingleDocument(string targetDirectory, string evaluator, int period, SchoolYear schoolYear) { var doc = WordFactory.Document(); var gradingPeriod = $"Grading Period {period}"; foreach (var student in schoolYear.Students.Student) { var lastNumber = student.AnnualGoals.Goals.Count - 1; for (var i = 0; i < student.AnnualGoals.Goals.Count; i++) { var goal = student.AnnualGoals.Goals[i]; doc = doc.ProcessDocument(student, goal, evaluator, gradingPeriod, schoolYear.Identifier, student.Campus, false); } } var fileName = $"2020–2021_oms_ale_marshall_gp{period}_goals_objectives_data_sheet.docx"; var newPath = Path.Combine(targetDirectory, fileName); doc.Save(newPath, true); }