insert Row/Column deletes everything
Hey if I have an excel sheet with say 50 rows and I user the function sheet.insertRow(33) everything after that is deleted... Same problem with Column.
I hope you have soon a fix for it :)
also dunno if it is bc of the insertRow but my excel always get currupted... it is the file format .xlsm maybe that is not supported?
Hi, is there any update here? I have the same problem.
When I use insertRow(n), all data after row n was gone.
Only leave rors at row [0, n-1] and empty row at row n.
Env
- windows x64 app (dev mode)
- flutter 3.10.1
- excel 2.1.0
Thanks.
Is this still reproducible on 3.0.0?
Can you provide an example excel file and sample code which yield the error?
Hello @FauconSpartiate ,
This is still reproducible on 4.0.2.
I'm attaching 2 Excel files for reference: MBFin-original is the original file with 15 lines. MBFin is the final product after I run the code below, it shrunk to only 6 lines.
Here's my code for reference as well:
var sheet = financesExcel.tables['Transactions'];
var newRowIndex = 5;
sheet!.insertRow(newRowIndex);
sheet.cell(CellIndex.indexByColumnRow(
columnIndex: 0, rowIndex: newRowIndex))
..value = const DateCellValue(year: 2024, month: 2, day: 15)
..cellStyle =
CellStyle(numberFormat: NumFormat.defaultDate);
sheet
.cell(CellIndex.indexByColumnRow(
columnIndex: 1, rowIndex: newRowIndex))
.value = const TextCellValue("CLEARED");
sheet
.cell(CellIndex.indexByColumnRow(
columnIndex: 2, rowIndex: newRowIndex))
.value = const TextCellValue("New Payee");
sheet
.cell(CellIndex.indexByColumnRow(
columnIndex: 3, rowIndex: newRowIndex))
.value = const TextCellValue("Category");
sheet
.cell(CellIndex.indexByColumnRow(
columnIndex: 4, rowIndex: newRowIndex))
.value = const TextCellValue("Tags");
sheet.cell(CellIndex.indexByColumnRow(
columnIndex: 5, rowIndex: newRowIndex))
..value = const DoubleCellValue(-999.99)
..cellStyle =
CellStyle(numberFormat: NumFormat.defaultNumeric);
List<int>? fileBytes = financesExcel.save();
FinDB.xlsx FinDB-original.xlsx
P.S.: Not sure if important, but I'm not storing this Excel file locally. I'm using library flutter_onedrive to download the Excel file, work on it locally with excel, and then Upload it back to One Drive.
This is an Android app.
Let me know if I missed anything else that might help reproduce the issue.
Hi, is there any update here? I have the same problem.