Bug 44304 - How to use the String with comma seperated as Data Validation for Cell
Summary: How to use the String with comma seperated as Data Validation for Cell
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-FINAL
Hardware: Other Windows XP
: P1 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-27 22:09 UTC by Lakshmi Narayana
Modified: 2008-01-28 04:31 UTC (History)
1 user (show)



Attachments
Please Help me- How to use POI for data validation with Source as String (having comma seperated strings) instead of formula (994 bytes, text/plain)
2008-01-27 23:51 UTC, Lakshmi Narayana
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lakshmi Narayana 2008-01-27 22:09:40 UTC
Please Provide the solution for giving the String having comma seperated list 
of words as the Data Validation for the Cell in Excel Sheet. 

I am working fine with the follwoing code

		    String strFormula = "$A$10:$A$20";
		    int start_row = (short)0;
		    data_validation = new HSSFDataValidation((short)
(start_row),(short)0,(short)(start_row),(short)0);
		    data_validation.setDataValidationType
(HSSFDataValidation.DATA_TYPE_LIST);
		    data_validation.setFirstFormula(strFormula);
		    data_validation.setSecondFormula(null);
		    data_validation.setExplicitListFormula(true);
		    data_validation.setSurppressDropDownArrow(false);
		    data_validation.setEmptyCellAllowed(false);
		    data_validation.setShowPromptBox(false);
		    data_validation.createErrorBox("Invalid 
input !", "Something is wrong ; check condition !");
		    data_validation.createPromptBox("Hi , dear user !", "So , 
you just selected me ! Thanks !");
		    fSheet.addValidationData(data_validation);


BUT------------------ I need to pass the string having comma seperated , to 
validate the cell ....

Thanks & Regards
Lakshmi Narayana
Comment 1 Lakshmi Narayana 2008-01-27 23:51:00 UTC
Created attachment 21434 [details]
Please Help me- How to use POI for data validation with Source as String (having comma seperated strings) instead of formula

Hi,

Please Help me- 

How to use POI for dqatavalidation with Source as String (having comma
seperated strings) instead of formula


String strFormula = "$A$10:$A$20";
int start_row = (short)0;
data_validation = new
HSSFDataValidation((short)(start_row),(short)0,(short)(start_row),(short)0);
data_validation.setDataValidationType(HSSFDataValidation.DATA_TYPE_LIST);
data_validation.setFirstFormula(strFormula);
data_validation.setSecondFormula(null);
data_validation.setExplicitListFormula(false);
data_validation.setSurppressDropDownArrow(false);
data_validation.setEmptyCellAllowed(false);
data_validation.setShowPromptBox(false);
data_validation.createErrorBox("Invalid input !", "Something is wrong ; check
condition !");
data_validation.createPromptBox("Hi , dear user !", "So , you just selected me
! Thanks !");
fSheet.addValidationData(data_validation);

this is working fine,,,,
but i want to pass the string as comma seperated as the SOURCE for data
validation
Comment 2 Nick Burch 2008-01-28 04:31:20 UTC
Please ask usage questions on the mailing lists