| | |
| | | DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd"); |
| | | document.addHeader("标题","标题"); |
| | | EmpBaseInfo empBaseInfo = empBaseInfoList.get(0); |
| | | PdfPTable workheadtable = createTable(workheadlength); |
| | | PdfPTable empPhysicalheadtable = createTable(empPhysicalheadlength); |
| | | PdfPTable empContractInfotable = createTable(empContractInfolength); |
| | | PdfPTable empJobChangetable = createTable(empJobChangelength); |
| | | PdfPTable leaveInfotable = createTable(leaveInfolength); |
| | | PdfPTable resigntable = createTable(resignlength); |
| | | PdfPTable dimissionAttendtable = createTable(dimissionAttendlength); |
| | | PdfPTable dimissionLogtable = createTable(dimissionLoglength); |
| | | PdfPTable unemploymenttable = createTable(unemploymentlength); |
| | | PdfPTable insurancetable = createTable(insurancelength); |
| | | PdfPTable accidentCasestable = createTable(accidentCaseslength); |
| | | float[] ls={1.0f,3.0f,3.0f,3.0f,3.0f}; |
| | | PdfPTable workheadtable = createTable(ls); |
| | | PdfPTable empPhysicalheadtable = createTable(new float[]{1.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f}); |
| | | PdfPTable empContractInfotable = createTable(new float[]{1.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f}); |
| | | PdfPTable empJobChangetable = createTable(new float[]{1.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f}); |
| | | PdfPTable leaveInfotable = createTable(new float[]{1.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f}); |
| | | PdfPTable resigntable = createTable(new float[]{1.0f,3.0f,3.0f,3.0f,3.0f}); |
| | | PdfPTable dimissionAttendtable = createTable(new float[]{1.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f}); |
| | | PdfPTable dimissionLogtable = createTable(new float[]{1.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f}); |
| | | PdfPTable unemploymenttable = createTable(new float[]{1.0f,3.0f,3.0f,3.0f,3.0f,3.0f}); |
| | | PdfPTable insurancetable = createTable(new float[]{1.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f}); |
| | | PdfPTable accidentCasestable = createTable(new float[]{2.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f}); |
| | | PdfPTable occtable = createTable(occupationallength); |
| | | PdfPTable laborTroubletable = createTable(laborTroublelength); |
| | | PdfPTable badRecordtable = createTable(badRecordlength); |
| | | PdfPTable remarkInfotable = createTable(remarkInfolength); |
| | | PdfPTable laborTroubletable = createTable(new float[]{1.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f,3.0f}); |
| | | PdfPTable badRecordtable = createTable(new float[]{1.0f,3.0f,3.0f,3.0f,3.0f}); |
| | | PdfPTable remarkInfotable = createTable(new float[]{1.0f,3.0f,3.0f}); |
| | | Object[][] basicDatas = { |
| | | {"编号",empBaseInfo.getEmpNumb(), |
| | | "姓名",empBaseInfo.getEmpName(), |
| | |
| | | cell1.setPhrase(para); |
| | | table1.addCell(cell1); |
| | | Image img =null; |
| | | String image="http://120.24.23.155:8301/hr/empBaseInfo/image/"+empBaseInfo.getEmpId()+""; |
| | | try { |
| | | img = Image.getInstance("http://120.24.23.155:8301/hr/empBaseInfo/image/"+empBaseInfo.getEmpId()+""); |
| | | img = Image.getInstance(image); |
| | | } catch (BadElementException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | img.setAlignment(Element.ALIGN_LEFT); |
| | | img.scaleAbsolute(120,125); |
| | | if(img!=null){ |
| | | img.setAlignment(Element.ALIGN_LEFT); |
| | | img.scaleAbsolute(120,125); |
| | | } |
| | | |
| | | // 每个cell的宽度 |
| | | float[] widthss = {400, 400, 400, 400,400, 400}; |
| | | // 创建一个表格,每一行有四个cell |
| | | PdfPTable basicTable = new PdfPTable(widthss); |
| | | basicTable.addCell(createCell("基本信息:", keyfont, Element.ALIGN_LEFT,basicDatas.length, false)); |
| | | |
| | | basicTable.addCell(createCell("档案号:"+empBaseInfo.getArchivesNumb()==null?"":empBaseInfo.getArchivesNumb(), keyfont, Element.ALIGN_RIGHT,basicDatas.length, false)); |
| | | basicTable.addCell(createCell("档案号:"+empBaseInfo.getArchivesNumb(), keyfont, Element.ALIGN_RIGHT,basicDatas.length, false)); |
| | | // 添加备注,靠左,不显示边框 |
| | | // 外层循环表格的行 |
| | | for (int i = 0; i < basicDatas.length; i++) { |
| | |
| | | } |
| | | try { |
| | | document.add(table1); |
| | | document.add(img); |
| | | if(img!=null){ |
| | | document.add(img); |
| | | } |
| | | // 将表格添加到文档中 |
| | | document.add(basicTable); |
| | | document.add(workheadtable); |