poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Weber, Christian" <Christian.We...@ids-scheer.com>
Subject Using HSSFDataValidation for list constraints
Date Mon, 09 Feb 2009 15:08:05 GMT
Hi all,

 

I want to add an HSSFDataValidation to a sheet on my excel workbook. I
found already some code examples where an HSSFDataValidation was created
by a no-arg constructor but this seems to be not possible anymore under
3.2-FINAL.

 

So instead I used this code:

 

DVConstraint constraint =
DVConstraint.createExplicitListConstraint(excelListValues);

            CellRangeAddressList cellRange = new CellRangeAddressList(
cell.getRowIndex(),

 
cell.getColumnIndex(),

 
cell.getRowIndex(),

 
cell.getColumnIndex() );

            HSSFDataValidation dataValidation = new
HSSFDataValidation(cellRange, constraint);

            cell.getSheet().addValidationData(dataValidation);

 

for a given HSSFCell cell.

 

But when I open the finished XLS there is no list constraint set for the
cell. Did I forget to call some other method to activate the constraint
or something?

 

 

Thanks in advance

Best regards

 

Christian


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message