qrilka / xlsx

Simple and incomplete Excel file parser/writer
MIT License
130 stars 64 forks source link

hidden columns #89

Closed stla closed 5 years ago

stla commented 7 years ago

Hello,

I've written a file with these options:

                        ColumnsProperties {
                                                          cpMin = 1,
                                                          cpMax = 2,
                                                          cpWidth = Nothing,
                                                          cpStyle = Nothing,
                                                          cpHidden = False,
                                                          cpCollapsed = False,
                                                          cpBestFit = True
                                                         }

and my two columns are hidden. Is it expected ? I expected the opposite because of cpHidden = False. (I did not take the time to try cpHidden = True yet)

stla commented 7 years ago

It seems that cpWidth = Nothing was the smoking gun. But what is cpBestFit? I expected an automatic width which fits the contents.

qrilka commented 7 years ago

So missing width just hides a column like applying 0 width? Excel is weird :-\

qrilka commented 7 years ago

Regarding cpBestFit I could only quote the spec:

Flag indicating if the specified column(s) is set to 'best fit'. 'Best fit' is set to true under these conditions:

  • The column width has never been manually set by the user, AND
  • The column width is not the default width
  • 'Best fit' means that when numbers are typed into a cell contained in a 'best fit' column, the column width should automatically resize to display the number. [Note: In best fit cases, column width must not be made smaller, only larger. end note]

(original formatting from the spec preserved :) )

stla commented 7 years ago

So missing width just hides a column like applying 0 width?

It is really hidden. I have to click on "unhide" in order to see it. I have downloaded LibreOffice for Windows, but not tried.

stla commented 7 years ago

Ok thanks, I will try "Best fit" again.

qrilka commented 5 years ago

@stla is there anything I could do regarding this issue? Otherwise I want to close it

stla commented 5 years ago

Hello @qrilka . I have not used xlsx for a very long time and I'm lost when I re-read this discussion. So the conclusion was that we have to set cpWidth ? Feel free to close this issue. Anyway it will be re-openable in case if.

qrilka commented 5 years ago

Thanks