# Add-OfficeExcelReportSheet

Creates a report worksheet and lays out report blocks inside it.

Cmdlet 

Aliases: ExcelReportSheet

**Module**

`PSWriteOffice`

**Aliases**

`ExcelReportSheet`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Source**

[AddOfficeExcelReportSheetCommand.cs:47](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Excel/AddOfficeExcelReportSheetCommand.cs#L47) 

Creates a report worksheet and lays out report blocks inside it.

## Syntax

```
Add-OfficeExcelReportSheet
[-AutoFitRows]
[[-Content] <ScriptBlock>]
[-Document <ExcelDocument>]
[-HeadingFillColor <OfficeColor>]
[-KeyFillColor <OfficeColor>]
[-Name] <String>
[-NoAutoFit]
[-PassThru]
[<CommonParameters>]
```

[#](#method-add-officeexcelreportsheet-switchparameter-scriptblock-exceldocument-officecolor-officecolor-string-switchparameter-switchparameter)

Parameter set: `Default`

## Examples

### Create a report sheet

```powershell
New-OfficeExcel -Path .\Reports\Operations.xlsx {
    ExcelReportSheet 'Summary' {
        ExcelReportTitle 'Operations summary' 'Week 43, 2026'
        ExcelReportKpi ([ordered]@{ Uptime = '99.97%'; Incidents = 4; 'Changes shipped' = 37 })
    }
}
```

Adds a Summary report sheet with a title and a KPI row, laid out by the report builder in the workbook theme.

### Build a monthly service review

```powershell
$sites = Import-OfficeCsv -Path .\Data\Site-Availability.csv
$legend = @(
    [pscustomobject]@{ Status = 'Met'; Meaning = 'Availability at or above the 99.9% target' }
    [pscustomobject]@{ Status = 'Missed'; Meaning = 'Below target; a service credit may apply' }
)
New-OfficeExcel -Path .\Reports\Service-Review-October.xlsx -Theme Boardroom {
    ExcelReportSheet 'Review' {
        ExcelReportTitle 'Service review' 'October 2026'
        ExcelReportKpi ([ordered]@{ Availability = '99.94%'; 'P1 incidents' = 1; 'Mean time to restore' = '42 min'; 'Changes' = 128 })
        ExcelReportCallout Warning 'Two sites missed target' 'Gdansk and Porto were below 99.9% after the network maintenance on 14 October.'
        ExcelReportHeading 'Availability by site'
        ExcelReportTable $sites 'Sites'
        ExcelReportChart -Type Column -Category Site -Value Availability -Title 'Availability by site'
        ExcelReportSpacer
        ExcelReportLegend 'Status' -Header Status, Meaning -InputObject $legend
    }
}
```

Lays out a complete service review: title, KPIs, a callout, a site table with its chart and a legend, all styled by the theme.

## Parameters

**-AutoFitRows SwitchParameter optional**

Auto-fit row heights during composer finalization.

**-Content ScriptBlock optionalposition: 1**

Excel child commands executed in the current content scope.

**-Document ExcelDocument optionalpipeline: True (ByValue)**

Caller-owned workbook; omission uses the enclosing Excel content block.

**-HeadingFillColor OfficeColor optional**

Fill colour for report section headings.

**-KeyFillColor OfficeColor optional**

Override the key-cell fill color used by KPI and property blocks.

**-Name String requiredposition: 0**

Name of the report worksheet to create.

**-NoAutoFit SwitchParameter optional**

Retains native column widths without fitting them to the data.

**-PassThru SwitchParameter optional**

Emits the native result after the operation.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:159A39BAC803F686C025B51448D6ED73748C0E4AAC32980CF713696069781528 -->
