fix: [hr] XLSX 내보내기 Color 객체 → argb 배열로 수정
- applyFromArray()에 Color 객체 직접 전달 시 TypeError 발생 - font/fill/border color를 ['argb' => 'FF...'] 배열 형태로 변경
This commit is contained in:
@@ -137,10 +137,10 @@ public function export(Request $request): StreamedResponse|JsonResponse
|
||||
$sheet->setCellValue($cell, $header);
|
||||
}
|
||||
$sheet->getStyle("A2:{$lastCol}2")->applyFromArray([
|
||||
'font' => ['bold' => true, 'size' => 10, 'color' => new Color('FFFFFF')],
|
||||
'fill' => ['fillType' => Fill::FILL_SOLID, 'startColor' => new Color('1F3864')],
|
||||
'font' => ['bold' => true, 'size' => 10, 'color' => ['argb' => 'FFFFFFFF']],
|
||||
'fill' => ['fillType' => Fill::FILL_SOLID, 'startColor' => ['argb' => 'FF1F3864']],
|
||||
'alignment' => ['horizontal' => Alignment::HORIZONTAL_CENTER, 'vertical' => Alignment::VERTICAL_CENTER, 'wrapText' => true],
|
||||
'borders' => ['allBorders' => ['borderStyle' => Border::BORDER_THIN, 'color' => new Color('000000')]],
|
||||
'borders' => ['allBorders' => ['borderStyle' => Border::BORDER_THIN, 'color' => ['argb' => 'FF000000']]],
|
||||
]);
|
||||
$sheet->getRowDimension(2)->setRowHeight(36);
|
||||
|
||||
@@ -184,7 +184,7 @@ public function export(Request $request): StreamedResponse|JsonResponse
|
||||
// ── 데이터 영역 스타일 ──
|
||||
$dataRange = "A{$dataStartRow}:{$lastCol}{$lastDataRow}";
|
||||
$sheet->getStyle($dataRange)->applyFromArray([
|
||||
'borders' => ['allBorders' => ['borderStyle' => Border::BORDER_THIN, 'color' => new Color('000000')]],
|
||||
'borders' => ['allBorders' => ['borderStyle' => Border::BORDER_THIN, 'color' => ['argb' => 'FF000000']]],
|
||||
'alignment' => ['vertical' => Alignment::VERTICAL_CENTER],
|
||||
'font' => ['size' => 10],
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user