Report Templates
Template strategy:
- Keep layout composition in functions.
- Keep data retrieval separate from rendering.
- Reuse cmdlet groups (
Table,Chart,Form) across reports.
function New-ServiceReport {
param(
[Parameter(Mandatory)]
[object[]] $Services
)
New-HtmlX -Title "Service Report" -FilePath .\service-report.html {
New-HtmlXSection -Title "Status" {
New-HtmlXTable -Data $Services {
New-HtmlXTableSearch
New-HtmlXTablePaging -PageLength 15
}
}
}
}Use this section as a conceptual guide and the API docs for exact parameters: