Comments (9)
Added in version 0.75. See Working with Data Validation and data_validate.c.
from libxlsxwriter.
I'd like to put in a plug for this feature -- its absence is one of the few things keeping my code base dependent on xlsLib. Just so other users are aware, Excel's data validation is how drop-down menus are implemented for choosing among a discrete set of values.
Also @jmcnamara the correct link is: https://xlsxwriter.readthedocs.io/working_with_data_validation.html
from libxlsxwriter.
@evanmiller Noted.
from libxlsxwriter.
@evanmiller I've started work on data validation in libxlsxwriter. It isn't fully useable yet but you could try it out in a few days, when it is more functional. If you are interested.
If so let me know what type of data validation you want to do.
from libxlsxwriter.
@jmcnamara Thanks. I'm interested in pop-up buttons -- in xlsLib I do something like
formula_t *cond1 = xlsWorksheetFormula(prediction_ws);
xlsFormulaPushCharacterArray(cond1, "FALSE\0TRUE", sizeof("FALSE\0TRUE")-1);
xlsWorksheetValidateCellArea(prediction_ws, first_cell, last_cell,
DVAL_TYPE_LIST | DVAL_OP_EQUAL | DVAL_STRING_LIST_IN_FORMULA,
cond1, NULL, NULL, NULL, NULL, NULL);
from libxlsxwriter.
This type of validation?
from libxlsxwriter.
@jmcnamara Yes.
from libxlsxwriter.
@evanmiller That is currently doable with the code on the data_validation
branch. The above was created using this program:
#include "xlsxwriter.h"
int main() {
lxw_workbook *workbook = new_workbook("test_data_validation01.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
char *list[] = {"Foo", "Bar", "Baz", NULL};
lxw_data_validation *data_validation = calloc(1, sizeof(lxw_data_validation));
data_validation->validate = LXW_VALIDATION_TYPE_LIST;
data_validation->source_list = list;
worksheet_data_validation_cell(worksheet, CELL("C2"), data_validation);
free(data_validation);
return workbook_close(workbook);
}
Most of the guard rails are still missing but if you can figure it out based on the above program, you can try it out.
from libxlsxwriter.
@jmcnamara Thanks. I'll trust you that it works as advertised, and I'll keep it in mind when deciding to port the rest of my code.
from libxlsxwriter.
Related Issues (20)
- Linker error when trying to use latest version with macOS project HOT 1
- File creation performance HOT 2
- Linux(CentOS6) Build Error.
- LXW_ERROR_CREATING_XLSX_FILE: error creating output xlsx file. Usually a permissions error. HOT 1
- cannot run on x64 Release in Visual Studio 2022 HOT 5
- Issue: Corrupt file compiled using VS2008 on Windows HOT 9
- Issue when using constant memory with merge range HOT 2
- password HOT 1
- Still Tagging Releases? HOT 2
- 1.1.6 release did not get marked as latest release HOT 4
- How to insert image data of type CV:: Mat HOT 2
- test/functional/test_image.py::TestCompareXLSXFiles::test_image58 failure on 32bit architectures HOT 10
- Bug: workbook_validate_sheet_name buffer-overflow HOT 4
- Bug: workbook_add_worksheet does not return a reasonable worksheet HOT 1
- workbook_define_name stack-buffer-underflow HOT 2
- workbook_close stack-buffer-overflow HOT 4
- _store_array_formula heap-buffer-overflow HOT 5
- worksheet_set_selection stack-buffer-overflow HOT 1
- Question: Are people still using the libxlsxwriter cocoapod?
- Chinese in workbook_add_worksheet cause crash
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libxlsxwriter.