From 9646de94f61c32031c0e067ea1e41b51faacb269 Mon Sep 17 00:00:00 2001 From: Takeshi Katano Date: Thu, 11 Jul 2024 02:55:05 +0900 Subject: [PATCH] Improve recommendation sheet cell formats --- tools/2_wara_data_analyzer.ps1 | 50 ++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/tools/2_wara_data_analyzer.ps1 b/tools/2_wara_data_analyzer.ps1 index 793a1939c..ca9cdeb09 100644 --- a/tools/2_wara_data_analyzer.ps1 +++ b/tools/2_wara_data_analyzer.ps1 @@ -681,19 +681,45 @@ $Script:Runtime = Measure-Command -Expression { $Script:Recommendations += $tmp } + $columnCommonStyle = @{ + FontName = 'Calibri' + FontSize = 11 + WrapText = $true + } + + $headerCommonStyle = @{ + FontName = 'Calibri' + FontSize = 11 + FontColor = 'White' + Bold = $true + BackgroundColor = 'DarkSlateGray' + HorizontalAlignment = 'Center' + VerticalAlignment = 'Center' + WrapText = $true + } + $Styles2 = @( - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor "White" -VerticalAlignment Center -Bold -WrapText -BackgroundColor "DarkSlateGray" -Width 14 -Range "A1:B1" - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor "White" -VerticalAlignment Center -Bold -WrapText -BackgroundColor "DarkSlateGray" -Width 18 -Range "C1" - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor "White" -VerticalAlignment Center -Bold -WrapText -BackgroundColor "DarkSlateGray" -Width 20 -Range "D1" - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor "White" -VerticalAlignment Center -Bold -WrapText -BackgroundColor "DarkSlateGray" -Width 35 -Range "E1:F1" - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor "White" -VerticalAlignment Center -Bold -WrapText -BackgroundColor "DarkSlateGray" -Width 20 -Range "G1" - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor "White" -VerticalAlignment Center -Bold -WrapText -BackgroundColor "DarkSlateGray" -Width 55 -Range "H1" - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor "White" -VerticalAlignment Center -Bold -WrapText -BackgroundColor "DarkSlateGray" -Width 10 -Range "I1" - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor "White" -VerticalAlignment Center -Bold -WrapText -BackgroundColor "DarkSlateGray" -Width 90 -Range "J1" - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor "White" -VerticalAlignment Center -Bold -WrapText -BackgroundColor "DarkSlateGray" -Width 45 -Range "K1" - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor "White" -VerticalAlignment Center -Bold -WrapText -BackgroundColor "DarkSlateGray" -Width 35 -Range "L1:M1" - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor "White" -VerticalAlignment Center -Bold -WrapText -BackgroundColor "DarkSlateGray" -Width 45 -Range "N1" - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -VerticalAlignment Center -WrapText -Range "A:N" + # Apply the style to the columns. + New-ExcelStyle @columnCommonStyle -Range 'A:G' -HorizontalAlignment Center -VerticalAlignment Center + New-ExcelStyle @columnCommonStyle -Range 'H:H' -HorizontalAlignment Left -VerticalAlignment Center + New-ExcelStyle @columnCommonStyle -Range 'I:I' -HorizontalAlignment Center -VerticalAlignment Center + New-ExcelStyle @columnCommonStyle -Range 'J:K' -HorizontalAlignment Left -VerticalAlignment Top + New-ExcelStyle @columnCommonStyle -Range 'L:L' -HorizontalAlignment Center -VerticalAlignment Center + New-ExcelStyle @columnCommonStyle -Range 'M:M' -HorizontalAlignment Left -VerticalAlignment Top + New-ExcelStyle @columnCommonStyle -Range 'N:N' -HorizontalAlignment Center -VerticalAlignment Center + + # Apply the style to the header row. + New-ExcelStyle @headerCommonStyle -Range 'A1:B1' -Width 14 + New-ExcelStyle @headerCommonStyle -Range 'C1' -Width 18 + New-ExcelStyle @headerCommonStyle -Range 'D1' -Width 20 + New-ExcelStyle @headerCommonStyle -Range 'E1:F1' -Width 35 + New-ExcelStyle @headerCommonStyle -Range 'G1' -Width 20 + New-ExcelStyle @headerCommonStyle -Range 'H1' -Width 55 + New-ExcelStyle @headerCommonStyle -Range 'I1' -Width 10 + New-ExcelStyle @headerCommonStyle -Range 'J1' -Width 90 + New-ExcelStyle @headerCommonStyle -Range 'K1' -Width 45 + New-ExcelStyle @headerCommonStyle -Range 'L1:M1' -Width 35 + New-ExcelStyle @headerCommonStyle -Range 'N1' -Width 45 ) # Configure the array of fields to be used in the Recommendations sheet