UPDATE: Adds a bunch of documentation and examples

This commit is contained in:
Nicolás Hatcher
2024-02-19 23:00:55 +01:00
parent c84621e13f
commit 2d6e45ad94
13 changed files with 381 additions and 76 deletions

View File

@@ -3,10 +3,9 @@ use ironcalc::{base::model::Model, export::save_to_xlsx};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut model = Model::new_empty("widths-and-heights", "en", "UTC")?;
// Cell C5
let column = 3;
let row = 5;
let (sheet, row, column) = (0, 5, 3);
// Make the first column 4 times as width
let worksheet = model.workbook.worksheet_mut(0)?;
let worksheet = model.workbook.worksheet_mut(sheet)?;
let column_width = worksheet.column_width(column)? * 4.0;
worksheet.set_column_width(column, column_width)?;
@@ -14,9 +13,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let row_height = worksheet.row_height(row)? * 2.0;
worksheet.set_row_height(row, row_height)?;
// evaluates
model.evaluate();
// saves to disk
save_to_xlsx(&model, "widths-and-heights.xlsx")?;
Ok(())