Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Table AutoFit is always set to ColumnWidth Value even thou Table is Autofitted properly #8

Open
PrzemyslawKlys opened this issue Jul 22, 2018 · 0 comments
Labels
bug-in-dll-i-think Something isn't working - bug in dll

Comments

@PrzemyslawKlys
Copy link
Member

Following code $WordDocument.Tables[0].AutoFit always returns ColumnWidth.

        $WordDocument = New-WordDocument

        $InvoiceEntry1 = @{}
        $InvoiceEntry1.Description = 'IT Services 1'
        $InvoiceEntry1.Amount = '$200'

        $InvoiceEntry2 = @{}
        $InvoiceEntry2.Description = 'IT Services 2'
        $InvoiceEntry2.Amount = '$300'

        $InvoiceEntry3 = @{}
        $InvoiceEntry3.Description = 'IT Services 3'
        $InvoiceEntry3.Amount = '$288'

        $InvoiceEntry4 = @{}
        $InvoiceEntry4.Description = 'IT Services 4'
        $InvoiceEntry4.Amount = '$301'

        $InvoiceEntry5 = @{}
        $InvoiceEntry5.Description = 'IT Services 5'
        $InvoiceEntry5.Amount = '$299'

        $InvoiceData = @()
        $InvoiceData += $InvoiceEntry1
        $InvoiceData += $InvoiceEntry2
        $InvoiceData += $InvoiceEntry3
        $InvoiceData += $InvoiceEntry4
        $InvoiceData += $InvoiceEntry5

        Add-WordTable -WordDocument $WordDocument -DataTable $InvoiceData -Design MediumShading1 -AutoFit Contents #-Verbose
        $WordDocument.Tables[0].RowCount | Should -Be 6
        $WordDocument.Tables[0].ColumnCount | Should -Be 2
        #$WordDocument.Tables[0].AutoFit | Should -Be 'Contents' # Seems like a bug in Xceed - always returns ColumnWidth
        $WordDocument.Tables[0].Design | Should -Be 'MediumShading1'
@PrzemyslawKlys PrzemyslawKlys added bug Something isn't working bug-in-dll-i-think Something isn't working - bug in dll and removed bug Something isn't working labels Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug-in-dll-i-think Something isn't working - bug in dll
Projects
None yet
Development

No branches or pull requests

1 participant