-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
Wrong column width when Excel.save() #277
Comments
Reproducible on The issue is not in Confirmed with this code: const path = "test_input.xlsx";
final data = File(path).readAsBytesSync();
Excel excel = Excel.decodeBytes(data);
print(excel.sheets['Sheet1']!.cell(CellIndex.indexByColumnRow(columnIndex: 0, rowIndex: 0)).value); //VERY LONG CENTERED BOLD TEXT
print(excel.sheets['Sheet1']!.getColumnWidths[0]); //null
print(excel.sheets['Sheet1']!.getColumnWidths[1]); //null
final fileBytes = excel.save();
if (fileBytes != null) {
File("test_output.xlsx").writeAsBytesSync(fileBytes);
} |
So, how can I parse the width in the document? I really need to keep the width of the original file though. And I doesn't mean one column only but the width of all other column in the file. |
This is a bug in this package. If you're motivated, you can go take a look and try to fix it. |
Hi, as i needed this bug to be fixed i came up with this solution. I created this function:
and i called the function in the _parseTable function right after _parseHeaderFooter:
|
@DavidPoetsch You are welcome to open a PR with your proposal to get the the change merged. |
To be honest i have no experience with GitHub. EDIT: I guess i understood the first part and created a PR |
When load an excel file from rootBundle and then save it in another directory, the width of the column in the output file doesn't match with the original input file.
The function I used:
I have tested and found that the excel.save() is the cause of this behavior:
How can I fix this?
The test files:
test_input.xlsx
test_output.xlsx
Flutter doctor:
Tested on an android physical device with the latest version of Microsoft Excel on Google Play Store.
The text was updated successfully, but these errors were encountered: