fast_excel 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.travis.yml +4 -0
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +16 -16
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/fast_excel.gemspec +1 -1
- data/lib/fast_excel.rb +21 -5
- data/lib/fast_excel/binding/format.rb +3 -3
- data/libxlsxwriter/.drone.yml +27 -0
- data/libxlsxwriter/.indent.pro +3 -0
- data/libxlsxwriter/.travis.yml +12 -0
- data/libxlsxwriter/CMakeLists.txt +348 -0
- data/libxlsxwriter/Changes.txt +78 -0
- data/libxlsxwriter/LICENSE.txt +65 -4
- data/libxlsxwriter/Makefile +27 -7
- data/libxlsxwriter/Readme.md +2 -0
- data/libxlsxwriter/appveyor.yml +65 -0
- data/libxlsxwriter/cmake/FindMINIZIP.cmake +121 -0
- data/libxlsxwriter/cmake/FindPackage.cmake +183 -0
- data/libxlsxwriter/cmake/FindZLIB.cmake +123 -0
- data/libxlsxwriter/cmake/i686-toolchain.cmake +7 -0
- data/libxlsxwriter/cocoapods/libxlsxwriter-umbrella.h +1 -1
- data/libxlsxwriter/cocoapods/libxlsxwriter.modulemap +2 -2
- data/libxlsxwriter/include/xlsxwriter.h +2 -2
- data/libxlsxwriter/include/xlsxwriter/app.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/chart.h +109 -8
- data/libxlsxwriter/include/xlsxwriter/common.h +10 -2
- data/libxlsxwriter/include/xlsxwriter/content_types.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/core.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/custom.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/drawing.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/format.h +6 -6
- data/libxlsxwriter/include/xlsxwriter/hash_table.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/packager.h +6 -1
- data/libxlsxwriter/include/xlsxwriter/relationships.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/shared_strings.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/styles.h +2 -2
- data/libxlsxwriter/include/xlsxwriter/theme.h +1 -1
- data/libxlsxwriter/include/xlsxwriter/utility.h +11 -5
- data/libxlsxwriter/include/xlsxwriter/workbook.h +3 -3
- data/libxlsxwriter/include/xlsxwriter/worksheet.h +517 -39
- data/libxlsxwriter/include/xlsxwriter/xmlwriter.h +2 -2
- data/libxlsxwriter/libxlsxwriter.podspec +4 -2
- data/libxlsxwriter/src/Makefile +30 -5
- data/libxlsxwriter/src/app.c +1 -1
- data/libxlsxwriter/src/chart.c +76 -19
- data/libxlsxwriter/src/content_types.c +1 -1
- data/libxlsxwriter/src/core.c +10 -10
- data/libxlsxwriter/src/custom.c +2 -2
- data/libxlsxwriter/src/drawing.c +1 -1
- data/libxlsxwriter/src/format.c +3 -3
- data/libxlsxwriter/src/hash_table.c +1 -1
- data/libxlsxwriter/src/packager.c +20 -7
- data/libxlsxwriter/src/relationships.c +1 -1
- data/libxlsxwriter/src/shared_strings.c +1 -1
- data/libxlsxwriter/src/styles.c +4 -4
- data/libxlsxwriter/src/theme.c +1 -1
- data/libxlsxwriter/src/utility.c +41 -1
- data/libxlsxwriter/src/workbook.c +8 -6
- data/libxlsxwriter/src/worksheet.c +748 -31
- data/libxlsxwriter/src/xmlwriter.c +2 -2
- data/libxlsxwriter/third_party/minizip/Makefile +6 -1
- data/libxlsxwriter/version.txt +1 -1
- data/test/reopen_test.rb +22 -0
- data/test/test_helper.rb +8 -5
- data/test/validations_test.rb +27 -0
- metadata +11 -2
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
* libxlsxwriter
|
3
3
|
*
|
4
|
-
* Copyright 2014-
|
4
|
+
* Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
|
5
5
|
*/
|
6
6
|
|
7
7
|
/**
|
@@ -9,7 +9,7 @@
|
|
9
9
|
*
|
10
10
|
* @brief Common functions and defines for the libxlsxwriter library.
|
11
11
|
*
|
12
|
-
* <!-- Copyright 2014-
|
12
|
+
* <!-- Copyright 2014-2018, John McNamara, jmcnamara@cpan.org -->
|
13
13
|
*
|
14
14
|
*/
|
15
15
|
#ifndef __LXW_COMMON_H__
|
@@ -89,6 +89,9 @@ typedef enum lxw_error {
|
|
89
89
|
/** Worksheet name is already in use. */
|
90
90
|
LXW_ERROR_SHEETNAME_ALREADY_USED,
|
91
91
|
|
92
|
+
/** Parameter exceeds Excel's limit of 32 characters. */
|
93
|
+
LXW_ERROR_32_STRING_LENGTH_EXCEEDED,
|
94
|
+
|
92
95
|
/** Parameter exceeds Excel's limit of 128 characters. */
|
93
96
|
LXW_ERROR_128_STRING_LENGTH_EXCEEDED,
|
94
97
|
|
@@ -265,9 +268,14 @@ enum lxw_custom_property_types {
|
|
265
268
|
(((n) & 0xFF0000) >> 8) | \
|
266
269
|
(((n) & 0xFF000000) >> 24))
|
267
270
|
#define LXW_UINT16_NETWORK(n) ((((n) & 0x00FF) << 8) | (((n) & 0xFF00) >> 8))
|
271
|
+
#define LXW_UINT32_HOST(n) (n)
|
268
272
|
#else
|
269
273
|
#define LXW_UINT32_NETWORK(n) (n)
|
270
274
|
#define LXW_UINT16_NETWORK(n) (n)
|
275
|
+
#define LXW_UINT32_HOST(n) ((((n) & 0xFF) << 24) | \
|
276
|
+
(((n) & 0xFF00) << 8) | \
|
277
|
+
(((n) & 0xFF0000) >> 8) | \
|
278
|
+
(((n) & 0xFF000000) >> 24))
|
271
279
|
#endif
|
272
280
|
|
273
281
|
/* *INDENT-OFF* */
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
* libxlsxwriter
|
3
3
|
*
|
4
|
-
* Copyright 2014-
|
4
|
+
* Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
|
5
5
|
*
|
6
6
|
* content_types - A libxlsxwriter library for creating Excel XLSX
|
7
7
|
* content_types files.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
* libxlsxwriter
|
3
3
|
*
|
4
|
-
* Copyright 2014-
|
4
|
+
* Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
|
5
5
|
*/
|
6
6
|
|
7
7
|
/**
|
@@ -81,8 +81,8 @@ typedef int32_t lxw_color_t;
|
|
81
81
|
#define LXW_PROPERTY_UNSET -1
|
82
82
|
#define LXW_COLOR_UNSET -1
|
83
83
|
#define LXW_COLOR_MASK 0xFFFFFF
|
84
|
-
#define LXW_MIN_FONT_SIZE 1
|
85
|
-
#define LXW_MAX_FONT_SIZE 409
|
84
|
+
#define LXW_MIN_FONT_SIZE 1.0
|
85
|
+
#define LXW_MAX_FONT_SIZE 409.0
|
86
86
|
|
87
87
|
#define LXW_FORMAT_FIELD_COPY(dst, src) \
|
88
88
|
do{ \
|
@@ -360,7 +360,7 @@ typedef struct lxw_format {
|
|
360
360
|
uint16_t font_index;
|
361
361
|
uint8_t has_font;
|
362
362
|
uint8_t has_dxf_font;
|
363
|
-
|
363
|
+
double font_size;
|
364
364
|
uint8_t bold;
|
365
365
|
uint8_t italic;
|
366
366
|
lxw_color_t font_color;
|
@@ -427,7 +427,7 @@ typedef struct lxw_format {
|
|
427
427
|
typedef struct lxw_font {
|
428
428
|
|
429
429
|
char font_name[LXW_FORMAT_FIELD_LEN];
|
430
|
-
|
430
|
+
double font_size;
|
431
431
|
uint8_t bold;
|
432
432
|
uint8_t italic;
|
433
433
|
uint8_t underline;
|
@@ -529,7 +529,7 @@ void format_set_font_name(lxw_format *format, const char *font_name);
|
|
529
529
|
* size in the row. You can also explicitly specify the height of a
|
530
530
|
* row using the worksheet_set_row() function.
|
531
531
|
*/
|
532
|
-
void format_set_font_size(lxw_format *format,
|
532
|
+
void format_set_font_size(lxw_format *format, double size);
|
533
533
|
|
534
534
|
/**
|
535
535
|
* @brief Set the color of the font used in the cell.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
* libxlsxwriter
|
3
3
|
*
|
4
|
-
* Copyright 2014-
|
4
|
+
* Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
|
5
5
|
*
|
6
6
|
* packager - A libxlsxwriter library for creating Excel XLSX packager files.
|
7
7
|
*
|
@@ -10,7 +10,12 @@
|
|
10
10
|
#define __LXW_PACKAGER_H__
|
11
11
|
|
12
12
|
#include <stdint.h>
|
13
|
+
|
14
|
+
#ifdef USE_SYSTEM_MINIZIP
|
15
|
+
#include "minizip/zip.h"
|
16
|
+
#else
|
13
17
|
#include "third_party/zip.h"
|
18
|
+
#endif
|
14
19
|
|
15
20
|
#include "common.h"
|
16
21
|
#include "workbook.h"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
* libxlsxwriter
|
3
3
|
*
|
4
|
-
* Copyright 2014-
|
4
|
+
* Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
|
5
5
|
*
|
6
6
|
* relationships - A libxlsxwriter library for creating Excel XLSX
|
7
7
|
* relationships files.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
* libxlsxwriter
|
3
3
|
*
|
4
|
-
* Copyright 2014-
|
4
|
+
* Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
|
5
5
|
*
|
6
6
|
* shared_strings - A libxlsxwriter library for creating Excel XLSX
|
7
7
|
* sst files.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
* libxlsxwriter
|
3
3
|
*
|
4
|
-
* Copyright 2014-
|
4
|
+
* Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
|
5
5
|
*
|
6
6
|
* styles - A libxlsxwriter library for creating Excel XLSX styles files.
|
7
7
|
*
|
@@ -46,7 +46,7 @@ void lxw_styles_assemble_xml_file(lxw_styles *self);
|
|
46
46
|
|
47
47
|
STATIC void _styles_xml_declaration(lxw_styles *self);
|
48
48
|
STATIC void _write_style_sheet(lxw_styles *self);
|
49
|
-
STATIC void _write_font_size(lxw_styles *self,
|
49
|
+
STATIC void _write_font_size(lxw_styles *self, double font_size);
|
50
50
|
STATIC void _write_font_color_theme(lxw_styles *self, uint8_t theme);
|
51
51
|
STATIC void _write_font_name(lxw_styles *self, const char *font_name);
|
52
52
|
STATIC void _write_font_family(lxw_styles *self, uint8_t font_family);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
* libxlsxwriter
|
3
3
|
*
|
4
|
-
* Copyright 2014-
|
4
|
+
* Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
|
5
5
|
*/
|
6
6
|
|
7
7
|
/**
|
@@ -9,7 +9,7 @@
|
|
9
9
|
*
|
10
10
|
* @brief Utility functions for libxlsxwriter.
|
11
11
|
*
|
12
|
-
* <!-- Copyright 2014-
|
12
|
+
* <!-- Copyright 2014-2018, John McNamara, jmcnamara@cpan.org -->
|
13
13
|
*
|
14
14
|
*/
|
15
15
|
|
@@ -18,6 +18,7 @@
|
|
18
18
|
|
19
19
|
#include <stdint.h>
|
20
20
|
#include "common.h"
|
21
|
+
#include "xmlwriter.h"
|
21
22
|
|
22
23
|
/**
|
23
24
|
* @brief Convert an Excel `A1` cell string into a `(row, col)` pair.
|
@@ -145,6 +146,7 @@ uint16_t lxw_name_to_col_2(const char *col_str);
|
|
145
146
|
double lxw_datetime_to_excel_date(lxw_datetime *datetime, uint8_t date_1904);
|
146
147
|
|
147
148
|
char *lxw_strdup(const char *str);
|
149
|
+
char *lxw_strdup_formula(const char *formula);
|
148
150
|
|
149
151
|
size_t lxw_utf8_strlen(const char *str);
|
150
152
|
|
@@ -152,9 +154,13 @@ void lxw_str_tolower(char *str);
|
|
152
154
|
|
153
155
|
FILE *lxw_tmpfile(char *tmpdir);
|
154
156
|
|
155
|
-
/*
|
156
|
-
|
157
|
-
|
157
|
+
/* Use a user defined function to format doubles in sprintf or else a simple
|
158
|
+
* macro (the default). */
|
159
|
+
#ifdef USE_DOUBLE_FUNCTION
|
160
|
+
int lxw_sprintf_dbl(char *data, double number);
|
161
|
+
#else
|
162
|
+
#define lxw_sprintf_dbl(data, number) \
|
163
|
+
lxw_snprintf(data, LXW_ATTR_32, "%.16g", number)
|
158
164
|
#endif
|
159
165
|
|
160
166
|
/* *INDENT-OFF* */
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
* libxlsxwriter
|
3
3
|
*
|
4
|
-
* Copyright 2014-
|
4
|
+
* Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
|
5
5
|
*/
|
6
6
|
|
7
7
|
/**
|
@@ -677,8 +677,8 @@ lxw_error workbook_define_name(lxw_workbook *workbook, const char *name,
|
|
677
677
|
/**
|
678
678
|
* @brief Get a worksheet object from its name.
|
679
679
|
*
|
680
|
-
* @param workbook
|
681
|
-
* @param name
|
680
|
+
* @param workbook Pointer to a lxw_workbook instance.
|
681
|
+
* @param name Worksheet name.
|
682
682
|
*
|
683
683
|
* @return A lxw_worksheet object.
|
684
684
|
*
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
* libxlsxwriter
|
3
3
|
*
|
4
|
-
* Copyright 2014-
|
4
|
+
* Copyright 2014-2018, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
|
5
5
|
*/
|
6
6
|
|
7
7
|
/**
|
@@ -76,14 +76,131 @@
|
|
76
76
|
enum lxw_gridlines {
|
77
77
|
/** Hide screen and print gridlines. */
|
78
78
|
LXW_HIDE_ALL_GRIDLINES = 0,
|
79
|
+
|
79
80
|
/** Show screen gridlines. */
|
80
81
|
LXW_SHOW_SCREEN_GRIDLINES,
|
82
|
+
|
81
83
|
/** Show print gridlines. */
|
82
84
|
LXW_SHOW_PRINT_GRIDLINES,
|
85
|
+
|
83
86
|
/** Show screen and print gridlines. */
|
84
87
|
LXW_SHOW_ALL_GRIDLINES
|
85
88
|
};
|
86
89
|
|
90
|
+
/** Data validation property values. */
|
91
|
+
enum lxw_validation_boolean {
|
92
|
+
LXW_VALIDATION_DEFAULT,
|
93
|
+
|
94
|
+
/** Turn a data validation property off. */
|
95
|
+
LXW_VALIDATION_OFF,
|
96
|
+
|
97
|
+
/** Turn a data validation property on. Data validation properties are
|
98
|
+
* generally on by default. */
|
99
|
+
LXW_VALIDATION_ON
|
100
|
+
};
|
101
|
+
|
102
|
+
/** Data validation types. */
|
103
|
+
enum lxw_validation_types {
|
104
|
+
LXW_VALIDATION_TYPE_NONE,
|
105
|
+
|
106
|
+
/** Restrict cell input to whole/integer numbers only. */
|
107
|
+
LXW_VALIDATION_TYPE_INTEGER,
|
108
|
+
|
109
|
+
/** Restrict cell input to whole/integer numbers only, using a cell
|
110
|
+
* reference. */
|
111
|
+
LXW_VALIDATION_TYPE_INTEGER_FORMULA,
|
112
|
+
|
113
|
+
/** Restrict cell input to decimal numbers only. */
|
114
|
+
LXW_VALIDATION_TYPE_DECIMAL,
|
115
|
+
|
116
|
+
/** Restrict cell input to decimal numbers only, using a cell
|
117
|
+
* reference. */
|
118
|
+
LXW_VALIDATION_TYPE_DECIMAL_FORMULA,
|
119
|
+
|
120
|
+
/** Restrict cell input to a list of strings in a dropdown. */
|
121
|
+
LXW_VALIDATION_TYPE_LIST,
|
122
|
+
|
123
|
+
/** Restrict cell input to a list of strings in a dropdown, using a
|
124
|
+
* cell range. */
|
125
|
+
LXW_VALIDATION_TYPE_LIST_FORMULA,
|
126
|
+
|
127
|
+
/** Restrict cell input to date values only, using a lxw_datetime type. */
|
128
|
+
LXW_VALIDATION_TYPE_DATE,
|
129
|
+
|
130
|
+
/** Restrict cell input to date values only, using a cell reference. */
|
131
|
+
LXW_VALIDATION_TYPE_DATE_FORMULA,
|
132
|
+
|
133
|
+
/* Restrict cell input to date values only, as a serial number.
|
134
|
+
* Undocumented. */
|
135
|
+
LXW_VALIDATION_TYPE_DATE_NUMBER,
|
136
|
+
|
137
|
+
/** Restrict cell input to time values only, using a lxw_datetime type. */
|
138
|
+
LXW_VALIDATION_TYPE_TIME,
|
139
|
+
|
140
|
+
/** Restrict cell input to time values only, using a cell reference. */
|
141
|
+
LXW_VALIDATION_TYPE_TIME_FORMULA,
|
142
|
+
|
143
|
+
/* Restrict cell input to time values only, as a serial number.
|
144
|
+
* Undocumented. */
|
145
|
+
LXW_VALIDATION_TYPE_TIME_NUMBER,
|
146
|
+
|
147
|
+
/** Restrict cell input to strings of defined length, using a cell
|
148
|
+
* reference. */
|
149
|
+
LXW_VALIDATION_TYPE_LENGTH,
|
150
|
+
|
151
|
+
/** Restrict cell input to strings of defined length, using a cell
|
152
|
+
* reference. */
|
153
|
+
LXW_VALIDATION_TYPE_LENGTH_FORMULA,
|
154
|
+
|
155
|
+
/** Restrict cell to input controlled by a custom formula that returns
|
156
|
+
* `TRUE/FALSE`. */
|
157
|
+
LXW_VALIDATION_TYPE_CUSTOM_FORMULA,
|
158
|
+
|
159
|
+
/** Allow any type of input. Mainly only useful for pop-up messages. */
|
160
|
+
LXW_VALIDATION_TYPE_ANY
|
161
|
+
};
|
162
|
+
|
163
|
+
/** Data validation criteria uses to control the selection of data. */
|
164
|
+
enum lxw_validation_criteria {
|
165
|
+
LXW_VALIDATION_CRITERIA_NONE,
|
166
|
+
|
167
|
+
/** Select data between two values. */
|
168
|
+
LXW_VALIDATION_CRITERIA_BETWEEN,
|
169
|
+
|
170
|
+
/** Select data that is not between two values. */
|
171
|
+
LXW_VALIDATION_CRITERIA_NOT_BETWEEN,
|
172
|
+
|
173
|
+
/** Select data equal to a value. */
|
174
|
+
LXW_VALIDATION_CRITERIA_EQUAL_TO,
|
175
|
+
|
176
|
+
/** Select data not equal to a value. */
|
177
|
+
LXW_VALIDATION_CRITERIA_NOT_EQUAL_TO,
|
178
|
+
|
179
|
+
/** Select data greater than a value. */
|
180
|
+
LXW_VALIDATION_CRITERIA_GREATER_THAN,
|
181
|
+
|
182
|
+
/** Select data less than a value. */
|
183
|
+
LXW_VALIDATION_CRITERIA_LESS_THAN,
|
184
|
+
|
185
|
+
/** Select data greater than or equal to a value. */
|
186
|
+
LXW_VALIDATION_CRITERIA_GREATER_THAN_OR_EQUAL_TO,
|
187
|
+
|
188
|
+
/** Select data less than or equal to a value. */
|
189
|
+
LXW_VALIDATION_CRITERIA_LESS_THAN_OR_EQUAL_TO
|
190
|
+
};
|
191
|
+
|
192
|
+
/** Data validation error types for pop-up messages. */
|
193
|
+
enum lxw_validation_error_types {
|
194
|
+
/** Show a "Stop" data validation pop-up message. This is the default. */
|
195
|
+
LXW_VALIDATION_ERROR_TYPE_STOP,
|
196
|
+
|
197
|
+
/** Show an "Error" data validation pop-up message. */
|
198
|
+
LXW_VALIDATION_ERROR_TYPE_WARNING,
|
199
|
+
|
200
|
+
/** Show an "Information" data validation pop-up message. */
|
201
|
+
LXW_VALIDATION_ERROR_TYPE_INFORMATION
|
202
|
+
};
|
203
|
+
|
87
204
|
enum cell_types {
|
88
205
|
NUMBER_CELL = 1,
|
89
206
|
STRING_CELL,
|
@@ -140,6 +257,7 @@ struct lxw_table_rows {
|
|
140
257
|
|
141
258
|
STAILQ_HEAD(lxw_merged_ranges, lxw_merged_range);
|
142
259
|
STAILQ_HEAD(lxw_selections, lxw_selection);
|
260
|
+
STAILQ_HEAD(lxw_data_validations, lxw_data_validation);
|
143
261
|
STAILQ_HEAD(lxw_image_data, lxw_image_options);
|
144
262
|
STAILQ_HEAD(lxw_chart_data, lxw_image_options);
|
145
263
|
|
@@ -149,12 +267,14 @@ STAILQ_HEAD(lxw_chart_data, lxw_image_options);
|
|
149
267
|
* Options struct for the worksheet_set_column() and worksheet_set_row()
|
150
268
|
* functions.
|
151
269
|
*
|
152
|
-
* It has the following members
|
153
|
-
* supported:
|
270
|
+
* It has the following members:
|
154
271
|
*
|
155
272
|
* * `hidden`
|
156
273
|
* * `level`
|
157
274
|
* * `collapsed`
|
275
|
+
*
|
276
|
+
* The members of this struct are explained in @ref ww_outlines_grouping.
|
277
|
+
*
|
158
278
|
*/
|
159
279
|
typedef struct lxw_row_col_options {
|
160
280
|
/** Hide the row/column */
|
@@ -229,6 +349,180 @@ typedef struct lxw_selection {
|
|
229
349
|
|
230
350
|
} lxw_selection;
|
231
351
|
|
352
|
+
/**
|
353
|
+
* @brief Worksheet data validation options.
|
354
|
+
*/
|
355
|
+
typedef struct lxw_data_validation {
|
356
|
+
|
357
|
+
/**
|
358
|
+
* Set the validation type. Should be a #lxw_validation_types value.
|
359
|
+
*/
|
360
|
+
uint8_t validate;
|
361
|
+
|
362
|
+
/**
|
363
|
+
* Set the validation criteria type to select the data. Should be a
|
364
|
+
* #lxw_validation_criteria value.
|
365
|
+
*/
|
366
|
+
uint8_t criteria;
|
367
|
+
|
368
|
+
/** Controls whether a data validation is not applied to blank data in the
|
369
|
+
* cell. Should be a #lxw_validation_boolean value. It is on by
|
370
|
+
* default.
|
371
|
+
*/
|
372
|
+
uint8_t ignore_blank;
|
373
|
+
|
374
|
+
/**
|
375
|
+
* This parameter is used to toggle on and off the 'Show input message
|
376
|
+
* when cell is selected' option in the Excel data validation dialog. When
|
377
|
+
* the option is off an input message is not displayed even if it has been
|
378
|
+
* set using input_message. Should be a #lxw_validation_boolean value. It
|
379
|
+
* is on by default.
|
380
|
+
*/
|
381
|
+
uint8_t show_input;
|
382
|
+
|
383
|
+
/**
|
384
|
+
* This parameter is used to toggle on and off the 'Show error alert
|
385
|
+
* after invalid data is entered' option in the Excel data validation
|
386
|
+
* dialog. When the option is off an error message is not displayed even
|
387
|
+
* if it has been set using error_message. Should be a
|
388
|
+
* #lxw_validation_boolean value. It is on by default.
|
389
|
+
*/
|
390
|
+
uint8_t show_error;
|
391
|
+
|
392
|
+
/**
|
393
|
+
* This parameter is used to specify the type of error dialog that is
|
394
|
+
* displayed. Should be a #lxw_validation_error_types value.
|
395
|
+
*/
|
396
|
+
uint8_t error_type;
|
397
|
+
|
398
|
+
/**
|
399
|
+
* This parameter is used to toggle on and off the 'In-cell dropdown'
|
400
|
+
* option in the Excel data validation dialog. When the option is on a
|
401
|
+
* dropdown list will be shown for list validations. Should be a
|
402
|
+
* #lxw_validation_boolean value. It is on by default.
|
403
|
+
*/
|
404
|
+
uint8_t dropdown;
|
405
|
+
|
406
|
+
uint8_t is_between;
|
407
|
+
|
408
|
+
/**
|
409
|
+
* This parameter is used to set the limiting value to which the criteria
|
410
|
+
* is applied using a whole or decimal number.
|
411
|
+
*/
|
412
|
+
double value_number;
|
413
|
+
|
414
|
+
/**
|
415
|
+
* This parameter is used to set the limiting value to which the criteria
|
416
|
+
* is applied using a cell reference. It is valid for any of the
|
417
|
+
* `_FORMULA` validation types.
|
418
|
+
*/
|
419
|
+
char *value_formula;
|
420
|
+
|
421
|
+
/**
|
422
|
+
* This parameter is used to set a list of strings for a drop down list.
|
423
|
+
* The list should be a `NULL` terminated array of char* strings:
|
424
|
+
*
|
425
|
+
* @code
|
426
|
+
* char *list[] = {"open", "high", "close", NULL};
|
427
|
+
*
|
428
|
+
* data_validation->validate = LXW_VALIDATION_TYPE_LIST;
|
429
|
+
* data_validation->value_list = list;
|
430
|
+
* @endcode
|
431
|
+
*
|
432
|
+
* The `value_formula` parameter can also be used to specify a list from
|
433
|
+
* an Excel cell range.
|
434
|
+
*
|
435
|
+
* Note, the string list is restricted by Excel to 255 characters,
|
436
|
+
* including comma separators.
|
437
|
+
*/
|
438
|
+
char **value_list;
|
439
|
+
|
440
|
+
/**
|
441
|
+
* This parameter is used to set the limiting value to which the date or
|
442
|
+
* time criteria is applied using a #lxw_datetime struct.
|
443
|
+
*/
|
444
|
+
lxw_datetime value_datetime;
|
445
|
+
|
446
|
+
/**
|
447
|
+
* This parameter is the same as `value_number` but for the minimum value
|
448
|
+
* when a `BETWEEN` criteria is used.
|
449
|
+
*/
|
450
|
+
double minimum_number;
|
451
|
+
|
452
|
+
/**
|
453
|
+
* This parameter is the same as `value_formula` but for the minimum value
|
454
|
+
* when a `BETWEEN` criteria is used.
|
455
|
+
*/
|
456
|
+
char *minimum_formula;
|
457
|
+
|
458
|
+
/**
|
459
|
+
* This parameter is the same as `value_datetime` but for the minimum value
|
460
|
+
* when a `BETWEEN` criteria is used.
|
461
|
+
*/
|
462
|
+
lxw_datetime minimum_datetime;
|
463
|
+
|
464
|
+
/**
|
465
|
+
* This parameter is the same as `value_number` but for the maximum value
|
466
|
+
* when a `BETWEEN` criteria is used.
|
467
|
+
*/
|
468
|
+
double maximum_number;
|
469
|
+
|
470
|
+
/**
|
471
|
+
* This parameter is the same as `value_formula` but for the maximum value
|
472
|
+
* when a `BETWEEN` criteria is used.
|
473
|
+
*/
|
474
|
+
char *maximum_formula;
|
475
|
+
|
476
|
+
/**
|
477
|
+
* This parameter is the same as `value_datetime` but for the maximum value
|
478
|
+
* when a `BETWEEN` criteria is used.
|
479
|
+
*/
|
480
|
+
lxw_datetime maximum_datetime;
|
481
|
+
|
482
|
+
/**
|
483
|
+
* The input_title parameter is used to set the title of the input message
|
484
|
+
* that is displayed when a cell is entered. It has no default value and
|
485
|
+
* is only displayed if the input message is displayed. See the
|
486
|
+
* `input_message` parameter below.
|
487
|
+
*
|
488
|
+
* The maximum title length is 32 characters.
|
489
|
+
*/
|
490
|
+
char *input_title;
|
491
|
+
|
492
|
+
/**
|
493
|
+
* The input_message parameter is used to set the input message that is
|
494
|
+
* displayed when a cell is entered. It has no default value.
|
495
|
+
*
|
496
|
+
* The message can be split over several lines using newlines. The maximum
|
497
|
+
* message length is 255 characters.
|
498
|
+
*/
|
499
|
+
char *input_message;
|
500
|
+
|
501
|
+
/**
|
502
|
+
* The error_title parameter is used to set the title of the error message
|
503
|
+
* that is displayed when the data validation criteria is not met. The
|
504
|
+
* default error title is 'Microsoft Excel'. The maximum title length is
|
505
|
+
* 32 characters.
|
506
|
+
*/
|
507
|
+
char *error_title;
|
508
|
+
|
509
|
+
/**
|
510
|
+
* The error_message parameter is used to set the error message that is
|
511
|
+
* displayed when a cell is entered. The default error message is "The
|
512
|
+
* value you entered is not valid. A user has restricted values that can
|
513
|
+
* be entered into the cell".
|
514
|
+
*
|
515
|
+
* The message can be split over several lines using newlines. The maximum
|
516
|
+
* message length is 255 characters.
|
517
|
+
*/
|
518
|
+
char *error_message;
|
519
|
+
|
520
|
+
char sqref[LXW_MAX_CELL_RANGE_LENGTH];
|
521
|
+
|
522
|
+
STAILQ_ENTRY (lxw_data_validation) list_pointers;
|
523
|
+
|
524
|
+
} lxw_data_validation;
|
525
|
+
|
232
526
|
/**
|
233
527
|
* @brief Options for inserted images
|
234
528
|
*
|
@@ -354,6 +648,7 @@ typedef struct lxw_worksheet {
|
|
354
648
|
struct lxw_cell **array;
|
355
649
|
struct lxw_merged_ranges *merged_ranges;
|
356
650
|
struct lxw_selections *selections;
|
651
|
+
struct lxw_data_validations *data_validations;
|
357
652
|
struct lxw_image_data *image_data;
|
358
653
|
struct lxw_chart_data *chart_data;
|
359
654
|
|
@@ -403,6 +698,9 @@ typedef struct lxw_worksheet {
|
|
403
698
|
uint8_t orientation;
|
404
699
|
uint8_t outline_changed;
|
405
700
|
uint8_t outline_on;
|
701
|
+
uint8_t outline_style;
|
702
|
+
uint8_t outline_below;
|
703
|
+
uint8_t outline_right;
|
406
704
|
uint8_t page_order;
|
407
705
|
uint8_t page_setup_changed;
|
408
706
|
uint8_t page_view;
|
@@ -416,6 +714,7 @@ typedef struct lxw_worksheet {
|
|
416
714
|
uint8_t vba_codename;
|
417
715
|
uint8_t vcenter;
|
418
716
|
uint8_t zoom_scale_normal;
|
717
|
+
uint8_t num_validations;
|
419
718
|
|
420
719
|
lxw_color_t tab_color;
|
421
720
|
|
@@ -431,6 +730,8 @@ typedef struct lxw_worksheet {
|
|
431
730
|
uint32_t default_col_pixels;
|
432
731
|
uint8_t default_row_zeroed;
|
433
732
|
uint8_t default_row_set;
|
733
|
+
uint8_t outline_row_level;
|
734
|
+
uint8_t outline_col_level;
|
434
735
|
|
435
736
|
uint8_t header_footer_changed;
|
436
737
|
char header[LXW_HEADER_FOOTER_MAX];
|
@@ -561,6 +862,10 @@ extern "C" {
|
|
561
862
|
*
|
562
863
|
* @image html write_number02.png
|
563
864
|
*
|
865
|
+
* @note Excel doesn't support `NaN`, `Inf` or `-Inf` as a number value. If
|
866
|
+
* you are writing data that contains these values then your application
|
867
|
+
* should convert them to a string or handle them in some other way.
|
868
|
+
*
|
564
869
|
*/
|
565
870
|
lxw_error worksheet_write_number(lxw_worksheet *worksheet,
|
566
871
|
lxw_row_t row,
|
@@ -661,6 +966,7 @@ lxw_error worksheet_write_string(lxw_worksheet *worksheet,
|
|
661
966
|
* worksheet_write_formula(worksheet, 1, 0, "=SUM(1; 2; 3)", NULL);
|
662
967
|
* @endcode
|
663
968
|
*
|
969
|
+
* See also @ref working_with_formulas.
|
664
970
|
*/
|
665
971
|
lxw_error worksheet_write_formula(lxw_worksheet *worksheet,
|
666
972
|
lxw_row_t row,
|
@@ -669,7 +975,7 @@ lxw_error worksheet_write_formula(lxw_worksheet *worksheet,
|
|
669
975
|
/**
|
670
976
|
* @brief Write an array formula to a worksheet cell.
|
671
977
|
*
|
672
|
-
* @param worksheet
|
978
|
+
* @param worksheet pointer to a lxw_worksheet instance to be updated.
|
673
979
|
* @param first_row The first row of the range. (All zero indexed.)
|
674
980
|
* @param first_col The first column of the range.
|
675
981
|
* @param last_row The last row of the range.
|
@@ -874,7 +1180,7 @@ lxw_error worksheet_write_url_opt(lxw_worksheet *worksheet,
|
|
874
1180
|
* @endcode
|
875
1181
|
*
|
876
1182
|
*
|
877
|
-
* Alternatively, you can use
|
1183
|
+
* Alternatively, you can use Unix style forward slashes. These are
|
878
1184
|
* translated internally to backslashes:
|
879
1185
|
*
|
880
1186
|
* @code
|
@@ -991,6 +1297,7 @@ lxw_error worksheet_write_blank(lxw_worksheet *worksheet,
|
|
991
1297
|
* worksheet_write_formula() function is the recommended way of writing
|
992
1298
|
* formulas.
|
993
1299
|
*
|
1300
|
+
* See also @ref working_with_formulas.
|
994
1301
|
*/
|
995
1302
|
lxw_error worksheet_write_formula_num(lxw_worksheet *worksheet,
|
996
1303
|
lxw_row_t row,
|
@@ -1066,7 +1373,7 @@ lxw_error worksheet_set_row(lxw_worksheet *worksheet,
|
|
1066
1373
|
* `worksheet_set_row()` with an additional `options` parameter.
|
1067
1374
|
*
|
1068
1375
|
* The `options` parameter is a #lxw_row_col_options struct. It has the
|
1069
|
-
* following members
|
1376
|
+
* following members:
|
1070
1377
|
*
|
1071
1378
|
* - `hidden`
|
1072
1379
|
* - `level`
|
@@ -1076,12 +1383,41 @@ lxw_error worksheet_set_row(lxw_worksheet *worksheet,
|
|
1076
1383
|
* example, to hide intermediary steps in a complicated calculation:
|
1077
1384
|
*
|
1078
1385
|
* @code
|
1079
|
-
* lxw_row_col_options
|
1386
|
+
* lxw_row_col_options options1 = {.hidden = 1, .level = 0, .collapsed = 0};
|
1387
|
+
*
|
1388
|
+
* // Hide the fourth and fifth (zero indexed) rows.
|
1389
|
+
* worksheet_set_row_opt(worksheet, 3, LXW_DEF_ROW_HEIGHT, NULL, &options1);
|
1390
|
+
* worksheet_set_row_opt(worksheet, 4, LXW_DEF_ROW_HEIGHT, NULL, &options1);
|
1391
|
+
*
|
1392
|
+
* @endcode
|
1393
|
+
*
|
1394
|
+
* @image html hide_row_col2.png
|
1395
|
+
*
|
1396
|
+
* The `"hidden"`, `"level"`, and `"collapsed"`, options can also be used to
|
1397
|
+
* create Outlines and Grouping. See @ref working_with_outlines.
|
1398
|
+
*
|
1399
|
+
* @code
|
1400
|
+
* // The option structs with the outline level set.
|
1401
|
+
* lxw_row_col_options options1 = {.hidden = 0, .level = 2, .collapsed = 0};
|
1402
|
+
* lxw_row_col_options options2 = {.hidden = 0, .level = 1, .collapsed = 0};
|
1080
1403
|
*
|
1081
|
-
*
|
1082
|
-
*
|
1404
|
+
*
|
1405
|
+
* // Set the row options with the outline level.
|
1406
|
+
* worksheet_set_row_opt(worksheet, 1, LXW_DEF_ROW_HEIGHT, NULL, &options1);
|
1407
|
+
* worksheet_set_row_opt(worksheet, 2, LXW_DEF_ROW_HEIGHT, NULL, &options1);
|
1408
|
+
* worksheet_set_row_opt(worksheet, 3, LXW_DEF_ROW_HEIGHT, NULL, &options1);
|
1409
|
+
* worksheet_set_row_opt(worksheet, 4, LXW_DEF_ROW_HEIGHT, NULL, &options1);
|
1410
|
+
* worksheet_set_row_opt(worksheet, 5, LXW_DEF_ROW_HEIGHT, NULL, &options2);
|
1411
|
+
*
|
1412
|
+
* worksheet_set_row_opt(worksheet, 6, LXW_DEF_ROW_HEIGHT, NULL, &options1);
|
1413
|
+
* worksheet_set_row_opt(worksheet, 7, LXW_DEF_ROW_HEIGHT, NULL, &options1);
|
1414
|
+
* worksheet_set_row_opt(worksheet, 8, LXW_DEF_ROW_HEIGHT, NULL, &options1);
|
1415
|
+
* worksheet_set_row_opt(worksheet, 9, LXW_DEF_ROW_HEIGHT, NULL, &options1);
|
1416
|
+
* worksheet_set_row_opt(worksheet, 10, LXW_DEF_ROW_HEIGHT, NULL, &options2);
|
1083
1417
|
* @endcode
|
1084
1418
|
*
|
1419
|
+
* @image html outline1.png
|
1420
|
+
*
|
1085
1421
|
*/
|
1086
1422
|
lxw_error worksheet_set_row_opt(lxw_worksheet *worksheet,
|
1087
1423
|
lxw_row_t row,
|
@@ -1189,36 +1525,48 @@ lxw_error worksheet_set_column(lxw_worksheet *worksheet,
|
|
1189
1525
|
lxw_col_t last_col,
|
1190
1526
|
double width, lxw_format *format);
|
1191
1527
|
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1528
|
+
/**
|
1529
|
+
* @brief Set the properties for one or more columns of cells with options.
|
1530
|
+
*
|
1531
|
+
* @param worksheet Pointer to a lxw_worksheet instance to be updated.
|
1532
|
+
* @param first_col The zero indexed first column.
|
1533
|
+
* @param last_col The zero indexed last column.
|
1534
|
+
* @param width The width of the column(s).
|
1535
|
+
* @param format A pointer to a Format instance or NULL.
|
1536
|
+
* @param options Optional row parameters: hidden, level, collapsed.
|
1537
|
+
*
|
1538
|
+
* The `%worksheet_set_column_opt()` function is the same as
|
1539
|
+
* `worksheet_set_column()` with an additional `options` parameter.
|
1540
|
+
*
|
1541
|
+
* The `options` parameter is a #lxw_row_col_options struct. It has the
|
1542
|
+
* following members:
|
1543
|
+
*
|
1544
|
+
* - `hidden`
|
1545
|
+
* - `level`
|
1546
|
+
* - `collapsed`
|
1547
|
+
*
|
1548
|
+
* The `"hidden"` option is used to hide a column. This can be used, for
|
1549
|
+
* example, to hide intermediary steps in a complicated calculation:
|
1550
|
+
*
|
1551
|
+
* @code
|
1552
|
+
* lxw_row_col_options options1 = {.hidden = 1, .level = 0, .collapsed = 0};
|
1553
|
+
*
|
1554
|
+
* worksheet_set_column_opt(worksheet, COLS("D:E"), LXW_DEF_COL_WIDTH, NULL, &options1);
|
1555
|
+
* @endcode
|
1556
|
+
*
|
1557
|
+
* @image html hide_row_col3.png
|
1558
|
+
*
|
1559
|
+
* The `"hidden"`, `"level"`, and `"collapsed"`, options can also be used to
|
1560
|
+
* create Outlines and Grouping. See @ref working_with_outlines.
|
1561
|
+
*
|
1562
|
+
* @code
|
1563
|
+
* lxw_row_col_options options1 = {.hidden = 0, .level = 1, .collapsed = 0};
|
1564
|
+
*
|
1565
|
+
* worksheet_set_column_opt(worksheet, COLS("B:G"), 5, NULL, &options1);
|
1566
|
+
* @endcode
|
1567
|
+
*
|
1568
|
+
* @image html outline8.png
|
1569
|
+
*/
|
1222
1570
|
lxw_error worksheet_set_column_opt(lxw_worksheet *worksheet,
|
1223
1571
|
lxw_col_t first_col,
|
1224
1572
|
lxw_col_t last_col,
|
@@ -1470,6 +1818,87 @@ lxw_error worksheet_autofilter(lxw_worksheet *worksheet, lxw_row_t first_row,
|
|
1470
1818
|
lxw_col_t first_col, lxw_row_t last_row,
|
1471
1819
|
lxw_col_t last_col);
|
1472
1820
|
|
1821
|
+
/**
|
1822
|
+
* @brief Add a data validation to a cell.
|
1823
|
+
*
|
1824
|
+
* @param worksheet Pointer to a lxw_worksheet instance to be updated.
|
1825
|
+
* @param row The zero indexed row number.
|
1826
|
+
* @param col The zero indexed column number.
|
1827
|
+
* @param validation A #lxw_data_validation object to control the validation.
|
1828
|
+
*
|
1829
|
+
* @return A #lxw_error code.
|
1830
|
+
*
|
1831
|
+
* The `%worksheet_data_validation_cell()` function is used to construct an
|
1832
|
+
* Excel data validation or to limit the user input to a dropdown list of
|
1833
|
+
* values:
|
1834
|
+
*
|
1835
|
+
* @code
|
1836
|
+
*
|
1837
|
+
* lxw_data_validation *data_validation = calloc(1, sizeof(lxw_data_validation));
|
1838
|
+
*
|
1839
|
+
* data_validation->validate = LXW_VALIDATION_TYPE_INTEGER;
|
1840
|
+
* data_validation->criteria = LXW_VALIDATION_CRITERIA_BETWEEN;
|
1841
|
+
* data_validation->minimum_number = 1;
|
1842
|
+
* data_validation->maximum_number = 10;
|
1843
|
+
*
|
1844
|
+
* worksheet_data_validation_cell(worksheet, 2, 1, data_validation);
|
1845
|
+
*
|
1846
|
+
* // Same as above with the CELL() macro.
|
1847
|
+
* worksheet_data_validation_cell(worksheet, CELL("B3"), data_validation);
|
1848
|
+
*
|
1849
|
+
* @endcode
|
1850
|
+
*
|
1851
|
+
* @image html data_validate4.png
|
1852
|
+
*
|
1853
|
+
* Data validation and the various options of #lxw_data_validation are
|
1854
|
+
* described in more detail in @ref working_with_data_validation.
|
1855
|
+
*/
|
1856
|
+
lxw_error worksheet_data_validation_cell(lxw_worksheet *worksheet,
|
1857
|
+
lxw_row_t row, lxw_col_t col,
|
1858
|
+
lxw_data_validation *validation);
|
1859
|
+
|
1860
|
+
/**
|
1861
|
+
* @brief Add a data validation to a range cell.
|
1862
|
+
*
|
1863
|
+
* @param worksheet Pointer to a lxw_worksheet instance to be updated.
|
1864
|
+
* @param first_row The first row of the range. (All zero indexed.)
|
1865
|
+
* @param first_col The first column of the range.
|
1866
|
+
* @param last_row The last row of the range.
|
1867
|
+
* @param last_col The last col of the range.
|
1868
|
+
* @param validation A #lxw_data_validation object to control the validation.
|
1869
|
+
*
|
1870
|
+
* @return A #lxw_error code.
|
1871
|
+
*
|
1872
|
+
* The `%worksheet_data_validation_range()` function is the same as the
|
1873
|
+
* `%worksheet_data_validation_cell()`, see above, except the data validation
|
1874
|
+
* is applied to a range of cells:
|
1875
|
+
*
|
1876
|
+
* @code
|
1877
|
+
*
|
1878
|
+
* lxw_data_validation *data_validation = calloc(1, sizeof(lxw_data_validation));
|
1879
|
+
*
|
1880
|
+
* data_validation->validate = LXW_VALIDATION_TYPE_INTEGER;
|
1881
|
+
* data_validation->criteria = LXW_VALIDATION_CRITERIA_BETWEEN;
|
1882
|
+
* data_validation->minimum_number = 1;
|
1883
|
+
* data_validation->maximum_number = 10;
|
1884
|
+
*
|
1885
|
+
* worksheet_data_validation_range(worksheet, 2, 1, 4, 1, data_validation);
|
1886
|
+
*
|
1887
|
+
* // Same as above with the RANGE() macro.
|
1888
|
+
* worksheet_data_validation_range(worksheet, RANGE("B3:B5"), data_validation);
|
1889
|
+
*
|
1890
|
+
* @endcode
|
1891
|
+
*
|
1892
|
+
* Data validation and the various options of #lxw_data_validation are
|
1893
|
+
* described in more detail in @ref working_with_data_validation.
|
1894
|
+
*/
|
1895
|
+
lxw_error worksheet_data_validation_range(lxw_worksheet *worksheet,
|
1896
|
+
lxw_row_t first_row,
|
1897
|
+
lxw_col_t first_col,
|
1898
|
+
lxw_row_t last_row,
|
1899
|
+
lxw_col_t last_col,
|
1900
|
+
lxw_data_validation *validation);
|
1901
|
+
|
1473
1902
|
/**
|
1474
1903
|
* @brief Make a worksheet the active, i.e., visible worksheet.
|
1475
1904
|
*
|
@@ -2553,6 +2982,54 @@ void worksheet_set_tab_color(lxw_worksheet *worksheet, lxw_color_t color);
|
|
2553
2982
|
void worksheet_protect(lxw_worksheet *worksheet, const char *password,
|
2554
2983
|
lxw_protection *options);
|
2555
2984
|
|
2985
|
+
/**
|
2986
|
+
* @brief Set the Outline and Grouping display properties.
|
2987
|
+
*
|
2988
|
+
* @param worksheet Pointer to a lxw_worksheet instance to be updated.
|
2989
|
+
* @param visible Outlines are visible. Optional, defaults to True.
|
2990
|
+
* @param symbols_below Show row outline symbols below the outline bar.
|
2991
|
+
* @param symbols_right Show column outline symbols to the right of outline.
|
2992
|
+
* @param auto_style Use Automatic outline style.
|
2993
|
+
*
|
2994
|
+
* The `%worksheet_outline_settings()` method is used to control the
|
2995
|
+
* appearance of outlines in Excel. Outlines are described the section on
|
2996
|
+
* @ref working_with_outlines.
|
2997
|
+
*
|
2998
|
+
* The `visible` parameter is used to control whether or not outlines are
|
2999
|
+
* visible. Setting this parameter to False will cause all outlines on the
|
3000
|
+
* worksheet to be hidden. They can be un-hidden in Excel by means of the
|
3001
|
+
* "Show Outline Symbols" command button. The default Excel setting is True
|
3002
|
+
* for visible outlines.
|
3003
|
+
*
|
3004
|
+
* The `symbols_below` parameter is used to control whether the row outline
|
3005
|
+
* symbol will appear above or below the outline level bar. The default Excel
|
3006
|
+
* setting is True for symbols to appear below the outline level bar.
|
3007
|
+
*
|
3008
|
+
* The `symbols_right` parameter is used to control whether the column outline
|
3009
|
+
* symbol will appear to the left or the right of the outline level bar. The
|
3010
|
+
* default Excel setting is True for symbols to appear to the right of the
|
3011
|
+
* outline level bar.
|
3012
|
+
*
|
3013
|
+
* The `auto_style` parameter is used to control whether the automatic outline
|
3014
|
+
* generator in Excel uses automatic styles when creating an outline. This has
|
3015
|
+
* no effect on a file generated by XlsxWriter but it does have an effect on
|
3016
|
+
* how the worksheet behaves after it is created. The default Excel setting is
|
3017
|
+
* False for "Automatic Styles" to be turned off.
|
3018
|
+
*
|
3019
|
+
* The default settings for all of these parameters in libxlsxwriter
|
3020
|
+
* correspond to Excel's default parameters and are shown below:
|
3021
|
+
*
|
3022
|
+
* @code
|
3023
|
+
* worksheet_outline_settings(worksheet1, LXW_TRUE, LXW_TRUE, LXW_TRUE, LXW_FALSE);
|
3024
|
+
* @endcode
|
3025
|
+
*
|
3026
|
+
* The worksheet parameters controlled by `worksheet_outline_settings()` are
|
3027
|
+
* rarely used.
|
3028
|
+
*/
|
3029
|
+
void worksheet_outline_settings(lxw_worksheet *worksheet, uint8_t visible,
|
3030
|
+
uint8_t symbols_below, uint8_t symbols_right,
|
3031
|
+
uint8_t auto_style);
|
3032
|
+
|
2556
3033
|
/**
|
2557
3034
|
* @brief Set the default row properties.
|
2558
3035
|
*
|
@@ -2630,6 +3107,7 @@ STATIC void _worksheet_write_print_options(lxw_worksheet *worksheet);
|
|
2630
3107
|
STATIC void _worksheet_write_sheet_pr(lxw_worksheet *worksheet);
|
2631
3108
|
STATIC void _worksheet_write_tab_color(lxw_worksheet *worksheet);
|
2632
3109
|
STATIC void _worksheet_write_sheet_protection(lxw_worksheet *worksheet);
|
3110
|
+
STATIC void _worksheet_write_data_validations(lxw_worksheet *self);
|
2633
3111
|
#endif /* TESTING */
|
2634
3112
|
|
2635
3113
|
/* *INDENT-OFF* */
|