New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Issue 1344 with Freeze Top Row #1356
Conversation
@thkn-hofa Thanks for the PR. Are there tests for these? |
No, there weren't any before and didn't feel like writing checks just for this bugfix |
Yup, one of the reasons I probably won't merge. Tests were introduced late. Never knew this would catch on. Making some changes, like this is time for the introduction of tests. Lots of effort though. |
Just saw there is a test for freezetoprowandfirstcolumn. I'll add a test for first row and first column when I get the chance |
Tests for feezing panes
|
If I can get time, I'll look at the |
Tried the below in a test. Didn't get the same results from -FreezeTopRow as the $path = "$pwd\testFreeze.xlsx"
Remove-Item $path -ErrorAction SilentlyContinue
$data = ConvertFrom-Csv @"
Region,State,Units,Price
West,Texas,927,923.71
North,Tennessee,466,770.67
East,Florida,520,458.68
East,Maine,828,661.24
West,Virginia,465,053.58
North,Missouri,436,235.67
South,Kansas,214,992.47
North,North Dakota,789,640.72
South,Delaware,712,508.55
"@
Export-Excel -InputObject $data -Path $path -TableName 'TestTable' -WorksheetName 'TestSheet' -AutoSize -TableStyle Medium2 -Title 'Test Title' -TitleBold -TitleSize 18 -Show -FreezeTopRow # -FreezePane 3, 1 |
That's what I understood, too I get the expected results when running your snippet: Are you sure you loaded this branch in your console? PS C:\source\repos\ImportExcel> remove-module importexcel; import-module .\ImportExcel.psd1 Check the loaded Export-Excel function: ((Get-Command Export-Excel).Definition -Split "[\n]")[494..503] Should yield elseif ($FreezeTopRow) {
if ($Title) {
$ws.View.FreezePanes(3, 1)
Write-Verbose -Message "Froze title and header rows"
}
else {
$ws.View.FreezePanes(2, 1)
Write-Verbose -Message "Froze top row"
}
} and NOT |
Thanks for checking. I pulled down your PR, maybe I didn't do a -force on the ipmo |
Closing this, resolved conflicts here: #1361 |
As described by @mscreations:
Should be
FreezetopRowFirstColumn does the same for freezing the top row with a title:
Fixes issue #1344