|
libxlsxwriter
|
Functions | |
| const char * | lxw_version (void) |
| Retrieve the library version. | |
| uint16_t | lxw_version_id (void) |
| Retrieve the library version ID. | |
| char * | lxw_strerror (lxw_error error_num) |
| Converts a libxlsxwriter error number to a string. | |
| double | lxw_datetime_to_excel_datetime (lxw_datetime *datetime) |
| Converts a lxw_datetime to an Excel datetime number. | |
| double | lxw_datetime_to_excel_date_with_epoch (lxw_datetime *datetime, uint8_t use_1904_epoch) |
| Converts a lxw_datetime to an Excel datetime number with 1900/1904 epoch. | |
| double | lxw_unixtime_to_excel_date (int64_t unixtime) |
| Converts a unix datetime to an Excel datetime number. | |
| double | lxw_unixtime_to_excel_date_with_epoch (int64_t unixtime, uint8_t use_1904_epoch) |
| Converts a unix datetime to an Excel datetime number with 1900/1904 epoch. | |
| const char * lxw_version | ( | void | ) |
Get the library version as a "X.Y.Z" version string
| uint16_t lxw_version_id | ( | void | ) |
Get the library version such as "X.Y.Z" as a XYZ integer.
| char * lxw_strerror | ( | lxw_error | error_num | ) |
The lxw_strerror function converts a libxlsxwriter error number defined by lxw_error to a pointer to a string description of the error. Similar to the standard library strerror(3) function.
For example:
This would produce output like the following if the target file wasn't writable:
Error in workbook_close(). Error 2 = Error creating output xlsx file. Usually a permissions error.
| error_num | The error number returned by a libxlsxwriter function. |
| double lxw_datetime_to_excel_datetime | ( | lxw_datetime * | datetime | ) |
| datetime | A pointer to a lxw_datetime struct. |
The lxw_datetime_to_excel_datetime() function converts a datetime in lxw_datetime to an Excel datetime number:
See Working with Dates and Times for more details on the Excel datetime format.
| double lxw_datetime_to_excel_date_with_epoch | ( | lxw_datetime * | datetime, |
| uint8_t | use_1904_epoch | ||
| ) |
This function is similar to lxw_datetime_to_excel_datetime() but it allows you to specify whether to use the 1900 or 1904 epoch. See also the workbook_use_1904_epoch() function.
| datetime | A pointer to a lxw_datetime struct. |
| use_1904_epoch | A flag to indicate whether to use the 1904 epoch (true) or the 1900 epoch (false). |
| double lxw_unixtime_to_excel_date | ( | int64_t | unixtime | ) |
| unixtime | Unix time (seconds since 1970-01-01) |
The lxw_unixtime_to_excel_date() function converts a unix datetime to an Excel datetime number:
See Working with Dates and Times for more details.
| double lxw_unixtime_to_excel_date_with_epoch | ( | int64_t | unixtime, |
| uint8_t | use_1904_epoch | ||
| ) |
This function is similar to lxw_unixtime_to_excel_date() but it allows you to specify whether to use the 1900 or 1904 epoch. See also the workbook_use_1904_epoch() function.
| unixtime | Unix time (seconds since 1970-01-01) |
| use_1904_epoch | A flag to indicate whether to use the 1904 epoch (true) or the 1900 epoch (false). |
| #define CELL | ( | cell | ) | lxw_name_to_row(cell), lxw_name_to_col(cell) |
Convert an Excel A1 cell string into a (row, col) pair.
This is a little syntactic shortcut to help with worksheet layout:
This macro shouldn't be used in performance critical situations since it expands to two function calls.
| #define COLS | ( | cols | ) | lxw_name_to_col(cols), lxw_name_to_col_2(cols) |
Convert an Excel A:B column range into a (col1, col2) pair.
This is a little syntactic shortcut to help with worksheet layout:
| #define RANGE | ( | range | ) |
Convert an Excel A1:B2 range into a (first_row, first_col, last_row, last_col) sequence.
This is a little syntactic shortcut to help with worksheet layout.
Macros | |
| #define | CELL(cell) lxw_name_to_row(cell), lxw_name_to_col(cell) |
Convert an Excel A1 cell string into a (row, col) pair. | |
| #define | COLS(cols) lxw_name_to_col(cols), lxw_name_to_col_2(cols) |
Convert an Excel A:B column range into a (col1, col2) pair. | |
| #define | RANGE(range) |
Convert an Excel A1:B2 range into a (first_row, first_col, last_row, last_col) sequence. | |