libxlsxwriter
Loading...
Searching...
No Matches
Data Fields
lxw_data_validation Struct Reference

Worksheet data validation options. More...

Detailed Description

Examples
data_validate.c.

Data Fields

uint8_t validate
 
uint8_t criteria
 
uint8_t ignore_blank
 
uint8_t show_input
 
uint8_t show_error
 
uint8_t error_type
 
uint8_t dropdown
 
double value_number
 
const char * value_formula
 
const char ** value_list
 
lxw_datetime value_datetime
 
double minimum_number
 
const char * minimum_formula
 
lxw_datetime minimum_datetime
 
double maximum_number
 
const char * maximum_formula
 
lxw_datetime maximum_datetime
 
const char * input_title
 
const char * input_message
 
const char * error_title
 
const char * error_message
 

Field Documentation

◆ validate

uint8_t lxw_data_validation::validate

Set the validation type. Should be a lxw_validation_types value.

Examples
data_validate.c.

◆ criteria

uint8_t lxw_data_validation::criteria

Set the validation criteria type to select the data. Should be a lxw_validation_criteria value.

Examples
data_validate.c.

◆ ignore_blank

uint8_t lxw_data_validation::ignore_blank

Controls whether a data validation is not applied to blank data in the cell. Should be a lxw_validation_boolean value. It is on by default.

◆ show_input

uint8_t lxw_data_validation::show_input

This parameter is used to toggle on and off the 'Show input message when cell is selected' option in the Excel data validation dialog. When the option is off an input message is not displayed even if it has been set using input_message. Should be a lxw_validation_boolean value. It is on by default.

◆ show_error

uint8_t lxw_data_validation::show_error

This parameter is used to toggle on and off the 'Show error alert after invalid data is entered' option in the Excel data validation dialog. When the option is off an error message is not displayed even if it has been set using error_message. Should be a lxw_validation_boolean value. It is on by default.

◆ error_type

uint8_t lxw_data_validation::error_type

This parameter is used to specify the type of error dialog that is displayed. Should be a lxw_validation_error_types value.

Examples
data_validate.c.

◆ dropdown

uint8_t lxw_data_validation::dropdown

This parameter is used to toggle on and off the 'In-cell dropdown' option in the Excel data validation dialog. When the option is on a dropdown list will be shown for list validations. Should be a lxw_validation_boolean value. It is on by default.

◆ value_number

double lxw_data_validation::value_number

This parameter is used to set the limiting value to which the criteria is applied using a whole or decimal number.

Examples
data_validate.c.

◆ value_formula

const char* lxw_data_validation::value_formula

This parameter is used to set the limiting value to which the criteria is applied using a cell reference. It is valid for any of the _FORMULA validation types.

Examples
data_validate.c.

◆ value_list

const char** lxw_data_validation::value_list

This parameter is used to set a list of strings for a dropdown list. The list should be a NULL terminated array of char* strings:

char *list[] = {"open", "high", "close", NULL};
data_validation->validate = LXW_VALIDATION_TYPE_LIST;
data_validation->value_list = list;
@ LXW_VALIDATION_TYPE_LIST
Definition: worksheet.h:131

The value_formula parameter can also be used to specify a list from an Excel cell range.

Note, the string list is restricted by Excel to 255 characters, including comma separators.

Examples
data_validate.c.

◆ value_datetime

lxw_datetime lxw_data_validation::value_datetime

This parameter is used to set the limiting value to which the date or time criteria is applied using a lxw_datetime struct.

◆ minimum_number

double lxw_data_validation::minimum_number

This parameter is the same as value_number but for the minimum value when a BETWEEN criteria is used.

Examples
data_validate.c.

◆ minimum_formula

const char* lxw_data_validation::minimum_formula

This parameter is the same as value_formula but for the minimum value when a BETWEEN criteria is used.

Examples
data_validate.c.

◆ minimum_datetime

lxw_datetime lxw_data_validation::minimum_datetime

This parameter is the same as value_datetime but for the minimum value when a BETWEEN criteria is used.

Examples
data_validate.c.

◆ maximum_number

double lxw_data_validation::maximum_number

This parameter is the same as value_number but for the maximum value when a BETWEEN criteria is used.

Examples
data_validate.c.

◆ maximum_formula

const char* lxw_data_validation::maximum_formula

This parameter is the same as value_formula but for the maximum value when a BETWEEN criteria is used.

Examples
data_validate.c.

◆ maximum_datetime

lxw_datetime lxw_data_validation::maximum_datetime

This parameter is the same as value_datetime but for the maximum value when a BETWEEN criteria is used.

Examples
data_validate.c.

◆ input_title

const char* lxw_data_validation::input_title

The input_title parameter is used to set the title of the input message that is displayed when a cell is entered. It has no default value and is only displayed if the input message is displayed. See the input_message parameter below.

The maximum title length is 32 characters.

Examples
data_validate.c.

◆ input_message

const char* lxw_data_validation::input_message

The input_message parameter is used to set the input message that is displayed when a cell is entered. It has no default value.

The message can be split over several lines using newlines. The maximum message length is 255 characters.

Examples
data_validate.c.

◆ error_title

const char* lxw_data_validation::error_title

The error_title parameter is used to set the title of the error message that is displayed when the data validation criteria is not met. The default error title is 'Microsoft Excel'. The maximum title length is 32 characters.

Examples
data_validate.c.

◆ error_message

const char* lxw_data_validation::error_message

The error_message parameter is used to set the error message that is displayed when a cell is entered. The default error message is "The value you entered is not valid. A user has restricted values that can be entered into the cell".

The message can be split over several lines using newlines. The maximum message length is 255 characters.

Examples
data_validate.c.