Skip to content

Julia wrapper for libxlsxwriter_jll. libxlsxwriter is a C library for creating Excel XLSX files.

License

Notifications You must be signed in to change notification settings

jaakkor2/LibXLSXWriter.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LibXLSXWriter.jl

LibXLSXWriter is a package for creating Excel XSLX files based on libxlsxwriter. This package wraps the C API, see the full documentation for the getting started guide, a tutorial, the main API documentation and examples.

This wrapper depends on libxlsxwriter_jll.

Here is an example that creates the same spreadsheet as in demo.c. See the test folder for more examples of the Julia syntax.

using LibXLSXWriter: workbook_new, workbook_add_worksheet, workbook_add_format, format_set_bold, worksheet_set_column, worksheet_write_string, worksheet_write_number, worksheet_insert_image, workbook_close

# Create a new workbook and add a worksheet.
workbook  = workbook_new("demo.xlsx")
worksheet = workbook_add_worksheet(workbook)

# Add a format.
format = workbook_add_format(workbook)

# Set the bold property for the format
format_set_bold(format)

# Change the column width for clarity.
worksheet_set_column(worksheet, 0, 0, 20)

# Write some simple text.
worksheet_write_string(worksheet, 0, 0, "Hello")

# Text with formatting.
worksheet_write_string(worksheet, 1, 0, "World", format)

# Write some numbers.
worksheet_write_number(worksheet, 2, 0, 123)
worksheet_write_number(worksheet, 3, 0, 123.456)

# Insert an image.
worksheet_insert_image(worksheet, 1, 2, "logo.png")

workbook_close(workbook)

Build Status

About

Julia wrapper for libxlsxwriter_jll. libxlsxwriter is a C library for creating Excel XLSX files.

Topics

Resources

License

Stars

Watchers

Forks

Languages