mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Initial commit
This commit is contained in:
@@ -10,6 +10,7 @@ Add-Type -Path "$($PSScriptRoot)\EPPlus.dll"
|
||||
. $PSScriptRoot\Get-XYRange.ps1
|
||||
. $PSScriptRoot\Charting.ps1
|
||||
. $PSScriptRoot\New-PSItem.ps1
|
||||
. $PSScriptRoot\Pivot.ps1
|
||||
|
||||
function Import-Excel {
|
||||
param(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
param([string]$InstallDirectory)
|
||||
|
||||
$fileList = echo EPPlus.dll ImportExcel.psd1 ImportExcel.psm1 Export-Excel.ps1 New-ConditionalFormattingIconSet.ps1 Export-ExcelSheet.ps1 New-ExcelChart.ps1 Invoke-Sum.ps1 InferData.ps1 Get-ExcelColumnName.ps1 Get-XYRange.ps1 Charting.ps1 New-PSItem.ps1
|
||||
$fileList = echo EPPlus.dll ImportExcel.psd1 ImportExcel.psm1 Export-Excel.ps1 New-ConditionalFormattingIconSet.ps1 Export-ExcelSheet.ps1 New-ExcelChart.ps1 Invoke-Sum.ps1 InferData.ps1 Get-ExcelColumnName.ps1 Get-XYRange.ps1 Charting.ps1 New-PSItem.ps1 Pivot.ps1
|
||||
|
||||
if ('' -eq $InstallDirectory)
|
||||
{
|
||||
|
||||
21
Pivot.ps1
Normal file
21
Pivot.ps1
Normal file
@@ -0,0 +1,21 @@
|
||||
function Pivot {
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
$targetData,
|
||||
$pivotRows,
|
||||
$pivotData,
|
||||
[OfficeOpenXml.Drawing.Chart.eChartType]$ChartType="Pie"
|
||||
)
|
||||
|
||||
if(!$pivotData) {$pivotData=$pivotRows}
|
||||
|
||||
$xlFile = [System.IO.Path]::GetTempFileName() -replace "tmp","xlsx"
|
||||
Write-Verbose $xlFile
|
||||
|
||||
$targetData |
|
||||
Export-Excel -Path $xlFile `
|
||||
-IncludePivotTable -IncludePivotChart `
|
||||
-PivotRows $pivotRows -PivotData $pivotData `
|
||||
-ChartType $ChartType `
|
||||
-Show
|
||||
}
|
||||
Reference in New Issue
Block a user