10 releases

Uses old Rust 2015

0.2.0 Mar 11, 2022
0.1.9 Oct 28, 2021
0.1.8 Sep 1, 2021
0.1.7 Apr 29, 2020
0.1.3 Jan 3, 2017

#398 in Encoding

Download history 922/week @ 2024-06-11 819/week @ 2024-06-18 761/week @ 2024-06-25 807/week @ 2024-07-02 781/week @ 2024-07-09 602/week @ 2024-07-16 566/week @ 2024-07-23 716/week @ 2024-07-30 855/week @ 2024-08-06 787/week @ 2024-08-13 659/week @ 2024-08-20 726/week @ 2024-08-27 813/week @ 2024-09-03 567/week @ 2024-09-10 524/week @ 2024-09-17 776/week @ 2024-09-24

2,810 downloads per month
Used in 6 crates

Apache-2.0

56KB
1K SLoC

simple_excel_writer

simple excel writer in Rust

Build Status Documentation

Example

#[macro_use]
extern crate simple_excel_writer as excel;

use excel::*;

fn main() {
    let mut wb = Workbook::create("/tmp/b.xlsx");
    let mut sheet = wb.create_sheet("SheetName");

    // set column width
    sheet.add_column(Column { width: 30.0 });
    sheet.add_column(Column { width: 30.0 });
    sheet.add_column(Column { width: 80.0 });
    sheet.add_column(Column { width: 60.0 });

    wb.write_sheet(&mut sheet, |sheet_writer| {
        let sw = sheet_writer;
        sw.append_row(row!["Name", "Title","Success","XML Remark"])?;
        sw.append_row(row!["Amy", (), true,"<xml><tag>\"Hello\" & 'World'</tag></xml>"])?;
        sw.append_blank_rows(2);
        sw.append_row(row!["Tony", blank!(2), "retired"])
    }).expect("write excel error!");

    let mut sheet = wb.create_sheet("Sheet2");
    wb.write_sheet(&mut sheet, |sheet_writer| {
        let sw = sheet_writer;
        sw.append_row(row!["Name", "Title","Success","Remark"])?;
        sw.append_row(row!["Amy", "Manager", true])
    }).expect("write excel error!");

    wb.close().expect("close excel error!");
}

Todo

  • support style

Change Log

0.2.0 (2022-03-11)

  • support WASM !

0.1.9 (2021-10-28)

  • support formula
  • support NaiveDate & NaiveDateTime
  • format dates and date times
  • Sheet name validation
  • remove unndecessary bzip2 dependency

many thanks to all contributors !

0.1.7 (2020-04-29)

  • support create-in-memory mode, thanks to Maxburke.
This change creates all worksheet files in-memory and only writes them
to disk once the XLSX file is closed.

A new option for creating a version that is in-memory only is available
with `Worksheet::create_in_memory()` which returns the buffer holding
the completed XLSX file contents when closed.

0.1.6 (2020-04-06)

  • support shared strings between worksheets, thanks to Mikael Edlund.

0.1.5 (2019-03-21)

  • support Windows platform, thanks to Carl Fredrik Samson.

0.1.4 (2017-03-24)

  • escape xml characters.

0.1.3 (2017-01-03)

  • support 26+ columns .
  • fix column width bug.

0.1.2 (2017-01-02)

  • support multiple sheets

0.1 (2017-01-01)

  • generate the basic xlsx file

License

Apache-2.0

Dependencies

~1.1–2MB
~40K SLoC