We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Problem with remove validations - Urgent

Hi,

M populating the values in the sheets attached from database. For X Month and X Year End Turn row - there are validations added (list type to contain Y/N upto 25 columns).

At runtime, when I am finished populating the columns, I remove the valiations for the remaining columns using following code.

Start Row = 16, End Row = 22, Start Columns should be immediate column after Entity 2 and End column is 250. The problem is, after using this code the validations are getting removed for the specified cell area but all the rows for Entity 1 and Entity 2 are getting converted to drop downs. How is this happening? Please treat this urgent.

private void RemoveValidations(Int32 startRow, Int32 endRow, Int32 startCol, Worksheet localSheet)

{

CellArea clArea = new CellArea();

clArea.StartRow = startRow;

clArea.EndRow = endRow;

clArea.StartColumn = startCol;

clArea.EndColumn = 250;

Validations valid = localSheet.Validations;

if (valid.Count > 0){

valid.RemoveArea(clArea);

}

}

Following method is not causing any issues! But will be efficient in terms of performance if I loop till 255 columns of the sheet? If not, please provide any suitable alternative.

private void RemoveValidations(Int32 startRow, Int32 endRow, Int32 startCol, Worksheet localSheet)

{

for (Int32 i = startRow; i < endRow; i++)

{

for (Int32 j = startCol; j < 50; j++)

{

localSheet.Validations.RemoveACell(i, j);

}

}

}

Hi,

Thanks for providing us details.

We have found the issue and will fix it soon.

We have logged it into our issue tracking system with an issue id: CELLSNET-16393.

Thank you.

Hi,

Please try the attached version.<span style=“font-size: 11pt; font-family: “Arial”,“sans-serif”;”> We
have fixed the issue of Removing Validations. Please use
Validations.RemoveArea method.<o:p></o:p>

Sample code:

Workbook workbook = new Workbook();

workbook.Open(@"F:\FileTemp\refSheet.xls");

CellArea ca = new CellArea();

ca.StartRow = 16;

ca.EndRow = 22;

ca.StartColumn = 0;

ca.EndColumn = 250;

workbook.Worksheets[0].Validations.RemoveArea(ca);

workbook.Save(@"F:\FileTemp\dest.xls");


Thank you.

The issues you have found earlier (filed as 16393) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.