diff --git a/Export-Excel.ps1 b/Export-Excel.ps1 index beaebb5..4771b09 100644 --- a/Export-Excel.ps1 +++ b/Export-Excel.ps1 @@ -378,7 +378,7 @@ [switch]$ClearSheet, [switch]$Append, [String]$Title, - [OfficeOpenXml.Style.ExcelFillStyle]$TitleFillPattern = 'None', + [OfficeOpenXml.Style.ExcelFillStyle]$TitleFillPattern = 'Solid', [Switch]$TitleBold, [Int]$TitleSize = 22, [System.Drawing.Color]$TitleBackgroundColor, @@ -592,10 +592,7 @@ #Otherwise the default will be unbolded. $ws.Cells[$Row, $StartColumn].Style.Font.Bold = $True } - #Can only set TitleBackgroundColor if TitleFillPattern is something other than None. - if ($TitleBackgroundColor -and ($TitleFillPattern -ne 'None')) { - $TitleFillPattern = [OfficeOpenXml.Style.ExcelFillStyle]::Solid - } + $ws.Cells[$Row, $StartColumn].Style.Fill.PatternType = $TitleFillPattern if ($TitleBackgroundColor ) { @@ -627,7 +624,7 @@ Try { if ($firstTimeThru) { $firstTimeThru = $false - $isDataTypeValueType = $TargetData.GetType().name -match 'string|bool|byte|char|decimal|double|float|int|long|sbyte|short|uint|ulong|ushort' + $isDataTypeValueType = $TargetData.GetType().name -match 'string|datetime|bool|byte|char|decimal|double|float|int|long|sbyte|short|uint|ulong|ushort' if ($isDataTypeValueType) {$row -= 1} #row incremented before adding values, so it is set to the number of rows inserted at the end Write-Debug "DataTypeName is '$($TargetData.GetType().name)' isDataTypeValueType '$isDataTypeValueType'" } diff --git a/README.md b/README.md index 460995c..a33e8f9 100644 --- a/README.md +++ b/README.md @@ -51,22 +51,20 @@ Install-Module ImportExcel -scope CurrentUser ```PowerShell Install-Module ImportExcel ``` -# What's new to Aug 2018 +# New Aug 3rd - +- Fixed bug where Export-Excel would not recognise it had to set $TitleFillPattern - made the default 'Solid' +- Gave Expand-NumberFormat a better grasp of currency layouts. +- Added DateTime to the list of types which can be exported as single column. + +# What's new to 2nd Aug 2018 - Set-Row and Set-Column will now create hyperlinks and insert dates correctly - Import-Excel now has an argument completer for Worksheet name - this can be slow on large files -<<<<<<< HEAD -- The NumberFormat parameter (in Export-Excel, Set-Row, Set-Column, Set-Format and Add-ConditionalFormat) and X&YAxisNumberFormat parameters (in New-ExcelChartDefinition and Add-ExcelChart) now have an argument completer and the names Currency, Number, Percentage, Scientific, Fraction, Short Date ,Short time,Long time, Date-Time and Text will be converted to the correct Excel formatting strings. -- Added new function Select-Worksheet to make a named sheet active: Added -Activate switch to Add-Worksheet, to make current sheet active, Export-Excel and Add-PivotTable support -Activate and pass it to Add-Worksheet, and New-PivotTableDefinition allows it to be part of the Pivot TableDefinition. -- Fixed a bug in Set-Format which caused -Hidden not to work -- Additional tests. -======= - The NumberFormat parameter (in Export-Excel, Set-Row, Set-Column, Set-Format and Add-ConditionalFormat) and X&YAxisNumberFormat paramaters (in New-ExcelChartDefinition and Add-ExcelChart) now have an argument completer and the names Currency, Number, Percentage, Scientific, Fraction, Short Date ,Short time,Long time, Date-Time and Text will be converted to the correct Excel formatting strings. - Added new function Select-Worksheet to make a named sheet active: Added -Activate switch to Add-Worksheet, to make current sheet active, Export-Excel and Add-PivotTable support -Activate and pass it to Add-Worksheet, and New-PivotTableDefinition allows it to be part of the Pivot TableDefinition. - Fixed a bug in Set-Format which caused -Hidden not to work - Made the same changes to Add-Conditional format as set format so -switch:$false is processed, and 0 enums and values are processed correctly - In Export-Excel, wraped calls to Add-CellValue in a try catch so a value which causes an issue doesn't crash the whole export but generates a warning instead (#410) . - Additional tests. ->>>>>>> 42e2b11a88475dbdd3dbd6f3b1703b33b4d0ba4b # What's new to July 18 - Changed parameter evaluation in Set-Format to support -bold:$false (and other switches so that if false is specified the attribute will be removed ), and to bug were enums with a value of zero, and other zero parameters were not set. diff --git a/ToDo.md b/ToDo.md index dc18a9a..45af56f 100644 --- a/ToDo.md +++ b/ToDo.md @@ -2,6 +2,7 @@ - [x] Support "make worksheet active" - [X] Add checks for valid worksheet names - [ ] Improve checking of worksheet, pivot names, range names and table names +- [ ] Allow Exclude property to take wildcards - [ ] Investigate regional support for number conversion & possible date conversion. Also investigate feasablity of preserving number format when converting string to number - [ ] Add help text for parmaters which don't have it ( PivotDataToColumn , NoClobber and CellStyleSB ) in Export Excel, copy to Send-SQLDataToExcel - [ ] Add help in ConvertToExcelXLSx.ps1, Get-HTMLTable.ps1, GetRange.PS1, GetExcelTable.Ps1, Import-HTML.PS1, New-ConditionalFormattingIconSet.Ps1, NewConditionalText.PS1, New-Psitem.PS1, Remove-Worksheet.ps1 and Add-ExcelChart - Copy parameter help from function Add-ExcelChart into New-ExcelChart.ps1