| | |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setColspan(3); |
| | | table.addCell(cell); |
| | | }else { |
| | | PdfPCell cell = new PdfPCell(); |
| | | // 水平、垂直居中 |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | cell.setPhrase(new Phrase("检查所见:", textFont)); |
| | | // 设置无边框 |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setColspan(3); |
| | | table.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | // 水平、垂直居中 |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | cell.setPhrase(new Phrase(tjPdfVO.getProResult(), textFont)); |
| | | // 设置无边框 |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setColspan(3); |
| | | table.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | // 水平、垂直居中 |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | cell.setPhrase(new Phrase("结论:", textFont)); |
| | | // 设置无边框 |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setColspan(3); |
| | | table.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | // 水平、垂直居中 |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | cell.setPhrase(new Phrase(tjPdfVO.getProResult(), textFont)); |
| | | // 设置无边框 |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setColspan(3); |
| | | table.addCell(cell); |
| | | } |
| | | } |
| | | return table; |
| | |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public static PdfPTable setTable2(Font headFont, Font textFont, String[] title, List<TjPdfVO> list,boolean flag) { |
| | | public static PdfPTable setTable2(Font headFont, Font textFont, String[] title, List<TjPdfVO> list,boolean flag,float[] titleWidth) { |
| | | //四列 |
| | | PdfPTable table = createTable(new float[]{240, 240,240}); |
| | | PdfPTable table = createTable(titleWidth); |
| | | // PdfPTable table = createTable(new float[]{240, 240,240}); |
| | | //画标题 |
| | | for (String head : title) { |
| | | table.addCell(createCell(head, headFont)); |
| | |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | cell.setPhrase(new Phrase(tjPdfVO.getTs(), textFont)); |
| | | // 设置无边框 |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setColspan(3); |
| | | table.addCell(cell); |
| | | }else { |
| | | PdfPCell cell = new PdfPCell(); |
| | | // 水平、垂直居中 |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | cell.setPhrase(new Phrase("检查所见:", textFont)); |
| | | // 设置无边框 |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setColspan(3); |
| | | table.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | // 水平、垂直居中 |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | cell.setPhrase(new Phrase(tjPdfVO.getProResult(), textFont)); |
| | | // 设置无边框 |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setColspan(3); |
| | | table.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | // 水平、垂直居中 |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | cell.setPhrase(new Phrase("结论:", textFont)); |
| | | // 设置无边框 |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setColspan(3); |
| | | table.addCell(cell); |
| | | |
| | | cell = new PdfPCell(); |
| | | // 水平、垂直居中 |
| | | cell.setVerticalAlignment(Element.ALIGN_MIDDLE); |
| | | cell.setHorizontalAlignment(Element.ALIGN_LEFT); |
| | | cell.setPhrase(new Phrase(tjPdfVO.getProResult(), textFont)); |
| | | // 设置无边框 |
| | | cell.setBorder(Rectangle.NO_BORDER); |
| | | cell.setColspan(3); |