mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Fixed small bug with Append and simple data types
This commit is contained in:
@@ -676,7 +676,7 @@
|
||||
if ($firstTimeThru) {
|
||||
$firstTimeThru = $false
|
||||
$isDataTypeValueType = $TargetData.GetType().name -match 'string|timespan|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
|
||||
if ($isDataTypeValueType -and -not $Append) {$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'"
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ Install-Module ImportExcel -scope CurrentUser
|
||||
Install-Module ImportExcel
|
||||
```
|
||||
# New to Aug 15h
|
||||
- Fixed a bug with -Append in Export-Excel which caused it to overwrite the last row if the new data was a simple type.
|
||||
- NumberFormat in Export-Excel now sets the default for on a new / blank sheet; but [still] sets individual cells when adding to a sheet
|
||||
- Added support for timespans in Export excel ; set as elapsed hours, mins, secs [h]:mm:sss
|
||||
- In Export-Excel improved the catch-all handler for insering values to cope better with nested objects (#419) and reduce the number of parse operations
|
||||
|
||||
@@ -156,10 +156,10 @@ Describe ExportExcel {
|
||||
it "Set the worksheet default number format correctly " {
|
||||
$ws.Cells.Style.Numberformat.Format | Should be "0.00"
|
||||
}
|
||||
it "Set number formats on specific blocks of cells w " {
|
||||
it "Set number formats on specific blocks of cells " {
|
||||
$ws.Cells["A2" ].Style.Numberformat.Format | Should be "0.00"
|
||||
$ws.Cells["c19"].Style.Numberformat.Format | Should be "0.00"
|
||||
$ws.Cells["A19"].Style.Numberformat.Format | Should be "0.00%"
|
||||
$ws.Cells["A20"].Style.Numberformat.Format | Should be "0.00%"
|
||||
$ws.Cells["C6" ].Style.Numberformat.Format | Should be (Expand-NumberFormat "currency")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user