Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Add-OfficeExcelReportCallout

Aliases: ExcelReportCallout
Module
PSWriteOffice
Aliases
ExcelReportCallout
Inputs
None

Adds a highlighted info, success, warning or error callout.

Syntax

Add-OfficeExcelReportCallout
[[-Kind] <Info|Success|Warning|Error|Critical>]
[-PassThru]
[-Span <Int32>]
[-Text] <String>
[-Title] <String>
[<CommonParameters>]
#
Parameter set: Default

Examples

Add an information callout

New-OfficeExcel -Path .\Reports\Operations.xlsx {
    ExcelReportSheet 'Summary' {
        ExcelReportCallout Info 'Data source' 'Monitoring export from 1 November, 06:00.'
    }
}

Highlights a note for readers in an information callout.

Report results with matching callouts

$failed = Import-OfficeCsv -Path .\Data\Backup-Results.csv | Where-Object Result -ne 'Success'
New-OfficeExcel -Path .\Reports\Backup-Check.xlsx {
    ExcelReportSheet 'Backups' {
        ExcelReportTitle 'Nightly backup check' (Get-Date).ToString('d MMMM yyyy')
        if ($failed) {
            ExcelReportCallout Error 'Backups failed' "$(@($failed).Count) jobs did not complete. Details are below."
            ExcelReportTable $failed 'Failed jobs'
        } else {
            ExcelReportCallout Success 'All backups completed' 'Every scheduled job finished successfully.'
        }
    }
}

Adds a success or error callout depending on whether the backup checks passed, so the outcome is the first thing a reader sees.

Parameters

-Kind OfficeExcelReportCalloutKind optionalposition: 0
Metadata kind to add.
Possible values: Info, Success, Warning, Error, Critical
-PassThru SwitchParameter optional
Emits the native result after the operation.
-Span Int32 optional
Number of worksheet columns occupied by the report block.
-Text String requiredposition: 2
Comment text.
-Title String requiredposition: 1
Chart title.

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.