| @@ -567,8 +567,7 @@ open class ReportService { | |||||
| project: Project, | project: Project, | ||||
| templatePath: String | templatePath: String | ||||
| ):Workbook{ | ):Workbook{ | ||||
| project | |||||
| val resource = ClassPathResource(templatePath) | val resource = ClassPathResource(templatePath) | ||||
| val templateInputStream = resource.inputStream | val templateInputStream = resource.inputStream | ||||
| val workbook: Workbook = XSSFWorkbook(templateInputStream) | val workbook: Workbook = XSSFWorkbook(templateInputStream) | ||||
| @@ -578,6 +577,19 @@ open class ReportService { | |||||
| val formattedToday = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd")) | val formattedToday = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd")) | ||||
| val dateCell = sheet.getRow(1)?.getCell(2) ?: sheet.getRow(1).createCell(2) | val dateCell = sheet.getRow(1)?.getCell(2) ?: sheet.getRow(1).createCell(2) | ||||
| dateCell.setCellValue(formattedToday) | dateCell.setCellValue(formattedToday) | ||||
| // Start populating project data starting at row 7 | |||||
| val startRow = 6 // 0-based index for row 7 | |||||
| val projectDataRow = sheet.createRow(startRow) | |||||
| // Populate the row with project data | |||||
| projectDataRow.createCell(1).setCellValue(project.code) // Column B | |||||
| projectDataRow.createCell(2).setCellValue(project.name) // Column C | |||||
| projectDataRow.createCell(3).setCellValue(project.teamLead?.name) // Column D | |||||
| projectDataRow.createCell(4).setCellValue(project.custLeadName) // Column E | |||||
| projectDataRow.createCell(5).setCellValue( | |||||
| project.planStart?.format(DateTimeFormatter.ofPattern("yyyy/MM/dd")) ?: "N/A" // Column F | |||||
| ) | |||||
| // Styling for cell A1: Font size 16 and bold | // Styling for cell A1: Font size 16 and bold | ||||
| val headerFont = workbook.createFont().apply { | val headerFont = workbook.createFont().apply { | ||||