static void Main(string[] args) { //start validators InputValidation IV = new InputValidation(); RuleValidation RV = new RuleValidation(); ReportGeneration RG = new ReportGeneration(); CsvParserOptions csvParserOptions = new CsvParserOptions(false, ','); CsvApplicantMapping csvMapper = new CsvApplicantMapping(); CsvParser <Applicant> csvParser = new CsvParser <Applicant>(csvParserOptions, csvMapper); //\EnrollmentApplication\EnrollmentApplication\bin\Debug\netcoreapp2.0\TestFile.csv var parseList = csvParser .ReadFromFile("TestFile.csv", Encoding.UTF8) .ToList(); List <Applicant> transform = parseList.Select(i => i.Result).ToList(); IV.Validation(transform); RV.Validation(transform); RG.Report(transform); Console.WriteLine("The program has finished - Press any key to exit"); Console.ReadKey(); }
private void ComposeReport() { ComposeData(); // title ReportGeneration.AddTitle("Τριμηνιαία αναφορά στοιχείων απολογισμού δραστηριοτήτων Θωρηκτού «Γ. ΑΒΕΡΩΦ»"); ReportGeneration.AddEmptyLines(2); // visitors table ReportGeneration.AddNumberedIntent("ΕΠΙΣΚΕΨΕΙΣ ΟΜΑΔΙΚΕΣ-ΙΔΙΩΤΩΝ"); ReportGeneration.AddEmptyLines(1); ReportGeneration.AddElement(VisitorReportTable()); // rest ReportGeneration.AddEmptyLines(1); ReportGeneration.AddNumberedIntent("ΑΙΜΟΔΟΣΙΕΣ ΠΡΟΣΩΠΙΚΟΥ"); ReportGeneration.AddElement(new Paragraph(data[33], ReportGeneration.normalFont)); ReportGeneration.AddEmptyLines(1); ReportGeneration.AddNumberedIntent("ΣΥΜΜΕΤΟΧΗ ΑΝΤΙΠΡΟΣΩΠΕΙΩΝ ΣΕ ΤΟΠΙΚΕΣ ΕΚΔΗΛΩΣΕΙΣ"); ReportGeneration.AddElement(new Paragraph(data[34], ReportGeneration.normalFont)); ReportGeneration.AddEmptyLines(1); ReportGeneration.AddNumberedIntent("ΔΙΑΘΕΣΗ ΘΩΡΗΚΤΟΥ «Γ.ΑΒΕΡΩΦ» ΓΙΑ ΚΟΙΝΩΝΙΚΕΣ ΕΚΔΗΛΩΣΕΙΣ"); ReportGeneration.AddElement(new Paragraph(data[35], ReportGeneration.normalFont)); ReportGeneration.AddEmptyLines(1); ReportGeneration.AddNumberedIntent("ΠΟΛΙΤΙΣΤΙΚΕΣ ΔΡΑΣΤΗΡΙΟΤΗΤΕΣ ΘΩΡΗΚΤΟΥ «Γ.ΑΒΕΡΩΦ»"); ReportGeneration.AddElement(new Paragraph(data[36], ReportGeneration.normalFont)); ReportGeneration.AddEmptyLines(1); ReportGeneration.AddNumberedIntent("ΓΕΝΙΚΗ ΕΠΙΘΕΩΡΗΣΗ ΘΩΡΗΚΤΟΥ «Γ.ΑΒΕΡΩΦ»"); ReportGeneration.AddElement(new Paragraph(data[37], ReportGeneration.normalFont)); }
public void Reporter(User user, string ReportType) { var reportGeneration = new ReportGeneration(); reportGeneration.ReportType = "CRS"; reportGeneration.user = user; reportGeneration.GenerateReport(); }
public void WriteReport() { ReportGeneration.CreatePDF(SettingsManager.Read("ExportPath") + "/SemesterReport.pdf", false); ReportGeneration.OpenDoc(); ComposeReport(); ReportGeneration.CloseDoc(); CalendarViewController viewController = FindObjectOfType <CalendarViewController>(); viewController.RequestView(CalendarViewController.State.MONTHLY); }
public override void GenerateReport() { ReportGeneration.CreatePDF(SettingsManager.Read("ExportPath") + "/WeeklyReport" + assignedDate.ToString().Replace('/', '_').Replace('\\', '_').Replace(':', '_') + ".pdf", true); ReportGeneration.OpenDoc(); ReportGeneration.AddTitle(gManager.language.WeeklyGuideSchedule); ReportGeneration.AddEmptyLines(2); { PdfPTable table = new PdfPTable(5) { WidthPercentage = 100, }; table.SetWidths(new float[] { .7f, .7f, 3, .9f, .9f }); table.AddCell(ReportGeneration.AddCell(gManager.language.Date, 1, Element.ALIGN_CENTER, ReportGeneration.boldFont)); table.AddCell(ReportGeneration.AddCell(gManager.language.Time, 1, Element.ALIGN_CENTER, ReportGeneration.boldFont)); table.AddCell(ReportGeneration.AddCell(gManager.language.Details, 1, Element.ALIGN_CENTER, ReportGeneration.boldFont)); table.AddCell(ReportGeneration.AddCell(gManager.language.TourGuies, 1, Element.ALIGN_CENTER, ReportGeneration.boldFont)); table.AddCell(ReportGeneration.AddCell(gManager.language.OfficerOnDuty, 1, Element.ALIGN_CENTER, ReportGeneration.boldFont)); foreach (DayOfWeek day in days) { NewEntryList list = day.GetEvents(); Event e; for (int i = 0; i < list.Count(); i++) { if (i == 0) { table.AddCell(ReportGeneration.AddCell(day.header.text, 1, list.Count(), Element.ALIGN_CENTER, ReportGeneration.boldFont)); } if (list.TryGet(i, out e)) { table.AddCell(ReportGeneration.AddCell(e.startTime + " - " + e.endTime, 1, Element.ALIGN_CENTER, ReportGeneration.normalFont)); table.AddCell(ReportGeneration.AddCell(e.ToString(), 1, Element.ALIGN_CENTER, ReportGeneration.normalFont)); } if (i == 0) { table.AddCell(ReportGeneration.AddCell(day.Guides.text, 1, list.Count(), Element.ALIGN_CENTER, ReportGeneration.normalFont)); table.AddCell(ReportGeneration.AddCell(day.AF.text, 1, list.Count(), Element.ALIGN_CENTER, ReportGeneration.normalFont)); } } if (list == null || list.Count() == 0) { table.AddCell(ReportGeneration.AddCell(day.header.text, 1, Element.ALIGN_CENTER, ReportGeneration.boldFont)); table.AddCell(ReportGeneration.AddCell("", 1, Element.ALIGN_CENTER, ReportGeneration.normalFont)); table.AddCell(ReportGeneration.AddCell("", 1, Element.ALIGN_CENTER, ReportGeneration.normalFont)); table.AddCell(ReportGeneration.AddCell(day.Guides.text, 1, Element.ALIGN_CENTER, ReportGeneration.normalFont)); table.AddCell(ReportGeneration.AddCell(day.AF.text, 1, Element.ALIGN_CENTER, ReportGeneration.normalFont)); } } ReportGeneration.AddElement(table); ReportGeneration.AddEmptyLines(1); ReportGeneration.AddElement(new Paragraph(gManager.language.ChiefOfMuseum + " " + gManager.language.NavalOfficer, ReportGeneration.titleFont)); } ReportGeneration.CloseDoc(); }
public async Task UpdateAsync(ReportGeneration report) { var builder = Builders <ReportGeneration> .Filter; var filter = builder.Eq(r => r.Name, report.Name); var updateBuilder = Builders <ReportGeneration> .Update; var update = updateBuilder.Set(r => r.Status, report.Status); var collection = await GetCollection(); await collection.FindOneAndUpdateAsync(filter, update); }
static void Main() { // Initialize the database var db = new EmployeeDB(); db.AddEmployee(new Employee("Iceman", 1000, 25)); db.AddEmployee(new Employee("Goose", 2000, 30)); db.AddEmployee(new Employee("Maverick", 3000, 35)); db.AddEmployee(new Employee("Charlie", 1500, 22)); // Initialize report generation var generation = new ReportGeneration( new NameFirstFormatting(), new DatabaseEmployeeStorage(db), new ConsoleRendition()); var exitProgram = false; while (!exitProgram) { WriteLine("Select report output format ('q' to quit):"); WriteLine(" [N]ame-first"); WriteLine(" [S]alary-first"); WriteLine(" [A]ge-first"); switch (char.ToUpper(ReadKey(true).KeyChar)) { case 'N': generation.SetOutputFormat(new NameFirstFormatting()); generation.CompileReport(); break; case 'S': generation.SetOutputFormat(new SalaryFirstFormatting()); generation.CompileReport(); break; case 'A': generation.SetOutputFormat(new AgeFirstFormatting()); generation.CompileReport(); break; case 'Q': exitProgram = true; break; } WriteLine(); WriteLine(); WriteLine(); } }
public override void GenerateReport() { ReportGeneration.CreatePDF(SettingsManager.Read("ExportPath") + "/DailyReport" + assignedDate.ToString().Replace('/', '_').Replace('\\', '_').Replace(':', '_') + ".pdf", true); ReportGeneration.OpenDoc(); ReportGeneration.AddTitle(gManager.language.DailyGuideSchedule); ReportGeneration.AddEmptyLines(2); { PdfPTable table = new PdfPTable(2) { WidthPercentage = 100, }; table.SetWidths(new float[] { .25f, 1 }); table.AddCell(ReportGeneration.AddCell(header.text, 2, Element.ALIGN_CENTER, ReportGeneration.titleFont)); table.AddCell(ReportGeneration.AddCell(gManager.language.OfficerOnDuty, 1, Element.ALIGN_CENTER, ReportGeneration.boldFont)); table.AddCell(ReportGeneration.AddCell(info.GetOfficer(), 1, Element.ALIGN_CENTER, ReportGeneration.normalFont)); table.AddCell(ReportGeneration.AddCell(gManager.language.TourGuies, 1, Element.ALIGN_CENTER, ReportGeneration.boldFont)); table.AddCell(ReportGeneration.AddCell(info.GetTourGuides(), 1, Element.ALIGN_CENTER, ReportGeneration.normalFont)); table.AddCell(ReportGeneration.AddCell(gManager.language.Time, 1, Element.ALIGN_CENTER, ReportGeneration.boldFont)); table.AddCell(ReportGeneration.AddCell(gManager.language.Details, 1, Element.ALIGN_CENTER, ReportGeneration.boldFont)); Event e; for (int i = 0; i < info.Events.Count(); i++) { if (info.Events.TryGet(i, out e)) { table.AddCell(ReportGeneration.AddCell(e.startTime + " - " + e.endTime, 1, Element.ALIGN_CENTER, ReportGeneration.normalFont)); table.AddCell(ReportGeneration.AddCell(e.ToString(), 1, Element.ALIGN_CENTER, ReportGeneration.normalFont)); } } ReportGeneration.AddElement(table); ReportGeneration.AddEmptyLines(3); ReportGeneration.AddElement(new Paragraph(gManager.language.ChiefOfMuseum + " " + gManager.language.NavalOfficer, ReportGeneration.titleFont)); } ReportGeneration.CloseDoc(); }
public PdfPTable VisitorReportTable() { PdfPTable table = new PdfPTable(6) { WidthPercentage = 100, }; table.SetWidths(new float[] { 1, .5f, .5f, .1f, 1, .5f }); table.AddCell(ReportGeneration.AddCell("ΑΝΑΦΟΡΑ ΕΠΙΣΚΕΠΤΩΝ " + data[0] + " ΤΡΙΜΗΝΟΥ " + data[1], 6, Element.ALIGN_CENTER, ReportGeneration.boldFont)); table.AddCell(ReportGeneration.AddCell(" ", 6, 1, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΕΠΙΣΚΕΠΤΕΣ ΜΕ ΜΕΙΩΜΕΝΟ ΕΙΣΙΤΗΡΙΟ", 3, Element.ALIGN_CENTER, ReportGeneration.boldFont)); table.AddCell(ReportGeneration.AddCell("", 1, 17, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΕΠΙΣΚΕΠΤΕΣ ΧΩΡΙΣ ΕΙΣΙΤΗΡΙΟ", 2, Element.ALIGN_CENTER, ReportGeneration.boldFont)); table.AddCell(ReportGeneration.AddCell("ΚΑΤΗΓΟΡΙΑ", 1, Element.ALIGN_CENTER, ReportGeneration.tableBoldFont)); table.AddCell(ReportGeneration.AddCell("ΑΤΟΜΑ", 1, Element.ALIGN_CENTER, ReportGeneration.tableBoldFont)); table.AddCell(ReportGeneration.AddCell("ΕΙΣΠΡΑΞΕΙΣ", 1, Element.ALIGN_CENTER, ReportGeneration.tableBoldFont)); table.AddCell(ReportGeneration.AddCell("ΚΑΤΗΓΟΡΙΑ", 1, Element.ALIGN_CENTER, ReportGeneration.tableBoldFont)); table.AddCell(ReportGeneration.AddCell("ΑΤΟΜΑ", 1, Element.ALIGN_CENTER, ReportGeneration.tableBoldFont)); table.AddCell(ReportGeneration.AddCell("ΦΟΙΤΗΤΕΣ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[2], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[3], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΝΗΠΕΙΑΓΩΓΕΙΟ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[4], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("6 - 18 ΕΤΩΝ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[5], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[6], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΔΗΜΟΤΙΚΟ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[7], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΑΝΩ ΤΩΝ 65", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[8], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[9], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΓΥΜΝΑΣΙΟ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[10], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΣΥΝΟΛΟ ΕΠΙΣΚΕΠΤΩΝ ΜΕ ΜΕΙΩΜΕΝΟ ΕΙΣΙΤΗΡΙΟ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[11], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[12], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΛΥΚΕΙΟ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[13], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(" ", 3, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΕΚΠΕΔΕΥΤΙΚΟ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[14], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΕΠΙΣΚΕΠΤΕΣ ΜΕ ΚΑΝΟΝΙΚΟ ΕΙΣΙΤΗΡΙΟ", 3, Element.ALIGN_CENTER, ReportGeneration.boldFont)); table.AddCell(ReportGeneration.AddCell("ΑΜΕΑ ΚΑΙ ΣΥΝΟΔΟΙ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[15], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΚΑΤΗΓΟΡΙΑ", 1, Element.ALIGN_CENTER, ReportGeneration.tableBoldFont)); table.AddCell(ReportGeneration.AddCell("ΑΤΟΜΑ", 1, Element.ALIGN_CENTER, ReportGeneration.tableBoldFont)); table.AddCell(ReportGeneration.AddCell("ΕΙΣΠΡΑΚΣΕΙΣ", 1, Element.ALIGN_CENTER, ReportGeneration.tableBoldFont)); table.AddCell(ReportGeneration.AddCell("ΚΑΤΩ ΤΩΝ 6", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[16], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΠΟΛΙΤΕΣ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[17], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[18], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΠΟΛΥΤΕΚΝΟΙ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[19], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΞΕΝΟΙ ΠΟΛΙΤΕΣ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[20], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[21], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΣΤΡΑΤΙΩΤΙΚΟΙ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[22], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΣΥΝΟΛΟ ΕΠΙΣΚΕΠΤΩΝ ΜΕ ΚΑΝΟΝΙΚΟ ΕΙΣΙΤΗΡΙΟ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[23], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[24], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΑΝΕΡΓΟΙ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[25], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(" ", 3, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΕΚΔΗΛΩΣΕΙΣ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[26], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΣΥΝΟΛΙΚΟ", 3, Element.ALIGN_CENTER, ReportGeneration.boldFont)); table.AddCell(ReportGeneration.AddCell("ΣΥΝΟΛΟ ΕΠΙΣΚΕΠΤΩΝ ΧΩΡΙΣ ΕΙΣΙΤΗΡΙΟ", 1, Element.ALIGN_LEFT, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[27], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΣΥΝΟΛΟ ΕΠΙΣΚΕΠΤΩΝ ΜΕ ΕΙΣΙΤΗΡΙΟ", 1, Element.ALIGN_LEFT, ReportGeneration.tableBoldFont)); table.AddCell(ReportGeneration.AddCell(data[28], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[29], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(" ", 2, 3, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΣΥΝΟΛΟ ΕΠΙΣΚΕΠΤΩΝ ΧΩΡΙΣ ΕΙΣΙΤΗΡΙΟ", 1, Element.ALIGN_LEFT, ReportGeneration.tableBoldFont)); table.AddCell(ReportGeneration.AddCell(data[30], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[31], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell("ΣΥΝΟΛΟ ΕΙΣΠΡΑΞΕΩΝ", 1, Element.ALIGN_LEFT, ReportGeneration.tableBoldFont)); table.AddCell(ReportGeneration.AddCell(" ", 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); table.AddCell(ReportGeneration.AddCell(data[32], 1, Element.ALIGN_CENTER, ReportGeneration.tableFont)); return(table); }
public async Task AddAsync(ReportGeneration report) { var collection = await GetCollection(); await collection.InsertOneAsync(report); }