Argument Error on write_to_memory
Closed this issue · 1 comments
rakusan2 commented
I am trying to take a list of lists and turn it into a spreadsheet
I am doing this by enumerating over everything and putting it into Sheet.set_at/5
Upon calling Workbook.append_sheet(%Workbook{}, worksheet) |> Elixlsx.write_to_memory("filename.xlsx")
I get the following
** (ArgumentError) you attempted to apply :rows on {:ok, %Elixlsx.Sheet{col_widths: %{}, group_cols: [], group_rows: [], merge_cells: [], name: "test", pane_freeze: nil, row_heights: %{}, rows: [[["registration", {:bold, true}]], [["C-FUYE"]], [["C-FJXA"]], [["C-LSFR"]], [["C-FUZH"]], [["C-FXPY"]], [["C-DUOD"]], [["C-PRIV"]]], show_grid_lines: true}}. If you are using apply/3, make sure the module is an atom. If you are using the dot syntax, such as map.field or module.function, make sure the left side of the dot is an atom or a map
:erlang.apply({:ok, %Elixlsx.Sheet{col_widths: %{}, group_cols: [], group_rows: [], merge_cells: [], name: "test", pane_freeze: nil, row_heights: %{}, rows: [[["registration", {:bold, true}]], [["C-FUYE"]], [["C-FJXA"]], [["C-LSFR"]], [["C-FUZH"]], [["C-FXPY"]], [["C-DUOD"]], [["C-PRIV"]]], show_grid_lines: true}}, :rows, [])
(elixlsx) lib/elixlsx/compiler.ex:68: anonymous fn/2 in Elixlsx.Compiler.compinfo_from_sheets/2
(elixir) lib/list.ex:228: List."-foldl/3-lists^foldl/2-0-"/3
(elixlsx) lib/elixlsx/compiler.ex:80: Elixlsx.Compiler.make_workbook_comp_info/1
(elixlsx) lib/elixlsx.ex:58: Elixlsx.write_to_memory/2
I Have:
- Elixlsx v0.4.2
- Elixir v1.9.4
- Windows 10 (1909)
rakusan2 commented
It was solved by switching from Repo.stream to Repo.all