Ejemplo n.º 1
0
 public PdfPTable SessionParticipation(String path,ViewModels.PollReportViewModel model)
 {
     PdfPTable table = new PdfPTable(4);
     table.WidthPercentage = 100;
     int[] width = new int[] { 10, 5, 5, 10 };
     table.SetWidths(width);
     Phrase phrase = new Phrase("Participant", font);
     BaseColor basecolor = new BaseColor(232, 238, 244);
     table.AddCell(new PdfPCell(new PdfPCell(new Phrase(phrase)) { BackgroundColor = basecolor }));
     phrase.Clear();
     phrase.Add("Attended");
     table.AddCell(new PdfPCell(new PdfPCell(new Phrase(phrase)) { BackgroundColor = basecolor }));
     phrase.Clear();
     phrase.Add("Participated (%)");
     table.AddCell(new PdfPCell(new PdfPCell(new Phrase(phrase)) { BackgroundColor = basecolor }));
     phrase.Clear();
     phrase.Add("Points Accumulated");
     table.AddCell(new PdfPCell(new PdfPCell(new Phrase(phrase)) { BackgroundColor = basecolor }));
     foreach (var participant in model.participants)
     {
         phrase.Clear();
         phrase.Add(participant.firstName +" " + participant.lastName);
         table.AddCell(new Phrase(phrase));
         phrase.Clear();
         phrase.Add(participant.attended.ToString());
         table.AddCell(new Phrase(phrase));
         phrase.Clear();
         phrase.Add(model.participated(participant));
         table.AddCell(new Phrase(phrase));
         phrase.Clear();
         phrase.Add(model.points(participant));
         table.AddCell(new Phrase(phrase));
     }
     return table;
 }