xlsxwriter-rs

Build Status Build status GitHub GitHub top language Crates.io Docs.rs

Rust binding of libxlsxwriter

Supported Features

Coming soon

Example

Result Image

```rust let workbook = Workbook::new("target/simple1.xlsx"); let format1 = workbook.addformat().setfont_color(FormatColor::Red);

let format2 = workbook .addformat() .setfontcolor(FormatColor::Blue) .setunderline(FormatUnderline::Single);

let format3 = workbook .addformat() .setfontcolor(FormatColor::Green) .setalign(FormatAlignment::CenterAcross) .set_align(FormatAlignment::VerticalCenter);

let mut sheet1 = workbook.addworksheet(None)?; sheet1.writestring(0, 0, "Red text", Some(&format1))?; sheet1.writenumber(0, 1, 20., None)?; sheet1.writeformulanum(1, 0, "=10+B1", None, 30.)?; sheet1.writeurl( 1, 1, "https://github.com/informationsea/xlsxwriter-rs", Some(&format2), )?; sheet1.merge_range(2, 0, 3, 2, "Hello, world", Some(&format3))?;

sheet1.setselection(1, 0, 1, 2); sheet1.settab_color(FormatColor::Cyan); workbook.close()?; ```

Run Example with Cargo

You can explore this example locally following the steps below:

  1. clone or fork this repository
  2. git submodule update --init --recursive
  3. cargo run --example hello_spreadsheet

You should then see the example in target/simple1.xlsx. Enjoy!