Skip to content
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

Argument column_widths does not seem to work #23

Closed
Loschcode opened this issue Aug 13, 2018 · 5 comments
Closed

Argument column_widths does not seem to work #23

Loschcode opened this issue Aug 13, 2018 · 5 comments

Comments

@Loschcode
Copy link

I'm using your library to export XLSX, CSV and ODS. The code is as such

      def data
        SpreadsheetArchitect.to_xlsx(arguments)
      end

      def arguments
        {
          sheet_name: spreadsheet.name,
          column_widths: spreadsheet.column_widths,
          headers: spreadsheet.headers,
          data: spreadsheet.data
        }
      end

We have column_widths with let's say [10, 10] and headers with ['Set 1', 'Set 2'] which should set the size of each column to 10 and work clean.

It does not work, for some reason my columns end up being all in different sizes, as you can see in the screenshot. Am I missing something with the column_widths option or is it bug ?

Here's a screenshot with real data I tried to export a XLSX.

screenshot 2018-08-13 14 26 55

@Loschcode Loschcode changed the title Argument column_width does not seem to work Argument column_widths does not seem to work Aug 13, 2018
@westonganger
Copy link
Owner

I believe I have located the issue. Can you please test the fix_custom_column_widths branch and let me know if that fixes your issue.

@Loschcode
Copy link
Author

Loschcode commented Aug 14, 2018

Hi,

It works like a charm with your branch 👍 which release will it be on ?

screenshot 2018-08-14 10 58 40

@westonganger
Copy link
Owner

Beauty! Merged to master. Will be included in v3.1.0, will try to get this release out in the next week or two.

@westonganger
Copy link
Owner

v3.1.0 is now released which contains this fix.

@MadBomber
Copy link

The release 4.0.0 does not have a working column_widths in my environment. I will be doing some detailed testing to find problem. Suspect an old version of axlsx gem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants