//
// public static SimplePersonsList GetInstance(Selection selection,
// Rectangle pageSize,
// string reportFile) {
//
// if (instance == null)
// instance = new SimplePersonsList(selection, pageSize, reportFile);
// else {
// instance.selection = selection;
// instance.reportFile = reportFile;
// }
//
// if (!this.doc.IsOpen())
// this.doc.Open();
//
// return instance;
// }
public override void MakeReport()
{
Table t = new Table(3);
t.Border = 0;
t.DefaultCellBorder = 0;
Cell cell = new Cell();
cell.HorizontalAlignment = Element.ALIGN_CENTER;
t.DefaultCell = cell; // Default cell
Font fuenteTitulo = FontFactory.GetFont(FontFactory.HELVETICA_OBLIQUE, 14, Font.UNDERLINE);
cell = new Cell();
Chunk texto = new Chunk("Apellido", fuenteTitulo);
cell.Add(texto);
t.AddCell(cell);
cell = new Cell();
texto = new Chunk("Nombre", fuenteTitulo);
cell.Add(texto);
t.AddCell(cell);
cell = new Cell();
texto = new Chunk("E-Mail", fuenteTitulo);
cell.Add(texto);
t.AddCell(cell);
Font fuenteDatos = FontFactory.GetFont(FontFactory.HELVETICA, 10);
foreach (Person p in this.selection.Persons) {
cell = new Cell();
texto = new Chunk(p.Surname, fuenteDatos);
cell.Add(texto);
t.AddCell(cell);
cell = new Cell();
texto = new Chunk(p.Name, fuenteDatos);
cell.Add(texto);
t.AddCell(cell);
cell = new Cell();
texto = new Chunk(p.EMail, fuenteDatos);
cell.Add(texto);
t.AddCell(cell);
}
this.doc.Add(t);
}