Hi there,
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
Minimum: 0
And then I open Workbook using Aspose 2.5.4.12 (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.
Cheers,
Hi,
here are the sample of copy cell:
worbook = new Workbook();
workbook.open(“TestExcel.xls”);
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);
workbook.save(“saveTest.xls”);
if you open ‘saveTest.xls’ using excel, those validation only apply for 1st column but not the other 2 columns.
Cheers,
Hi,
Hi Sahi,
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?
Cheers,
Hi,
Hi,
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.
- Parameters:
- row cell's row index
- column cell's column index
- Returns:
- Validation for given cell. If no validation defined for given cell, null will be returned.
The issues you have found earlier (filed as 29247; 29247) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.