Description

class Axlsx::DataValidation
Note:

The recommended way to manage data validations is via Worksheet#add_data_validation

Data validation allows the validation of cell data

Creates a new Axlsx::DataValidation object

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • formula1 (String)
  • formula2 (String)
  • allowBlank (Boolean)
    • A boolean value indicating whether the data validation allows the use of empty or blank entries.

  • error (String)
    • Message text of error alert.

  • errorStyle (Symbol)
    • The style of error alert used for this data validation.

  • errorTitle (String)
    • itle bar text of error alert.

  • operator (Symbol)
    • The relational operator used with this data validation.

  • prompt (String)
    • Message text of input prompt.

  • promptTitle (String)
    • Title bar text of input prompt.

  • showDropDown (Boolean)
    • A boolean value indicating whether to display a dropdown combo box for a list type data validation

  • showErrorMessage (Boolean)
    • A boolean value indicating whether to display the error alert message when an invalid value has been entered, according to the criteria specified.

  • showInputMessage (Boolean)
    • A boolean value indicating whether to display the input prompt message.

  • sqref (String)
    • Range over which data validation is applied, in “A1:B2” format.

  • type (Symbol)
    • The type of data validation.

Allow Blank A boolean value indicating whether the data validation allows the use of empty or blank entries. 1 means empty entries are OK and do not violate the validation constraints. Available for type whole, decimal, date, time, textLength, list, custom default true

Error Message Message text of error alert. Available for type whole, decimal, date, time, textLength, list, custom default nil

Error Style (ST_DataValidationErrorStyle) The style of error alert used for this data validation. Options are:

* information: This data validation error style uses an information icon in the error alert.
* stop: This data validation error style uses a stop icon in the error alert.
* warning: This data validation error style uses a warning icon in the error alert.

Available for type whole, decimal, date, time, textLength, list, custom default :stop

Error Title Title bar text of error alert. Available for type whole, decimal, date, time, textLength, list, custom default nil

Formula1 Available for type whole, decimal, date, time, textLength, list, custom default nil

Formula2 Available for type whole, decimal, date, time, textLength default nil

Operator (ST_DataValidationOperator) The relational operator used with this data validation. Options are:

* between: Data validation which checks if a value is between two other values.
* equal: Data validation which checks if a value is equal to a specified value.
* greater_than: Data validation which checks if a value is greater than a specified value.
* greater_than_or_equal: Data validation which checks if a value is greater than or equal to a specified value.
* less_than: Data validation which checks if a value is less than a specified value.
* less_than_or_equal: Data validation which checks if a value is less than or equal to a specified value.
* not_between: Data validation which checks if a value is not between two other values.
* not_equal: Data validation which checks if a value is not equal to a specified value.

Available for type whole, decimal, date, time, textLength default nil

Input prompt Message text of input prompt. Available for type whole, decimal, date, time, textLength, list, custom default nil

Prompt title Title bar text of input prompt. Available for type whole, decimal, date, time, textLength, list, custom default nil

Show drop down A boolean value indicating whether to display a dropdown combo box for a list type data validation. Be careful: false shows the dropdown list! Available for type list default false

Show error message A boolean value indicating whether to display the error alert message when an invalid value has been entered, according to the criteria specified. Available for type whole, decimal, date, time, textLength, list, custom default false

Show input message A boolean value indicating whether to display the input prompt message. Available for type whole, decimal, date, time, textLength, list, custom default false

Range over which data validation is applied, in “A1:B2” format Available for type whole, decimal, date, time, textLength, list, custom default nil

Serializes the data validation

Parameters:

  • str (String) (defaults to: '')

The type (ST_DataValidationType) of data validation. Options are:

* custom: Data validation which uses a custom formula to check the cell value.
* date: Data validation which checks for date values satisfying the given condition.
* decimal: Data validation which checks for decimal values satisfying the given condition.
* list: Data validation which checks for a value matching one of list of values.
* none: No data validation.
* textLength: Data validation which checks for text values, whose length satisfies the given condition.
* time: Data validation which checks for time values satisfying the given condition.
* whole: Data validation which checks for whole number values satisfying the given condition.

default none

DataValidation is referenced in 0 repositories