API Reference

Cmdlet

Add-OfficeExcelReportLegend

Aliases: ExcelReportLegend
Namespace PSWriteOffice
Aliases
ExcelReportLegend
Inputs
None
Outputs
System.Object

Adds a legend table to the current Excel report sheet.

Remarks

Adds a legend table to the current Excel report sheet.

Examples

Authored help example

Add a status legend with colored first-column values.

PS>


$legendRows = @(
                [pscustomobject]@{ Status = 'Ready'; Meaning = 'Validated and ready' }
                [pscustomobject]@{ Status = 'Review'; Meaning = 'Needs owner review' }
            )
            New-OfficeExcel -Path .\Operations.xlsx {
                Add-OfficeExcelReportSheet -Name Summary {
                    Add-OfficeExcelReportLegend -Title 'Status legend' -Header Status, Meaning -InputObject $legendRows -FirstColumnFillByValue @{ Ready = '#d9f7be'; Review = '#fff7e6' }
                }
            }
        

Renders legend rows and applies optional fill colors keyed by the first column.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

Add-OfficeExcelReportLegend [-CaseSensitive] [-FirstColumnFillByValue <Hashtable>] -Header <String[]> [-HeaderFillColor <String>] -InputObject <Object[]> [-Title <String>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

CaseSensitive SwitchParameter optionalposition: namedpipeline: False
Use case-sensitive matching for first-column fill values.
FirstColumnFillByValue Hashtable optionalposition: namedpipeline: False
Optional first-column fill colors keyed by first-column value.
Header String[] requiredposition: namedpipeline: Falsealiases: Headers
Column headers.
HeaderFillColor String optionalposition: namedpipeline: False
Optional header fill color.
InputObject Object[] requiredposition: namedpipeline: Falsealiases: Rows
Rows. Each row may be an array, enumerable, hashtable, or object.
Title String optionalposition: 0pipeline: False
Optional legend title.

Outputs

System.Object