All notable changes to rust_xlsxwriter will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
-
Added support for adding a worksheet
Table
as a serialization format. SeeSerializeFieldOptions::set_table()
. -
Added
Worksheet::get_serialize_dimensions()
andWorksheet::get_serialize_column_dimensions()
methods to get dimensions from a serialized range. -
Updated polars dependency to 0.36.2 to pick up Polars
AnyData
changes forpolars_excel_writer
.
- Changed APIs for
Table
to returnTable
instead of&Table
to allow methods to be chained. This makes worksheet Table usage easier during serialization. Note that this is a backward incompatible change.
-
Added support for a
XlsxSerialize
derive and struct attributes to control the formatting and options of the Excel output during serialization. These are similar in intention to Serde container/field attributes.See Controlling Excel output via
XlsxSerialize
and struct attributes and Working with Serde. -
Added
XlsxError::CustomError
as a target error for external crates/apps.
-
Added support for setting Serde headers using deserialization of a target struct type as well as the previous method of using serialization and an instance of the struct type. See Setting serialization headers.
-
Added additional support for serialization header and field options via
CustomSerializeField
. -
Added support for writing
Result<T, E>
withworksheet.write()
whenT
andE
are supported types.
- Added
serialize_chrono_option_naive_to_excel()
to help serialization ofOption
Chrono types. Feature Request #62.
- Added serialization support for
ExcelDateTime
andChrono
date/time types. See Working with Serde - Serializing dates and times.
-
Added support for Serde serialization. This requires the
serde
feature flag to be enabled. See Working with Serde. -
Added support for writing
u64
andi64
number within Excel's limitations. This implies a loss of precision outside Excel's integer range of +/- 999,999,999,999,999 (15 digits).
-
Changed some of the Conditional Format interfaces introduced in the previous release to use extended enums. This is an API change with the version released earlier this week but it provides a cleaner interface.
-
Added support for
Option<T>
wrapped types toworksheet.write()
.
- Added support for conditional formatting. See Working with Conditional Formats.
-
Added option to add a chart data table to charts via the
Chart::set_data_table()
andChartDataTable
. -
Added option to set the display units on a Y-axis to units such as Thousands or Millions via the
ChartAxis::set_display_unit_type()
method. -
Added option to set the crossing position of axes via the
ChartAxis::set_crossing()
method. -
Added option to set the axes label alignment via the
ChartAxis::set_label_alignment()
method. -
Added option to turn on/off line smoothing for Line and Scatter charts via the
ChartSeries::set_smooth()
method.
-
Added support for Excel Stock charts. See the Stock Chart cookbook example.
-
Added support to charts for:
- Up-Down bars via the
Chart::set_up_down_bars()
struct and methods. - High-Low lines via the
Chart::set_high_low_lines()
struct and methods. - Drop lines via the
Chart::set_high_low_lines()
struct and methods. - Chart axis support for Date, Text and Automatic axes via the
ChartAxis::set_date_axis()
,ChartAxis::set_text_axis()
andChartAxis::set_automatic_axis()
methods. - Chart axis support for minimum and maximum date values via the
ChartAxis::set_min_date()
andChartAxis::set_max_date()
methods.
- Up-Down bars via the
-
Add worksheet syntactic helper methods
Worksheet::write_row_with_format()
andWorksheet::write_column_with_format()
.
- Added support for chart series error bars via the
ChartErrorBars
struct and methods.
-
Fixed XML error in non-Pie charts.
-
Added support for chart gradient fill formatting via the
ChartGradientFill
struct and methods. -
Added support for formatting the chart trendlines data labels via the
ChartTrendline::set_label_font
andChartTrendline::set_label_format
.
-
Added support for chart trendlines (Linear, Polynomial, Moving Average, etc.) via the
ChartTrendline
struct and methods. -
Added the
worksheet.set_very_hidden()
method to hide a worksheet similar to theworksheet.set_hidden()
method. The difference is that the worksheet can only be unhidden by VBA and cannot be unhidden in the the Excel user interface. -
Added support for leader lines to non-Pie charts.
- Fixed handling of future functions in table formulas.
-
Added chart options to control how non-data cells are displayed.
- Updated Polar's dependency and
PolarError
import to reflect changes in Polars v 0.33.2.
- Added support for custom total formulas to
TableFunction
.
-
Added
wasm
feature flag to help compilation on Wasm/Javascript targets. Also added mapping from aXlsxError
to aJsValue
error.See the rust_xlsx_wasm_example sample application that demonstrates accessing
rust_xlsxwriter
code from JavaScript, Node.js, Deno and Wasmtime. -
Added
workbook.save_to_writer()
method to make it easier to interact with interfaces that implement the<W: Write>
trait.
- Added
polars
feature flag to help interoperability with Polars. Currently it only implementsPolarsError
andXlsxError
mapping but other functionality may be added in the future. These changes are added to support thepolars_excel_writer
crate.
-
Fixed "multiply with overflow" issue when image locations in the worksheet were greater than the maximum
u32
value.Related to GitHub Issue #51.
- Added threading into the backend worksheet writing for increased performance with large multi-worksheet files.
- Added support for worksheet
Table
header and cell formatting via thetablecolumn.set_format()
andtablecolumn.set_header_format()
methods.
-
Made the
chrono
feature optionally off instead of optionally on. Thechrono
feature must now be explicitly enabled to allow support forChrono
types. -
Renamed the worksheet
write_datetime()
method to the API consistentwrite_datetime_with_format()
and introduced a newwrite_datetime()
method that doesn't take a format. This is required to fix a error in the APIs that prevented an unformatted datetime from taking the row or column format.Note: This is a backwards incompatible change.
See GitHub Issue #47.
-
Added a Tutorial and Cookbook section to the
doc.rs
documentation. -
Added a check, and and error result, for case-insensitive duplicate sheet names. Also added sheet name validation to chart series.
See GitHub Issue #45.
-
Added cell range name handling utility functions:
column_number_to_name()
- Convert a zero indexed column cell reference to a string like"A"
.column_name_to_number()
- Convert a column string such as"A"
to a zero indexed column reference.row_col_to_cell()
- Convert zero indexed row and column cell numbers to aA1
style string.row_col_to_cell_absolute()
- Convert zero indexed row and column cell numbers to an absolute$A$1
style range string.cell_range()
- Convert zero indexed row and col cell numbers to aA1:B1
style range string.cell_range_absolute()
- Convert zero indexed row and col cell numbers to an absolute$A$1:$B$1
-
Added the native
ExcelDateTime
struct to allow handling of dates and times without a dependency on theChrono
library. The Chrono library is now an optional feature/dependency. It is included by default in this release for compatibility with previous versions but it will be optionally off in the next and subsequent versions.All date/time APIs support both the native
ExcelDateTime
andChrono
types via theIntoExcelDateTime
trait.The
worksheet.write_date()
andworksheet.write_time()
methods have been moved to "undocumented" since the same functionality is available viaworksheet.write_datetime()
. This is a soft deprecation.
-
Added support for worksheet tables. See
Table
and theworksheet.add_table()
method. -
Added support for the
bool
type in the genericworksheet.write()
method.
-
Added
worksheet.write_row()
,worksheet.write_column()
,worksheet.write_row_matrix()
andworksheet.write_column_matrix()
methods to write arrays/iterators of data. -
Added
Formula
andUrl
types to use with genericworksheet.write()
. -
Make several string handling APIs more generic using
impl Into<String>
. -
Renamed/refactored
XlsxColor
toColor
for API consistency. TheXlsxColor
type alias is still available for backward compatibility.
-
Added several Chart axis and series methods:
chartaxis.set_hidden()
chartaxis.set_label_interval()
chartaxis.set_label_position()
chartaxis.set_log_base()
chartaxis.set_major_gridlines()
chartaxis.set_major_gridlines_line()
chartaxis.set_major_tick_type()
chartaxis.set_major_unit()
chartaxis.set_max()
chartaxis.set_min()
chartaxis.set_minor_gridlines()
chartaxis.set_minor_gridlines_line()
chartaxis.set_minor_tick_type()
chartaxis.set_minor_unit()
chartaxis.set_position_between_ticks()
chartaxis.set_reverse()
chartaxis.set_tick_interval()
chartseries.set_invert_if_negative()
chartseries.set_invert_if_negative_color()
-
Added font formatting support to chart titles, legends, axes and data labels via
ChartFont
and variousset_font()
methods. -
Made
worksheet.write_string()
andworksheet.write()
more generic viaimpl Into<String>
to allow them to handle&str
,&String
,String
, andCow<>
types.
Fix cargo/release issue with 0.36.0 release.
- Added performance improvement for applications that use a lot of
Format
objects. GitHub Issue #30.
- Fixed issue introduced in v0.34.0 where
Rc<>
value was blockingSend
in multithreaded applications. GitHub Issue #29.
- Added support for Chart Series data labels including custom data labels. See
ChartDataLabel
,chart.series.set_data_label()
andchart.series.set_custom_data_labels()
.
Performance improvement release.
-
Added optimizations across the library. For larger files this version is 10% faster than previous versions.
These optimizations were provided by Adrián Delgado, see GitHub Issue #23.
-
Added crate feature
zlib
which adds a dependency on zlib and a C compiler but is around 1.6x faster for larger files. With this feature enabled it is even faster than the native C version libxlsxwriter by around 1.4x for large files.See also the Performance section of the user guide.
-
Added support for formatting and setting chart points via the
ChartPoint
struct. This is mainly useful as the way of specifying segment colors in Pie charts.See the updated Pie Chart example in the user guide.
-
Added support for formatting and setting chart markers via the
ChartMarker
struct. -
Added
chart.set_rotation()
andchart.set_hole_size()
methods for Pie and Doughnut charts. -
Added support to differentiate between
XlsxColor::Default
andXlsxColor::Automatic
colors for Excel elements. These are usually equivalent but there are some cases where the "Automatic" color, which can be set at a system level, is different from the Default color.
- Added formatting for the chart title and axes via the the
ChartFormat
struct.
- Added formatting for the chart area, plot area, and legend via the the
ChartFormat
struct.
-
Added chart formatting for Lines, Borders, Solid fills and Pattern fills via the
ChartFormat
struct. This is currently only available for chart series but it will be extended in the next release for most other chart elements.See also the Chart Fill Pattern example in the user guide.
-
Added
IntoColor
trait to allow syntactic shortcuts forXlsxColor
parameters in methods. So now you can set a RGB color like thisobject.set_color("#FF7F50")
instead of the more verboseobject.set_color(XlsxColor::RGB(0xFF7F50))
. This addition doesn't require any API changes from the end user. -
Added
worksheet.insert_image_fit_to_cell()
method to add an image to a worksheet and scale it so that it fits in a cell. This method can be useful when creating a product spreadsheet with a column of images for each product.See also the insert_image_to_fit example in the user guide.
-
Added
chart.series.set_gap()
andchart.series.set_overlap()
method to control layout of histogram style charts.
-
Added support for resizing and object positioning to the
Chart
struct. -
Added handling for
chrono
date/time types to the genericworksheet.write()
method.
- Added support for positioning or hiding Chart legends. See
ChartLegend
.
-
Added support for Charts via the
Chart
struct and theworksheet.insert_chart()
method. See also the Chart Examples in the user guide. -
Added a generic
worksheet.write()
method that writes string or number types. This will be extended in an upcoming release to provide a singlewrite()
method for all of the currently supported types.It also allows the user to extend
worksheet.write()
to handle user defined types via theIntoExcelData
trait. See also the Writing Generic data example in the user guide.
Note: this version contains a major refactoring/renaming of some of the main data writing functions and some of the enums and secondary structs. This will require code changes from all current users but will allow more consistent APIs in future releases. Nevertheless, I apologize for this level of change.
-
The following worksheet functions have changed names to reflect their frequency of usage.
Previous name New name write_string_only()
write_string()
write_number_only()
write_number()
write_formula_only()
write_formula()
write_boolean_only()
write_boolean()
write_rich_string_only()
write_rich_string()
write_array_formula_only()
write_array_formula()
write_dynamic_array_formula_only()
write_dynamic_array_formula()
write_array_formula()
write_array_formula_with_format()
write_boolean()
write_boolean_with_format()
write_dynamic_array_formula()
write_dynamic_array_formula_with_format()
write_formula()
write_formula_with_format()
write_number()
write_number_with_format()
write_rich_string()
write_rich_string_with_format()
write_string()
write_string_with_format()
-
The following enums and structs have changed to a more logical naming:
Previous name New name XlsxAlign
FormatAlign
XlsxBorder
FormatBorder
XlsxDiagonalBorder
FormatDiagonalBorder
XlsxPattern
FormatPattern
XlsxScript
FormatScript
XlsxUnderline
FormatUnderline
XlsxObjectMovement
ObjectMovement
XlsxImagePosition
HeaderImagePosition
ProtectWorksheetOptions
ProtectionOptions
Properties
DocProperties
-
The
DocProperties::set_custom_property()
method replaces several type specific methods with a single trait based generic method.
-
Added ability to filter columns in
worksheet.autofilter()
ranges viaworksheet.filter_column()
andFilterCondition
.The library automatically hides any rows that don't match the supplied criteria. This is an additional feature that isn't available in the other language ports of "xlsxwriter".
See also the Working with Autofilters section of the Users Guide.
- Added support for hiding rows and columns (to hide intermediate calculations)
via the
worksheet.set_column_hidden()
andworksheet.set_row_hidden()
method. This is also a required precursor to adding autofilter conditions. - Added the ObjectMovement enum to control how a worksheet object, such a an image, moves when the cells underneath it are moved, resized or deleted.
Added more page setup methods.
- Added
worksheet.set_selection()
method to select a cell or range of cells in a worksheet. - Added
worksheet.set_top_left_cell()
method to set the top and leftmost visible cell. - Added
worksheet.set_page_breaks()
method to add page breaks to a worksheet.
-
Added support for worksheet protection via the
worksheet.protect()
,worksheet.protect_with_password()
andworksheet.protect_with_options()
.See also the section on Worksheet protection in the user guide.
-
Add option to make the xlsx file read-only when opened by Excel via the
workbook.read_only_recommended()
method.
- Added support for setting document metadata properties such as Author and
Creation Date. For more details see
DocProperties
andworkbook::set_properties()
.
- Change date/time parameters to references in
worksheet.write_datetime()
,worksheet.write_date()
andworksheet.write_time()
for consistency.
- Improved fitting algorithm for
worksheet.autofit()
. See also the app_autofit sample application.
- The
worksheet.set_autofit()
method has been renamed toworksheet.autofit()
for consistency with the other language versions of this library.
-
Added support for created defined variable names at a workbook and worksheet level via
workbook.define_name()
.See also Using defined names in the user guide.
-
Added initial support for autofilters via
worksheet.autofilter()
.Note, adding filter criteria isn't currently supported. That will be added in an upcoming version. See also Adding Autofilters in the user guide.
-
Added support for "rich" strings with multiple font formats via
worksheet.write_rich_string()
andworksheet.write_rich_string_with_format()
. For example strings like "This is bold and this is italic".See also the Rich strings example in the user guide.
- Fixes issue where header image files became corrupt during incremental saves. Also fixes similar issues in some formatting code.
-
Added support for images in headers/footers via the
worksheet.set_header_image()
andworksheet.set_footer_image()
methods.See the Headers and Footers and Adding a watermark examples in the user guide.
- Replicate the optimization used by Excel where it only stores one copy of a repeated/duplicate image in a workbook.
-
Added support for images in buffers via
image.new_from_buffer()
. -
Added image accessability features via
image.set_alt_text()
andimage.set_decorative()
.
-
Added support for inserting images into worksheets with
worksheet.insert_image()
andworksheet.insert_image_with_offset()
and the Image struct.See also the images example in the user guide.
Upcoming versions of the library will support additional image handling features such as EMF and WMF formats, removal of duplicate images, hyperlinks in images and images in headers/footers.
- The
workbook.save()
method has been extended to handle paths or strings. Theworkbook.save_to_path()
method has been removed. See PR #15.
-
Added support for writing hyperlinks in worksheets via the following methods:
worksheet.write_url()
to write a link with a default hyperlink format style.worksheet.write_url_with_text()
to add alternative text to the link.worksheet.write_url_with_format()
to add an alternative format to the link.worksheet.write_url_with_options()
to add a screen tip and all other options to the link.
See also the hyperlinks example in the user guide.
-
Dependency changes to make WASM compilation easier:
- Reduced the
zip
dependency to the minimum import only. - Removed dependency on
tempfile
. The library now uses in memory files.
- Reduced the
- Added
worksheet.merge_range()
method. - Added support for Theme colors to
XlsxColor
. See also Working with Colors in the user guide.
-
Added several worksheet methods for working with worksheet tabs:
worksheet.set_active()
: Set the active/visible worksheet.worksheet.set_tab_color()
: Set the tab color.worksheet.set_hidden()
: Hide a worksheet.worksheet.set_selected()
: Set a worksheet as selected.worksheet.set_first_tab()
: Set the first visible tab.
See also Working with worksheet tabs in the user guide.
-
Added a simulated
worksheet.autofit()
method to automatically adjust the width of columns with data. See also the app_autofit sample application. -
Added the
worksheet.set_freeze_panes()
method to set "freeze" panes for worksheets. See also the app_panes example application.
Note, this version contains a major backward incompatible API change where it
restructures the Workbook constructor/destructor sequence and introduces a
save()
method to replace close()
.
- The
Workbook::new()
method no longer takes a filename. Instead the naming of the file has move to aworkbook.save()
method which replacesworkbook.close()
. - There are now supporting
workbook.save_to_path()
andworkbook.save_to_buffer()
methods.
-
Added new methods to get references to worksheet objects used by the workbook:
-
Made the
Worksheet::new()
method public and added theworkbook.push_worksheet()
to add Worksheet instances to a Workbook. See also therust_xlsxwriter
documentation on Creating Worksheets and working with the borrow checker.
-
Added support for creating files from paths via
workbook.new_from_path()
. -
Added support for creating file to a buffer via
workbook.new_from_buffer()
andworkbook.close_to_buffer()
.
-
Added an almost the complete set of Page Setup methods:
-
Page Setup - Page
-
Page Setup - Margins
-
Page Setup - Header/Footer
-
Page Setup - Sheet
- Fix for cargo issue where chrono dependency had a RUSTSEC warning. GitHub Issue #6.
-
Added more page setup methods:
See also the rust_xlsxwriter user documentation on Adding Headers and Footers.
-
Added page setup methods:
- Added support for array formulas and dynamic array formulas via
worksheet.write_array()
andworksheet.write_dynamic_array_formula_with_format()
.
See also the rust_xlsxwriter user documentation on Dynamic Array support.
- Fixed minor crate issue.
- Added
worksheet.write_boolean_with_format()
method to support writing Excel boolean values.
- Fixed some minor crate/publishing issues.
- First functional version. Supports the main data types and formatting.
- Initial, non-functional crate, to initiate namespace.