spreadsheet_decoder icon indicating copy to clipboard operation
spreadsheet_decoder copied to clipboard

how to add new table?

Open dave-doty opened this issue 6 years ago • 7 comments

How can I add a new table (a.k.a., "worksheet" in Excel terminology) to an existing spreadsheet?

dave-doty avatar Dec 27 '19 05:12 dave-doty

Unfortunately, this feature isn't implemented yet.

sestegra avatar Dec 27 '19 13:12 sestegra

Jeez, I was figuring out why changes to SpreadsheetDecoder#_tables won't do anything just to discover that every row/column operation is checking against SpreadsheetDecoder#_sheets field. Which is immutable :(

@sestegra do you face any particular challenge implementing this feature?

shliama avatar Feb 15 '20 21:02 shliama

Hmm, looks like somebody has solved the issue already https://github.com/kawal7415/excel_it/blob/master/lib/src/excel.dart

The source code looks suspiciously like yours @sestegra 🤔😉

shliama avatar Feb 15 '20 21:02 shliama

@shliama My current challenge is only to find free time to implement this feature.

Then, thank you to pointing me out the library from @kawal7415 In fact, the starting point of the project is a fork of this one: See https://github.com/kawal7415/excel_it/blob/220293f1f66a4a60bca54229c153c71481832cb1/README.md

It would be nice of him/her to discuss here. For instance, create pull requests on this project to support the features that are not available yet.

sestegra avatar Feb 16 '20 14:02 sestegra

Thanks @shliama for getting the conversation started and font and background color , alignment , wrapping and spanning of rows and columns feature will be rolling out with a week.

Thanks @sestegra for the code of spreadsheet_decoder without your code I would have not been able to kickstart it.

It was bit hard to understand tons of lines but somehow with debugging made it easy to understand the approach.

justkawal avatar Feb 16 '20 15:02 justkawal

Long live open source :octocat:

I've tested the "Add new table" feature from the @kawal7415 fork and it does not work properly.

Microsoft Office, Apple Number, and Google Sheets open such files differently, either all sheets have the name of the last sheet that was added or all sheets have proper names but only the last one has the data inside. And lastly, Microsoft Office says that the file is corrupted and loses all data if I try to force open it. Will try to write js interop for https://github.com/SheetJS/sheetjs library.

shliama avatar Feb 16 '20 15:02 shliama

@shliama You are correct thanks for highlighting it, Now, It has been fixed and updated.

Long live open source :octocat:

justkawal avatar Feb 16 '20 16:02 justkawal