MathNya / umya-spreadsheet

A pure rust library for reading and writing spreadsheet files
MIT License
274 stars 43 forks source link

Feature request: a way to force formula recalculation in LibreOffice #201

Closed Expurple closed 2 months ago

Expurple commented 3 months ago

I would like to see something like worksheet.set_formula_result_default("") from rust_xlsxwriter. Maybe this feature already exists, but I couldn't find it in the documentation.

MathNya commented 3 months ago

@Expurple Yes, sir. It will probably be easy to implement and will be addressed in the next version update.

MathNya commented 2 months ago

Oh, sorry. We have released the latest version, but just now we realized that it is not supported here. We will fix it soon.

agentjill commented 2 months ago

Oh, sorry. We have released the latest version, but just now we realized that it is not supported here. We will fix it soon.

@MathNya, kindly also update github releases for newer version

MathNya commented 2 months ago

@Expurple The latest version is now available. Please use this function.

let path = std::path::Path::new("./tests/test_files/issue_201.xlsx");
let mut book = umya_spreadsheet::reader::xlsx::read(path).unwrap();
let mut cell = book.get_sheet_mut(&0).unwrap().get_cell_mut("B1");
cell.set_formula_result_default("");
Expurple commented 2 months ago

Technically, this is equivalent to per-cell set_formula_result, rather than global per-sheet set_formula_result_default. But this should be enough for my use case, thank you. I'll close the issue and let someone else reopen it or open a new one, if they really need a global default.