I have following problem on Cells.CopyCellRange method. Does this method actually copying the data validation as well for that cell?
I have 2 simple cell which being configure as:
Allow: Whole Number
Data: greater than or equal to
And then I open Workbook using Aspose 188.8.131.52 (Aspose.Cells Java version) and then Copy the these two cell using API Cells.CopyCellRange. The result is All the cells has been copied (including the color and background) however, the data validation is not being copy at all.
please help me.
here are the sample of copy cell:
worbook = new Workbook();
sheet1 = workbok.getWorksheets().sheet(0);
sheet1.getCells().copyCellRange(sheet1.getCells(), 0, 0, 0, 1, 2, 1);
sheet1.getCells().copyCellRange(sheet1.getCells(), 0, 0, 0, 2, 2, 1);
if you open ‘saveTest.xls’ using excel, those validation only apply for 1st column but not the other 2 columns.
Just wondering how is the fix going? In mean time, how do I copy the validation from one cell to another cell while waiting for the fixes?
Currently we do not support to copy other objects such as Shape,
Validation, ConditionalFormattings and so on when copying cell range.
However, in next fix we will provide a method for your related requirement at https://forum.aspose.com/t/125063 soon:
Validation com.aspose.cells.Validations.getValidationInCell(int row, short column)
Gets the Validation for given cell.
- row cell's row index
- column cell's column index
- Validation for given cell. If no validation defined for given cell, null will be returned.