diff --git a/src/documentation/content/xdocs/spreadsheet/quick-guide.xml b/src/documentation/content/xdocs/spreadsheet/quick-guide.xml index 1bf137806..859adf961 100644 --- a/src/documentation/content/xdocs/spreadsheet/quick-guide.xml +++ b/src/documentation/content/xdocs/spreadsheet/quick-guide.xml @@ -72,6 +72,7 @@
Check the value a user enters into a cell against one or more predefined value(s).
+The following code will limit the value the user can enter into cell A1 to one of three integer values, 10, 20 or 30.
+ +Drop Down Lists:
+This code will do the same but offer the user a drop down list to select a value from.
+ +Messages On Error:
+To create a message box that will be shown to the user if the value they enter is invalid.
+ +Replace 'Box Title' with the text you wish to display in the message box's title bar + and 'Message Text' with the text of your error message.
+Prompts:
+To create a prompt that the user will see when the cell containing the data validation receives focus
+ +The text encapsulated in the first parameter passed to the createPromptBox() method will appear emboldened + and as a title to the prompt whilst the second will be displayed as the text of the message. + The createExplicitListConstraint() method can be passed and array of String(s) containing interger, floating point, dates or text values.
+Further Data Validations:
+To obtain a validation that would check the value entered was, for example, an integer between 10 and 100, + use the DVConstraint.createNumericConstraint(int, int, String, String) factory method.
+ +Look at the javadoc for the other validation and operator types; also note that not all validation + types are supported for this method. The values passed to the two String parameters can be formulas; the '=' symbol is used to denote a formula
+ +It is not possible to create a drop down list if the createNumericConstraint() method is called, + the setSuppressDropDownArrow(false) method call will simply be ignored.
+Date and time constraints can be created by calling the createDateConstraint(int, String, String, String) + or the createTimeConstraint(int, String, String). Both are very similar to the above and are explained in the javadoc.
+Creating Data Validations From Spreadsheet Cells.
+The contents of specific cells can be used to provide the values for the data validation + and the DVConstraint.createFormulaListConstraint(String) method supports this. + To specify that the values come from a contiguous range of cells do either of the following:
+ +or
+ +and in both cases the user will be able to select from a drop down list containing the values from cells A1, A2 and A3.
+The data does not have to be as the data validation. To select the data from a different sheet however, the sheet + must be given a name when created and that name should be used in the formula. So assuming the existence of a sheet named 'Data Sheet' this will work:
+ +as will this:
+ +whilst this will not:
+and nor will this:
+