List of usage examples for com.itextpdf.text.pdf PdfPCell setRowspan
public void setRowspan(int rowspan)
From source file:Servlets.GenerarPinesGrupo.java
@Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String[] idEstudiante = req.getParameterValues("imprimir"); resp.setContentType("application/pdf"); OutputStream out = resp.getOutputStream(); String foto = getServletContext().getRealPath("/recursos/img/logoColegio.png"); req.setCharacterEncoding("UTF-8"); try {/*w w w. j ava 2 s . co m*/ try { Document documento = new Document(); PdfWriter.getInstance(documento, out); documento.open(); Paragraph par1 = new Paragraph(); Font fontit = new Font(Font.FontFamily.HELVETICA, 16, Font.BOLD, BaseColor.GRAY); par1.add(new Phrase("Pin de Acceso HeartsTics", fontit)); par1.setAlignment(Element.ALIGN_CENTER); par1.add(new Phrase(Chunk.NEWLINE)); par1.add(new Phrase(Chunk.NEWLINE)); documento.add(par1); // Image image = Image.getInstance("E:\\ArchivosVarios\\logoColegio.png"); // image.scalePercent(50); Image image = Image.getInstance(foto); image.scalePercent(60); Font fuentetabla = FontFactory.getFont("Arial", 8, Font.BOLD, BaseColor.BLACK); Font fuentetablaPin = FontFactory.getFont("Arial", 10, Font.BOLD, BaseColor.BLACK); Font fuentetablaHeader = FontFactory.getFont("Arial", 9, Font.BOLD, BaseColor.BLACK); Servicio controlador = new Servicio(); for (int i = 0; i < idEstudiante.length; i++) { int idEst = Integer.parseInt(idEstudiante[i]); Pin estudiante = controlador.pinEstudiante(idEst); PdfPTable tabla = new PdfPTable(3); tabla.setWidthPercentage(60); PdfPCell celdaHeader = new PdfPCell( new Paragraph("COLEGIO SAGRADOS CORAZONES", fuentetablaHeader)); celdaHeader.setVerticalAlignment(Element.ALIGN_MIDDLE); celdaHeader.setHorizontalAlignment(Element.ALIGN_CENTER); celdaHeader.setColspan(3); tabla.addCell(celdaHeader); PdfPCell celda01 = new PdfPCell(image); //PdfPCell celda01 = new PdfPCell(new Paragraph("imagen")); celda01.setHorizontalAlignment(Element.ALIGN_CENTER); celda01.setVerticalAlignment(Element.ALIGN_MIDDLE); celda01.setRowspan(2); celda01.setBorder(Rectangle.NO_BORDER); celda01.setBorder(Rectangle.LEFT); tabla.addCell(celda01); PdfPCell celda1 = new PdfPCell(new Paragraph( "Estudiante: " + estudiante.getNombres() + " " + estudiante.getApellidos(), fuentetabla)); PdfPCell celda2 = new PdfPCell(new Paragraph("Pin: " + estudiante.getIdPin(), fuentetablaPin)); PdfPCell celda3 = new PdfPCell( new Paragraph("Fecha creacion: " + estudiante.getInicio(), fuentetabla)); PdfPCell celda4 = new PdfPCell( new Paragraph("Fecha vencimiento: " + estudiante.getFin(), fuentetabla)); celda1.setHorizontalAlignment(Element.ALIGN_CENTER); celda1.setVerticalAlignment(Element.ALIGN_MIDDLE); celda1.setColspan(2); celda1.setBorder(Rectangle.NO_BORDER); celda1.setBorder(Rectangle.RIGHT); celda2.setHorizontalAlignment(Element.ALIGN_CENTER); celda2.setVerticalAlignment(Element.ALIGN_MIDDLE); celda2.setColspan(2); celda2.setBorder(Rectangle.NO_BORDER); celda2.setBorder(Rectangle.RIGHT); PdfPTable tableFecha = new PdfPTable(2); tableFecha.setWidthPercentage(60); celda3.setHorizontalAlignment(Element.ALIGN_CENTER); celda4.setHorizontalAlignment(Element.ALIGN_CENTER); tabla.addCell(celda1); tabla.addCell(celda2); tableFecha.addCell(celda3); tableFecha.addCell(celda4); Paragraph par2 = new Paragraph(); par2.add(new Phrase(Chunk.NEWLINE)); documento.add(par2); documento.add(tabla); documento.add(tableFecha); } documento.close(); } catch (Exception e) { e.getMessage(); } } finally { out.close(); } }
From source file:Servlets.GenerarPinEstudiante.java
@Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { int idEstudiante = Integer.parseInt(req.getParameter("idEst")); resp.setContentType("application/pdf"); OutputStream out = resp.getOutputStream(); String foto = getServletContext().getRealPath("/recursos/img/logoColegio.png"); req.setCharacterEncoding("UTF-8"); try {/* www.j a v a 2 s . com*/ try { Document documento = new Document(); PdfWriter.getInstance(documento, out); documento.open(); Paragraph par1 = new Paragraph(); Font fontit = new Font(Font.FontFamily.HELVETICA, 16, Font.BOLD, BaseColor.GRAY); par1.add(new Phrase("Pin de Acceso HeartsTics", fontit)); par1.setAlignment(Element.ALIGN_CENTER); par1.add(new Phrase(Chunk.NEWLINE)); par1.add(new Phrase(Chunk.NEWLINE)); documento.add(par1); // Image image = Image.getInstance("E:\\ArchivosVarios\\logoColegio.png"); // image.scalePercent(50); Image image = Image.getInstance(foto); image.scalePercent(60); Font fuentetabla = FontFactory.getFont("Arial", 8, Font.BOLD, BaseColor.BLACK); Font fuentetablaPin = FontFactory.getFont("Arial", 10, Font.BOLD, BaseColor.BLACK); Font fuentetablaHeader = FontFactory.getFont("Arial", 9, Font.BOLD, BaseColor.BLACK); Servicio controlador = new Servicio(); Pin estudiante = controlador.pinEstudiante(idEstudiante); PdfPTable tabla = new PdfPTable(3); tabla.setWidthPercentage(60); PdfPCell celdaHeader = new PdfPCell(new Paragraph("COLEGIO SAGRADOS CORAZONES", fuentetablaHeader)); celdaHeader.setVerticalAlignment(Element.ALIGN_MIDDLE); celdaHeader.setHorizontalAlignment(Element.ALIGN_CENTER); celdaHeader.setColspan(3); tabla.addCell(celdaHeader); PdfPCell celda01 = new PdfPCell(image); //PdfPCell celda01 = new PdfPCell(new Paragraph("imagen")); celda01.setHorizontalAlignment(Element.ALIGN_CENTER); celda01.setVerticalAlignment(Element.ALIGN_MIDDLE); celda01.setRowspan(2); celda01.setBorder(Rectangle.NO_BORDER); celda01.setBorder(Rectangle.LEFT); tabla.addCell(celda01); PdfPCell celda1 = new PdfPCell(new Paragraph( "Estudiante: " + estudiante.getNombres() + " " + estudiante.getApellidos(), fuentetabla)); PdfPCell celda2 = new PdfPCell(new Paragraph("Pin: " + estudiante.getIdPin(), fuentetablaPin)); PdfPCell celda3 = new PdfPCell( new Paragraph("Fecha creacion: " + estudiante.getInicio(), fuentetabla)); PdfPCell celda4 = new PdfPCell( new Paragraph("Fecha vencimiento: " + estudiante.getFin(), fuentetabla)); celda1.setHorizontalAlignment(Element.ALIGN_CENTER); celda1.setVerticalAlignment(Element.ALIGN_MIDDLE); celda1.setColspan(2); celda1.setBorder(Rectangle.NO_BORDER); celda1.setBorder(Rectangle.RIGHT); celda2.setHorizontalAlignment(Element.ALIGN_CENTER); celda2.setVerticalAlignment(Element.ALIGN_MIDDLE); celda2.setColspan(2); celda2.setBorder(Rectangle.NO_BORDER); celda2.setBorder(Rectangle.RIGHT); PdfPTable tableFecha = new PdfPTable(2); tableFecha.setWidthPercentage(60); celda3.setHorizontalAlignment(Element.ALIGN_CENTER); celda4.setHorizontalAlignment(Element.ALIGN_CENTER); tabla.addCell(celda1); tabla.addCell(celda2); tableFecha.addCell(celda3); tableFecha.addCell(celda4); Paragraph par2 = new Paragraph(); par2.add(new Phrase(Chunk.NEWLINE)); documento.add(par2); documento.add(tabla); documento.add(tableFecha); documento.close(); } catch (Exception e) { e.getMessage(); } } finally { out.close(); } }
From source file:sistema.Minuta.java
public void generarMinutaPDF() { Document document = new Document(); try {//from w w w . jav a 2 s .c o m String ruta = "C:\\Users\\Gerardo\\Documents\\Facultad 5E\\Programacin Distribuida\\Programas\\SistemaControl\\minutas\\"; PdfWriter.getInstance(document, new FileOutputStream(ruta + "Minuta_Reunion" + id_reunion + ".pdf")); document.open(); PdfPTable table = new PdfPTable(6); // 3 columns. PdfPCell fecha = new PdfPCell(new Paragraph("Fecha")); PdfPCell nReunion = new PdfPCell(new Paragraph("No. Reunin")); fecha.setColspan(3); nReunion.setColspan(3); table.addCell(fecha); table.addCell(nReunion); PdfPCell cFecha = new PdfPCell(new Paragraph(this.fecha)); PdfPCell cNReunion = new PdfPCell(new Paragraph(id_reunion)); cFecha.setColspan(3); cNReunion.setColspan(3); table.addCell(cFecha); table.addCell(cNReunion); PdfPCell asunto = new PdfPCell(new Paragraph("Asunto:")); PdfPCell cAsunto = new PdfPCell(new Paragraph(this.asunto)); cAsunto.setColspan(5); table.addCell(asunto); table.addCell(cAsunto); PdfPCell lugar = new PdfPCell(new Paragraph("Lugar:")); PdfPCell cLugar = new PdfPCell(new Paragraph(this.lugar)); cLugar.setColspan(5); table.addCell(lugar); table.addCell(cLugar); PdfPCell presidente = new PdfPCell(new Paragraph("Presidente:")); PdfPCell cPresidente = new PdfPCell(new Paragraph(this.presidente)); cPresidente.setColspan(5); table.addCell(presidente); table.addCell(cPresidente); PdfPCell secretario = new PdfPCell(new Paragraph("Secretario:")); PdfPCell cSecretario = new PdfPCell(new Paragraph(this.secretario)); cSecretario.setColspan(5); table.addCell(secretario); table.addCell(cSecretario); PdfPCell ordenDia = new PdfPCell(new Paragraph("Orden del da")); ordenDia.setColspan(6); table.addCell(ordenDia); PdfPCell cOrdenDia = new PdfPCell(new Paragraph(this.ordenDia)); cOrdenDia.setColspan(6); table.addCell(cOrdenDia); PdfPCell detalles = new PdfPCell(new Paragraph("Detalles de la reunin")); detalles.setColspan(6); table.addCell(detalles); PdfPCell cDetalles = new PdfPCell(new Paragraph(this.detalles)); cDetalles.setColspan(6); table.addCell(cDetalles); PdfPCell acuerdos = new PdfPCell(new Paragraph("Acuerdos")); acuerdos.setColspan(6); table.addCell(acuerdos); PdfPCell cAcuerdos = new PdfPCell(new Paragraph(this.acuerdos)); cAcuerdos.setColspan(6); table.addCell(cAcuerdos); PdfPCell proximaReunion = new PdfPCell(new Paragraph("Fecha de la prxima reunin")); PdfPCell cProximaReunion = new PdfPCell(new Paragraph("2015-11-30")); proximaReunion.setColspan(3); cProximaReunion.setColspan(3); table.addCell(proximaReunion); table.addCell(cProximaReunion); PdfPCell participantes = new PdfPCell(new Paragraph("Participantes")); participantes.setColspan(6); table.addCell(participantes); PdfPCell profesor = new PdfPCell(new Paragraph("Nombre del profesor")); PdfPCell asistencia = new PdfPCell(new Paragraph("Asistencia")); PdfPCell firma = new PdfPCell(new Paragraph("Firma")); profesor.setColspan(3); asistencia.setColspan(1); firma.setColspan(2); table.addCell(profesor); table.addCell(asistencia); table.addCell(firma); int i = 0; while (i < this.participantes.length) { PdfPCell nProfesor = new PdfPCell(new Paragraph(this.participantes[i])); PdfPCell nAsistencia = new PdfPCell(new Paragraph("Si")); PdfPCell nFirma = new PdfPCell(new Paragraph(" \n ")); nProfesor.setColspan(3); nAsistencia.setColspan(1); nFirma.setColspan(2); nProfesor.setRowspan(2); nAsistencia.setRowspan(2); nFirma.setRowspan(2); table.addCell(nProfesor); table.addCell(nAsistencia); table.addCell(nFirma); i++; } document.add(table); Paragraph pFirmas = new Paragraph(); pFirmas.setAlignment(Element.ALIGN_CENTER); Chunk firmas = new Chunk("Firmas"); pFirmas.add(firmas); document.add(pFirmas); PdfPTable tCargos = new PdfPTable(8); PdfPCell fPresidente = new PdfPCell(new Paragraph("Presidente")); PdfPCell fSecretario = new PdfPCell(new Paragraph("Secretario")); PdfPCell fespacio = new PdfPCell(new Paragraph(" ")); fPresidente.setColspan(3); fSecretario.setColspan(3); fPresidente.setHorizontalAlignment(Element.ALIGN_CENTER); fSecretario.setHorizontalAlignment(Element.ALIGN_CENTER); fPresidente.setBorder(Rectangle.NO_BORDER); fSecretario.setBorder(Rectangle.NO_BORDER); fespacio.setBorder(Rectangle.NO_BORDER); tCargos.addCell(fespacio); tCargos.addCell(fPresidente); tCargos.addCell(fSecretario); tCargos.addCell(fespacio); document.add(tCargos); PdfPTable tFirmas = new PdfPTable(8); PdfPCell firmaPresidente = new PdfPCell(new Paragraph("_____________________")); PdfPCell firmaSecretario = new PdfPCell(new Paragraph("______________________")); PdfPCell tespacio = new PdfPCell(new Paragraph(" ")); PdfPCell nombrePresidente = new PdfPCell(new Paragraph(this.presidente)); PdfPCell nombreSecretario = new PdfPCell(new Paragraph(this.secretario)); firmaPresidente.setColspan(3); firmaSecretario.setColspan(3); firmaPresidente.setRowspan(3); firmaSecretario.setRowspan(3); tespacio.setColspan(1); nombrePresidente.setColspan(3); nombreSecretario.setColspan(3); firmaPresidente.setHorizontalAlignment(Element.ALIGN_CENTER); firmaSecretario.setHorizontalAlignment(Element.ALIGN_CENTER); firmaPresidente.setVerticalAlignment(Element.ALIGN_BOTTOM); firmaSecretario.setVerticalAlignment(Element.ALIGN_BOTTOM); nombrePresidente.setHorizontalAlignment(Element.ALIGN_CENTER); nombreSecretario.setHorizontalAlignment(Element.ALIGN_CENTER); firmaPresidente.setBorder(Rectangle.NO_BORDER); firmaSecretario.setBorder(Rectangle.NO_BORDER); tespacio.setBorder(Rectangle.NO_BORDER); nombrePresidente.setBorder(Rectangle.NO_BORDER); nombreSecretario.setBorder(Rectangle.NO_BORDER); tFirmas.addCell(tespacio); tFirmas.addCell(firmaPresidente); tFirmas.addCell(firmaSecretario); tFirmas.addCell(tespacio); tFirmas.addCell(tespacio); tFirmas.addCell(tespacio); tFirmas.addCell(tespacio); tFirmas.addCell(tespacio); tFirmas.addCell(tespacio); tFirmas.addCell(nombrePresidente); tFirmas.addCell(nombreSecretario); tFirmas.addCell(tespacio); document.add(tFirmas); document.close(); } catch (DocumentException e) { e.printStackTrace(); } catch (FileNotFoundException e) { e.printStackTrace(); } }
From source file:tn.com.hitechart.eds.Util.pdfRpport.FirstPdf.java
private void createTable(Section subCatPart) throws BadElementException { //-------------------------- TAB POINTAGE -------------------// PdfPTable table = new PdfPTable(8); table.setTotalWidth(PageSize.A4.rotate().getWidth() - 10); table.setLockedWidth(true);//from w w w .j a va2 s .c om // t.setBorderColor(BaseColor.GRAY); // t.setPadding(4); // t.setSpacing(4); // t.setBorderWidth(1); //----------- C1 --------------// PdfPCell c1 = new PdfPCell(new Phrase("Date Rapport")); c1.setHorizontalAlignment(Element.ALIGN_CENTER); c1.setBorder(Rectangle.NO_BORDER); table.addCell(c1); //----------- C2 --------------// c1 = new PdfPCell(new Phrase("Technicien")); c1.setHorizontalAlignment(Element.ALIGN_CENTER); c1.setBorder(Rectangle.NO_BORDER); table.addCell(c1); //----------- C3 --------------// c1 = new PdfPCell(new Phrase("Poinatge")); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); //----------- C4 --------------// c1 = new PdfPCell(new Phrase("Matin")); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); //----------- C5 --------------// c1 = new PdfPCell(new Phrase("Aprs-Midi")); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); //----------- C6 --------------// c1 = new PdfPCell(new Phrase("Rapport Journalier", catFont)); c1.setBorder(Rectangle.NO_BORDER); c1.setHorizontalAlignment(Element.ALIGN_CENTER); c1.setColspan(3); table.addCell(c1); //----------- C7 --------------// //----------- C8 --------------// table.setHeaderRows(1); //----------- R2 --------------// //----------- C1 --------------// c1 = new PdfPCell(new Phrase(tabDatapointage[0], dataFont)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); c1.setRowspan(2); table.addCell(c1); c1 = new PdfPCell(new Phrase(user.getLogin(), dataFont)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); c1.setRowspan(2); table.addCell(c1); c1 = new PdfPCell(new Phrase("Arrive")); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase(tabDatapointage[1], dataFont)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase(tabDatapointage[2], dataFont)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("")); c1.setBorder(Rectangle.NO_BORDER); table.addCell(c1); //----------- C7 --------------// c1 = new PdfPCell(new Phrase("")); c1.setBorder(Rectangle.NO_BORDER); table.addCell(c1); //----------- C8 --------------// c1 = new PdfPCell(new Phrase("")); c1.setBorder(Rectangle.NO_BORDER); table.addCell(c1); //----------- R3 --------------// c1 = new PdfPCell(new Phrase("Sortie")); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase(tabDatapointage[3], dataFont)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase(tabDatapointage[4], dataFont)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("")); c1.setBorder(Rectangle.NO_BORDER); table.addCell(c1); //----------- C7 --------------// c1 = new PdfPCell(new Phrase("")); c1.setBorder(Rectangle.NO_BORDER); table.addCell(c1); //----------- C8 --------------// c1 = new PdfPCell(new Phrase("")); c1.setBorder(Rectangle.NO_BORDER); table.addCell(c1); table.setSpacingAfter(10); subCatPart.add(table); //-------------------------- END TAB POINTAGE -------------------// // TODO: 20/01/2017 //--------------------------------- TASK ---------------------// PdfPTable tableTask = new PdfPTable(5); tableTask.setTotalWidth(PageSize.A4.rotate().getWidth() - 10); tableTask.setLockedWidth(true); PdfPCell c2 = new PdfPCell(new Phrase("Dossiers Traits", catFont)); c2.setHorizontalAlignment(Element.ALIGN_CENTER); c2.setColspan(5); c2.setBorder(Rectangle.NO_BORDER); tableTask.addCell(c2); tableTask.setHeaderRows(1); c2 = new PdfPCell(new Phrase("NDoss.", dataFont)); c2.setHorizontalAlignment(Element.ALIGN_CENTER); tableTask.addCell(c2); c2 = new PdfPCell(new Phrase("Client", dataFont)); c2.setHorizontalAlignment(Element.ALIGN_CENTER); tableTask.addCell(c2); c2 = new PdfPCell(new Phrase("Dure", dataFont)); c2.setHorizontalAlignment(Element.ALIGN_CENTER); tableTask.addCell(c2); c2 = new PdfPCell(new Phrase("Mission", dataFont)); c2.setHorizontalAlignment(Element.ALIGN_CENTER); tableTask.addCell(c2); c2 = new PdfPCell(new Phrase("Resultat", dataFont)); c2.setHorizontalAlignment(Element.ALIGN_CENTER); tableTask.addCell(c2); if (tasks.isEmpty()) { c2 = new PdfPCell(new Phrase("Aucune Tache a t trait", catFontempty)); c2.setHorizontalAlignment(Element.ALIGN_CENTER); c2.setColspan(5); tableTask.addCell(c2); } else { if (!dossiers.isEmpty()) { for (Dossier d : dossiers) { tableTask.addCell(d.getNumDoss()); tableTask.addCell(d.getClient()); tableTask.addCell(convertLongtoDurationfr(d.getTimeDuration())); tableTask.addCell(td.getTaskById(d.get_idTask()).getType()); tableTask.addCell(td.getTaskById(d.get_idTask()).getRes()); } } } tableTask.setSpacingAfter(10); subCatPart.add(tableTask); //-------------------------- END TAB TASK -------------------// // TODO: 20/01/2017 tab achat //-------------------------- TAB ACHAT -------------------// PdfPTable tableAchat = new PdfPTable(3); tableAchat.setTotalWidth(PageSize.A4.rotate().getWidth() - 10); tableAchat.setLockedWidth(true); PdfPCell c3 = new PdfPCell(new Phrase("Frais Engags", catFont)); c3.setHorizontalAlignment(Element.ALIGN_CENTER); c3.setColspan(3); c3.setBorder(Rectangle.NO_BORDER); tableAchat.addCell(c3); tableAchat.setHeaderRows(1); c3 = new PdfPCell(new Phrase("N.Doss.", dataFont)); c3.setHorizontalAlignment(Element.ALIGN_CENTER); tableAchat.addCell(c3); c3 = new PdfPCell(new Phrase("Dsignation", dataFont)); c3.setHorizontalAlignment(Element.ALIGN_CENTER); tableAchat.addCell(c3); c3 = new PdfPCell(new Phrase("Montant TCC", dataFont)); c3.setHorizontalAlignment(Element.ALIGN_CENTER); tableAchat.addCell(c3); if (achats.isEmpty()) { c3 = new PdfPCell(new Phrase("la liste des achats est vide", catFontempty)); c3.setHorizontalAlignment(Element.ALIGN_CENTER); c3.setColspan(3); tableAchat.addCell(c3); } else { for (Achat achat : achats) { tableAchat.addCell(String.valueOf(achat.getNumDoss())); tableAchat.addCell(achat.getDesignation()); tableAchat.addCell(String.valueOf(achat.getPrix())); } } tableAchat.setSpacingAfter(10); subCatPart.add(tableAchat); //-------------------------- END TAB ACHAT -------------------// // TODO: 20/01/2017 tab composant //-------------------------- TAB COMPOSANT -------------------// PdfPTable tableComp = new PdfPTable(3); tableComp.setTotalWidth(PageSize.A4.rotate().getWidth() - 10); tableComp.setLockedWidth(true); PdfPCell c4 = new PdfPCell(new Phrase("Composants", catFont)); c4.setHorizontalAlignment(Element.ALIGN_CENTER); c4.setColspan(3); c4.setBorder(Rectangle.NO_BORDER); tableComp.addCell(c4); tableComp.setHeaderRows(1); c4 = new PdfPCell(new Phrase("N.Doss.", dataFont)); c4.setHorizontalAlignment(Element.ALIGN_CENTER); tableComp.addCell(c4); c4 = new PdfPCell(new Phrase("Dsignation", dataFont)); c4.setHorizontalAlignment(Element.ALIGN_CENTER); tableComp.addCell(c4); c4 = new PdfPCell(new Phrase("Quantit", dataFont)); c4.setHorizontalAlignment(Element.ALIGN_CENTER); tableComp.addCell(c4); if (comps.isEmpty()) { c4 = new PdfPCell(new Phrase("la liste des composants est vide", catFontempty)); c4.setHorizontalAlignment(Element.ALIGN_CENTER); c4.setColspan(3); tableComp.addCell(c4); } else { for (Composant comp : comps) { tableComp.addCell(String.valueOf(comp.getNumDoss())); tableComp.addCell(comp.getName()); tableComp.addCell(String.valueOf(comp.getQte())); } } tableComp.setSpacingAfter(10); subCatPart.add(tableComp); //-------------------------- END TAB COMPOSANT -------------------// // TODO: 20/01/2017 tab message //-------------------------- TAB MESSAGE -------------------// PdfPTable tableMsg = new PdfPTable(2); tableMsg.setTotalWidth(PageSize.A4.rotate().getWidth() - 10); tableMsg.setLockedWidth(true); PdfPCell c5 = new PdfPCell(new Phrase("Message Transmettre", catFont)); c5.setHorizontalAlignment(Element.ALIGN_CENTER); c5.setColspan(3); c5.setBorder(Rectangle.NO_BORDER); tableMsg.addCell(c5); c5 = new PdfPCell(new Phrase("N.Doss.", dataFont)); c5.setHorizontalAlignment(Element.ALIGN_CENTER); tableMsg.addCell(c5); tableMsg.setHeaderRows(1); c5 = new PdfPCell(new Phrase("Message", dataFont)); c5.setHorizontalAlignment(Element.ALIGN_CENTER); tableMsg.addCell(c5); tableMsg.setHeaderRows(1); if (msgs.isEmpty()) { c5 = new PdfPCell(new Phrase("Aucun message", catFontempty)); c5.setHorizontalAlignment(Element.ALIGN_CENTER); c5.setColspan(3); tableMsg.addCell(c5); } else { for (Message msg : msgs) { tableMsg.addCell(String.valueOf(msg.getNumDoss())); tableMsg.addCell(msg.getMsg()); } } tableMsg.setSpacingAfter(10); subCatPart.add(tableMsg); //-------------------------- END TAB MESSAGE -------------------// // TODO: 20/01/2017 tab Activitee //-------------------------- TAB ACTIVITEE -------------------// PdfPTable tableAct = new PdfPTable(2); tableAct.setTotalWidth(PageSize.A4.rotate().getWidth() - 10); tableAct.setLockedWidth(true); PdfPCell c6 = new PdfPCell(new Phrase("Autre Activites", catFont)); c6.setHorizontalAlignment(Element.ALIGN_CENTER); c6.setColspan(2); c6.setBorder(Rectangle.NO_BORDER); tableAct.addCell(c6); tableAct.setHeaderRows(1); c6 = new PdfPCell(new Phrase("N.Doss.", dataFont)); c6.setHorizontalAlignment(Element.ALIGN_CENTER); tableAct.addCell(c6); c6 = new PdfPCell(new Phrase("Dure", dataFont)); c6.setHorizontalAlignment(Element.ALIGN_CENTER); tableAct.addCell(c6); if (autreActs.isEmpty()) { c6 = new PdfPCell(new Phrase("Aucune autre Activite a t effectu", catFontempty)); c6.setHorizontalAlignment(Element.ALIGN_CENTER); c6.setColspan(3); tableAct.addCell(c6); } else { for (Task autreA : autreActs) { tableAct.addCell(String.valueOf(autreA.getType())); tableAct.addCell(autreA.getNumDoss()); } } tableAct.setSpacingAfter(10); subCatPart.add(tableAct); //-------------------------- END TAB MESSAGE -------------------// }