API Reference

Cmdlet

Add-OfficeExcelDataSet

Aliases: ExcelDataSet
Namespace PSWriteOffice
Aliases
ExcelDataSet
Inputs
System.Data.DataSet
Outputs
OfficeIMO.Excel.ExcelDataSetImportResult

Writes every table in a DataSet to separate Excel worksheets.

Remarks

Uses OfficeIMO.Excel DataSet ingestion so callers can provide data from any .NET provider without PSWriteOffice owning database connections.

Examples

Authored help example

Insert each DataSet table as a worksheet.

PS>


New-OfficeExcel -Path .\report.xlsx { Add-OfficeExcelDataSet -DataSet $dataSet -AutoFit }
        

Creates one worksheet per DataTable and formats each range as an Excel table.

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-OfficeExcelDataSet [-AutoFit] -DataSet <DataSet> [-NoAutoFilter] [-NoHeader] [-NoRowStripes] [-NoTable] [-PassThru] [-ShowColumnStripes] [-ShowFirstColumn] [-ShowLastColumn] [-TableStyle <String>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

AutoFit SwitchParameter optionalposition: namedpipeline: False
Auto-fit imported table columns.
DataSet DataSet requiredposition: 0pipeline: True (ByValue)
Source DataSet whose tables will become worksheets.
NoAutoFilter SwitchParameter optionalposition: namedpipeline: False
Disable AutoFilter dropdowns.
NoHeader SwitchParameter optionalposition: namedpipeline: False
Skip writing headers.
NoRowStripes SwitchParameter optionalposition: namedpipeline: False
Disable alternating row stripes for created tables.
NoTable SwitchParameter optionalposition: namedpipeline: False
Write plain ranges instead of Excel tables.
PassThru SwitchParameter optionalposition: namedpipeline: False
Return import metadata for each worksheet.
ShowColumnStripes SwitchParameter optionalposition: namedpipeline: False
Enable alternating column stripes for created tables.
ShowFirstColumn SwitchParameter optionalposition: namedpipeline: False
Emphasize the first table column when the selected style supports it.
ShowLastColumn SwitchParameter optionalposition: namedpipeline: False
Emphasize the last table column when the selected style supports it.
TableStyle String optionalposition: namedpipeline: False
Built-in table style to apply.

Outputs

OfficeIMO.Excel.ExcelDataSetImportResult