const getSheet4 = (wbook, sheetname) => { // 4/4 탭 sheetname = sheetname; let tSumRow = 35; let workSheet = wbook.addWorksheet(sheetname, { pageSetup: { paperSize: 8, fitToPage: true, horizontalCentered: true, orientation: "landscape", margins: { left: 0.28, right: 0.28, top: 0.88, bottom: 0.64, header: 0.48, footer: 0.52, }, }, properties: { defaultRowHeight: 30 }, }); workSheet.columns = [ { width: 3.0, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 24.0, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 8.0, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 16.5, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 16.5, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 16.5, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 16.5, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 16.5, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 16.5, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 16.5, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 13.5, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 13.4, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 13.4, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 13.4, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 13.4, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 13.4, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 13.4, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 13.4, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 13.4, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 13.4, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 13.4, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 8.0, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 13.4, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 13.4, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 13.4, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, { width: 13.4, style: { alignment: { vertical: "middle", horizontal: "left" } }, }, ]; nRow = workSheet.getRow(1); nRow.height = 150; nCell = nRow.getCell("A"); nCell.value = "Dimension Inspection Record"; nCell.font = titleFont; nCell.border = myBorder.aroundMedium; nCell.alignment = mystyle.algCenter; workSheet.mergeCells("A1:T1"); nRow = workSheet.getRow(1); nRow.height = 150; nCell = nRow.getCell("U"); nCell.font = lfont; nCell.value = "Page"; nCell.border = myBorder.aroundMedium; nCell.alignment = mystyle.algCenter; workSheet.mergeCells("U1:V1"); nRow = workSheet.getRow(1); nRow.height = 150; nCell = nRow.getCell("W"); nCell.font = lfont; nCell.value = "4 OF 4"; nCell.border = myBorder.aroundMedium; nCell.alignment = mystyle.algCenter; workSheet.mergeCells("W1:Y1"); nRow = workSheet.getRow(2); nRow.height = 40; nCell = nRow.getCell("A"); nCell.font = lfont; nCell.value = " Cutomer"; nCell.border = myBorder.mediumB4; nCell.alignment = mystyle.algLeft; workSheet.mergeCells("A2:G2"); nRow = workSheet.getRow(2); nCell = nRow.getCell("H"); nRow.height = 40; nCell.font = lfont; nCell.value = " Blat Industry"; nCell.border = myBorder.mediumB2; nCell.alignment = mystyle.algLeft; workSheet.mergeCells("H2:N2"); nRow = workSheet.getRow(2); nCell = nRow.getCell("O"); nRow.height = 40; nCell.font = lfont; nCell.value = " Record No."; nCell.border = myBorder.aroundMedium; nCell.alignment = mystyle.algLeft; workSheet.mergeCells("O2:S2"); nRow = workSheet.getRow(2); nCell = nRow.getCell("T"); nRow.height = 40; nCell.font = lfont; nCell.value = " 220706-19001-549~552"; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.aroundMedium; workSheet.mergeCells("T2:Y2"); nRow = workSheet.getRow(3); nRow.height = 40; nCell = nRow.getCell("A"); nCell.font = lfont; nCell.value = " DWG No."; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.mediumB4; nCell.alignment = mystyle.algLeft; workSheet.mergeCells("A3:G3"); nRow = workSheet.getRow(3); nCell = nRow.getCell("H"); nRow.height = 40; nCell.font = lfont; nCell.value = " 293-111BW Rev.07"; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.mediumB2; nCell.alignment = mystyle.algLeft; workSheet.mergeCells("H3:N3"); nRow = workSheet.getRow(3); nCell = nRow.getCell("O"); nRow.height = 40; nCell.font = lfont; nCell.value = " Date"; nCell.border = myBorder.aroundMedium; nCell.alignment = mystyle.algLeft; workSheet.mergeCells("O3:S3"); nRow = workSheet.getRow(3); nCell = nRow.getCell("T"); nRow.height = 40; nCell.font = lfont; nCell.value = " 2023.06. ."; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.aroundMedium; nCell.alignment = mystyle.algLeft; workSheet.mergeCells("T3:Y3"); nRow = workSheet.getRow(4); nRow.height = 40; nCell = nRow.getCell("A"); nCell.font = lfont; nCell.value = " PO No."; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.mediumB4; nCell.alignment = mystyle.algLeft; workSheet.mergeCells("A4:G4"); nRow = workSheet.getRow(4); nCell = nRow.getCell("H"); nRow.height = 40; nCell.font = lfont; nCell.value = " -"; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.mediumB2; nCell.alignment = mystyle.algLeft; workSheet.mergeCells("H4:N4"); nRow = workSheet.getRow(4); nCell = nRow.getCell("O"); nRow.height = 40; nCell.font = lfont; nCell.value = " Material"; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.aroundMedium; workSheet.mergeCells("O4:S4"); nRow = workSheet.getRow(4); nCell = nRow.getCell("T"); nRow.height = 40; nCell.font = lfont; nCell.value = " S355NL"; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.aroundMedium; workSheet.mergeCells("T4:Y4"); nRow = workSheet.getRow(5); nRow.height = 40; nCell = nRow.getCell("A"); nCell.font = lfont; nCell.value = " Item"; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.mediumB4; nCell.alignment = mystyle.algLeft; workSheet.mergeCells("A5:G5"); nRow = workSheet.getRow(5); nCell = nRow.getCell("H"); nRow.height = 40; nCell.font = lfont; nCell.value = " WIND FLANGE"; nCell.border = myBorder.mediumB2; workSheet.mergeCells("H5:N5"); nRow = workSheet.getRow(5); nCell = nRow.getCell("O"); nRow.height = 40; nCell.font = lfont; nCell.value = " Size"; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.aroundMedium; workSheet.mergeCells("O5:S5"); nRow = workSheet.getRow(5); nCell = nRow.getCell("T"); nRow.height = 40; nCell.font = lfont; nCell.value = " 7832.00 x 6620.00 x 341.00"; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.aroundMedium; workSheet.mergeCells("T5:Y5"); nRow = workSheet.getRow(6); nRow.height = 40; nCell = nRow.getCell("A"); nCell.font = lfont; nCell.value = " Result"; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.mediumB4; workSheet.mergeCells("A6:G6"); nRow = workSheet.getRow(6); nCell = nRow.getCell("H"); nRow.height = 40; nCell.font = lfont; nCell.value = " □Satifactory □Unsatifactory"; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.mediumB2; workSheet.mergeCells("H6:N6"); nRow = workSheet.getRow(6); nCell = nRow.getCell("O"); nRow.height = 40; nCell.font = lfont; nCell.value = " Q´TY"; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.aroundMedium; workSheet.mergeCells("O6:S6"); nRow = workSheet.getRow(6); nCell = nRow.getCell("T"); nRow.height = 40; nCell.font = lfont; nCell.value = " 4EA"; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.aroundMedium; workSheet.mergeCells("T6:Y6"); nRow = workSheet.getRow(7); nCell = nRow.getCell("A"); nRow.height = 60; nCell.font = lfontB; nCell.value = " CHECKED BY ----------"; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.boxBottom; workSheet.mergeCells("A7:J7"); nRow = workSheet.getRow(7); nCell = nRow.getCell("K"); nRow.height = 60; nCell.font = lfontB; nCell.value = " REVIEWED BY ----------"; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.boxBottom; workSheet.mergeCells("K7:R7"); nRow = workSheet.getRow(7); nCell = nRow.getCell("S"); nRow.height = 60; nCell.font = lfontB; nCell.value = " APPROVED BY ----------"; nCell.alignment = mystyle.algLeft; nCell.border = myBorder.boxBottom; workSheet.mergeCells("S7:Y7"); const columns1 = [ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", ]; const rows1 = [8, 9, 10, 11, 12, 13, 14, 15, 16, 17]; const columnValues1 = { A: [ "Position", "Position", "Position", "", "Norminal", "Tolerance", "Tolerance", "⋇1 Measuring\r\n Instrument", "Offset", "Unit of measure", ], B: [ "Position", "Position", "Position", "", "Norminal", "Tolerance", "Tolerance", "Measuring\r\nInstrument", "Offset", "Unit of measure", ], C: ["선\r\n행\r\n공\r\n정\r\n확\r\n인", "", "", "", "", "", "", "", "", ""], D: [ "탭 Tap(SIDE)", "첫 드릴 사용\r\n(First drill for tapping)", "밑구멍 \r\n Drilling", "Start/End", "", "+0.2\r\n-0.0", "", "", "", "millimeter", ], E: [ "탭 Tap(SIDE)", "첫 드릴 사용\r\n(First drill for tapping)", "밑구멍깊이 \r\n Drill DP", "", "", "+0.5\r\n-0.5", "", "", "", "millimeter", ], F: [ "탭 Tap(SIDE)", "첫 드릴 사용\r\n(First drill for tapping)", "게이지\r\n Gauge", "Start/End", "", "", "", "", "", "millimeter", ], G: [ "탭 Tap(SIDE)", "첫 드릴 사용\r\n(First drill for tapping)", "탭깊이\r\n Tab Depth", "Start/End", "", "+0.5\r\n-0.0", "", "", "", "millimeter", ], H: [ "탭 Tap(SIDE)", "첫 드릴 사용\r\n(First drill for tapping)", "탭 높이 \r\n Tab high", "", "", "+0.5\r\n-0.5", "", "", "", "millimeter", ], I: [ "탭 Tap(SIDE)", "첫 드릴 사용\r\n(First drill for tapping)", "탭 높이 \r\n Tab high", "", "", "+0.5\r\n-0.5", "", "", "", "millimeter", ], J: [ "탭 Tap(SIDE)", "첫 드릴 사용\r\n(First drill for tapping)", "탭 거리 \r\n locatio", "", "", "+0.5\r\n-0.5", "", "", "", "millimeter", ], K: [ "탭 Tap(SIDE)", "첫 드릴 사용\r\n(First drill for tapping)", "탭 거리 \r\n locatio", "200", "", "", "", "", "", "millimeter", ], L: [ "탭 Tap(SIDE)", "첫 드릴 사용\r\n(First drill for tapping)", "탭 거리 \r\n locatio", "3223", "", "", "", "", "", "millimeter", ], M: [ "탭 Tap(SIDE)", "첫 드릴 사용\r\n(First drill for tapping)", "탭 거리 \r\n locatio", "200", "", "", "", "", "", "millimeter", ], N: [ "탭 Tap(SIDE)", "첫 드릴 사용\r\n(First drill for tapping)", "탭 거리 \r\n locatio", "3135", "", "", "", "", "", "millimeter", ], O: [ "탭 Tap(SIDE)", "첫 드릴 사용\r\n(First drill for tapping)", "탭 거리 \r\n locatio", "200", "", "", "", "", "", "millimeter", ], P: [ "탭 Tap(SIDE)", "첫 드릴 사용\r\n(First drill for tapping)", "탭 거리 \r\n locatio", "3135", "", "", "", "", "", "millimeter", ], Q: [ "탭 Tap(SIDE)", "첫 드릴 사용\r\n(First drill for tapping)", "", "", "", "", "", "", "", "", ], R: [ "탭 Tap(SIDE)", "첫 드릴 사용\r\n(First drill for tapping)", "", "", "", "", "", "", "", "", ], T: [ "Assembly Mark", "깊이", "", "", "", "+0.5\r\n-0.5", "+0.5\r\n-0.5", "", "", "millimeter", ], S: [ "Assembly Mark", "크기", "", "", "", "+0.5\r\n-0.5", "+0.5\r\n-0.5", "", "", "millimeter", ], U: ["", "", "", "", "", "", "", "", "", ""], V: ["", "", "", "", "", "", "", "", "", ""], W: ["", "", "", "", "", "", "", "", "", ""], X: ["", "", "", "", "", "", "", "", "", ""], Y: ["", "", "", "", "", "", "", "", "", ""], }; for (const column of columns1) { for (let i = 0; i < rows1.length; i++) { const nRow = workSheet.getRow(rows1[i]); const nCell = nRow.getCell(column); { nCell.font = lfont; nCell.value = columnValues1[column][i]; nCell.alignment = mystyle.algCenter; nRow.height = 38; nCell.border = myBorder.aroundMedium; } } } workSheet.mergeCells("A8:B11"); for (let row = 8; row <= 11; row++) { const nRow8 = workSheet.getRow(row); nRow8.height = 50; const nCell = nRow8.getCell("A"); nCell.font = lfont; } workSheet.mergeCells("A12:B12"); const nRow12 = workSheet.getRow(12); nRow12.height = 25; nCell = nRow12.getCell("A"); nCell.font = lfont; nCell.alignment = mystyle.algLeft; workSheet.mergeCells("A13:B14"); const nRow13 = workSheet.getRow(13); nCell = nRow13.getCell("A"); nCell.font = lfont; nCell.alignment = mystyle.algLeft; workSheet.mergeCells("A15:B15"); const nRow15 = workSheet.getRow(15); nRow15.height = 45; nCell = nRow15.getCell("A"); nCell.font = lfont; nCell.alignment = mystyle.algLeft; workSheet.mergeCells("A16:B16"); const nRow16 = workSheet.getRow(16); nRow16.height = 25; nCell = nRow16.getCell("A"); nCell.font = lfont; nCell.alignment = mystyle.algLeft; workSheet.mergeCells("A17:B17"); const nRow17 = workSheet.getRow(17); nRow17.height = 25; nCell = nRow17.getCell("A"); nCell.font = lfont; nCell.alignment = mystyle.algLeft; workSheet.mergeCells("C8:C17"); nRow8 = workSheet.getRow(8); nCell = nRow8.getCell("C"); nCell.font = lfont; workSheet.mergeCells("D8:R8"); workSheet.mergeCells("D9:R9"); workSheet.mergeCells("K10:P10"); workSheet.mergeCells("S8:T8"); const mergeRanges = [ "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", ]; for (const range of mergeRanges) { workSheet.mergeCells(`${range}13:${range}14`); } nRow = workSheet.getRow(18); nCell = nRow.getCell("A"); nRow.height = 25; nCell.value = "Actual value"; nCell.font = lfont; nCell.border = { top: { style: "double" } }; nCell.alignment = mystyle.algCenter; workSheet.mergeCells("A18:Y18"); drawArchive = (ws, start, title) => { const columns = [ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", ]; let row = null, cell = null; columns.forEach((column, idx) => { for (let a = 0; a < 4; a++) { row = ws.getRow(start + a); cell = row.getCell(column); cell.border = myBorder.aroundThin; row.height = 38; switch (idx) { case 0: cell.value = "I\r\nT\r\nE\r\nM\r\n\r\nN\r\nO"; cell.font = lifontSum; cell.alignment = mystyle.algCenter; break; case 1: cell.value = title; cell.font = lfontB; cell.alignment = mystyle.algCenter; break; } } switch (idx) { case 0: case 1: case 2: case 18: case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26: ws.mergeCells(`${column}${start}:${column}${start + 3}`); break; case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 14: case 15: case 16: case 17: ws.mergeCells(`${column}${start}:${column}${start + 1}`); } switch (idx) { case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 14: case 15: case 16: case 17: ws.mergeCells(`${column}${start + 2}:${column}${start + 3}`); break; } fnBorder(ws, idx + 1, start, idx + 1, start + 3); }); fnBorder(ws, 1, start, columns.length, start + 3); }; drawArchive(workSheet, 19, "549#1"); // drawArchive( workSheet, 23, '549#2' ); nRow = workSheet.getRow(23); nCell = nRow.getCell("A"); nCell.value = "note: \r\n⋇1:VC:Vernier Calipers MT:Measuring Tape OM: Outside Micrometer G: Goniometer TI:Tubular Inside micrometer MC:Machining Check TP:Template CY:CYlider gauge\r\n R:Radius gauge RO:ROughness gauge P:Perpher gauge DM:Depth Micrometer D:Dial gauge T:Tap bolt TP:Tb bolt RG:RouGhness tester \r\n ⋇2:Gauge1 :개선부 형상 측정용 gauge (Gauge for checking shape of welding) Gauge2 :Alignment marking 측정용 gauge(Gauge for checking the location of alignment marking ) \r\n ⋇3 The geometrical tolerances and the surpace roughness are fulfilled in accordance with EN 1090-2 (Para 6.6.2,6.6.3)"; nCell.border = myBorder.aroundMedium; nCell.alignment = mystyle.algCenter; nRow.height = 98; nCell.font = lifont4; workSheet.mergeCells("A23:Z23"); return workSheet; };