• Stars
    star
    247
  • Rank 159,313 (Top 4 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Excel file writer for Rust

xlsxwriter-rs

Build GitHub GitHub top language Crates.io Docs.rs

Rust binding of libxlsxwriter

Supported Features

  • 100% compatible Excel XLSX files.
  • Full Excel formatting.
  • Merged cells.
  • Autofilters.
  • Data validation and drop down lists.
  • Worksheet PNG/JPEG images.

Coming soon

  • Charts.

Feature Flags

  • no-md5: Disable image de-duplication and remove md5 function. (See upstream document to learn more).
  • use-openssl-md5: Use OpenSSL implementation of md5 function. (See upstream document to learn more).
  • system-zlib: Use system zlib instead of included zlib.

Build requirements

  • LLVM and clang

How to build on windows

  1. Install Visual Studio
  2. Install LLVM
  3. Set environment variable LIBCLANG_PATH as C:\Program Files\LLVM\bin
  4. Run build

Example

Result Image

let workbook = Workbook::new("target/simple1.xlsx")?;
let format1 = workbook.add_format().set_font_color(FormatColor::Red);

let format2 = workbook
    .add_format()
    .set_font_color(FormatColor::Blue)
    .set_underline(FormatUnderline::Single);

let format3 = workbook
    .add_format()
    .set_font_color(FormatColor::Green)
    .set_align(FormatAlignment::CenterAcross)
    .set_align(FormatAlignment::VerticalCenter);

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

sheet1.set_selection(1, 0, 1, 2);
sheet1.set_tab_color(FormatColor::Cyan);
workbook.close()?;

Run Example with Cargo

You can explore this example locally following the steps below:

  1. Install LLVM and set LIBCLANG_PATH if you are using windows. (see bindgen doc for details)
  2. clone or fork this repository
  3. git submodule update --init --recursive
    • The above command downloads the required C library so we can compile
  4. cargo run --example hello_spreadsheet

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

More Repositories

1

transanno

accurate LiftOver tool for new genome assemblies
Rust
84
star
2

tableview

Format CSV file as human readable table
Go
38
star
3

vcf-rs

Rust implmentation of VCF parser
Rust
22
star
4

bgzip-rs

bgzip support for Rust
Rust
14
star
5

warp-embed

provides embedded files by warp
Rust
13
star
6

Hyokai

Database Viewer for SQLite, MySQL, PostgreSQL, designed for BigData analysis
C
11
star
7

websockify-rs

Rust implementation of websockify
Rust
9
star
8

Matataki

Ultrafast mRNA Quantification software for RNA-Seq
HTML
8
star
9

axum-embed

axum_embed is a library that provides a service for serving embedded files using the axum web framework.
Rust
7
star
10

Qt-BSch3V-Modified

Simple Schematic Editor
C++
6
star
11

excel2csv

XLS/XLSX/CSV/TSV Converter
Java
5
star
12

autocompress-rs

Automatically select suitable decoder from magic bytes
Rust
5
star
13

bioslimcontainers

Slim containers for bioinformatics based on alpine linux
Dockerfile
4
star
14

wirelessloader

Bootloader for AVR devices, optimized to write via wireless usart access.
C++
4
star
15

networkxxgmml

XGMML parser for networks
Python
4
star
16

centos7-xrdp

Cent OS 7 with XRDP server
Shell
4
star
17

android-nativetools

Linux tools for Android
Shell
3
star
18

csv2xlsx

CSV to Xlsx file conveter
C
3
star
19

VennDraw

Venn Diagram Draw
Java
3
star
20

Yet-Another-Kyoto-Cabinet-Python-Binding

Use Kyoto Cabinet like python dictionary
C++
3
star
21

geniatagger-python

Python library for GeneiaTagger
Python
2
star
22

smc

Apple System Management Control (SMC) Tool
C
2
star
23

shellflow

Shell script like workflow managmenet software
Go
2
star
24

jsonwebkey-rs

Convert RSA Public Key between PEM and JWK
Rust
2
star
25

dataclustering4j

Hierarchical Data Clustering Tool
Java
2
star
26

chef-cookbook-rhodecode

Install and configure rhodecode
Python
1
star
27

ftditerm

FTDI Terminal with libftdi
Shell
1
star
28

android-native-tools-builder

Build Native Android Tools in Docker
Shell
1
star
29

linkdown

Build static webpages with Markdown, reStructuredText, Jinja2 templates, LESS or some recent tools.
JavaScript
1
star
30

QtSimplePlot

a library for simple plotting
C++
1
star
31

bwa-mem2-docker

Docker image for bwa-mem2
Dockerfile
1
star
32

ericscript-docker

Docker Image for EricScript
Dockerfile
1
star
33

FrozenHashMap

Fast Immutable Hash Map
C++
1
star
34

msisensor-docker

Docker image for msisensor
Dockerfile
1
star
35

sequencetoolkit

Toolkit for genome sequence analysis
Rust
1
star
36

slurminfo

Show SLURM status as human friendly
C
1
star
37

centos7-vnc

Cent OS 7 with TurboVNC
Shell
1
star
38

chef-cookbook-sge

Prepare Son of GridEngine installation
Ruby
1
star
39

CppFasta

FASTA and FASTQ parser for C++
C++
1
star