Validation is not correctly copiied from one worksheet to another

Hi,

I copy a column from on worksheet to another. I looks good, except the validation:

Code to reproduce:

const string srcFilePath = @"C:\temp\DataTest\AsposeTest\ValidationTest\SrcBook.xlsm";
const string tgtFilePath = @"C:\temp\DataTest\AsposeTest\ValidationTest\TgtBook.xlsm";

Workbook wb = new Workbook(srcFilePath);
Worksheet sheetSrc = wb.Worksheets["Data"];
Worksheet sheetTgt1 = sheetSrc;
Worksheet sheetTgt2 = wb.Worksheets["Data2"];

Range sourceRange = sheetSrc.Cells.CreateRange(0, 1, true);
Range destRange1 = sheetTgt1.Cells.CreateRange(1, 1, true);
Range destRange2 = sheetTgt2.Cells.CreateRange(0, 1, true);
PasteOptions options = new PasteOptions
{
	PasteType = PasteType.All
};
destRange1.Copy(sourceRange, options);      //<-- Works
destRange2.Copy(sourceRange, options);      //<-- Does not work correctly

wb.Save(tgtFilePath);

CopyValidation.zip (69.8 KB)

SrcBook.xlsm and TgtBook.xlsm are in the zip file.

grafik.png (10.5 KB)

On worksheet “Data”, the copied validation is correct, on “Data2” not:

grafik.png (13.4 KB)

It worked with an older version, but I don´t know which one.

Let me know if you need more information.

Edit: Used version 17.10.0 and 17.10.3

@sabrinaluedtke,

Thanks for the template files, sample code and screenshots.

After an initial test, I am able to reproduce the issue as you mentioned (as per your screenshots) by using your sample code with your template files. I found that validation is not correctly copied from one worksheet to another. I have logged the following issue into our database:

  • CELLSNET-45760 - Validation is not correctly copied from one worksheet to another

We will look into your issue soon.

Once we have an update on it, we will let you know here.

@sabrinaluedtke,

This is to inform you that we have fixed your issue “CELLSNET-45760” now. We will soon provide you the fix after performing QA and incorporating other enhancements and fixes.

The issues you have found earlier (filed as CELLSNET-45760) have been fixed in this Aspose.Cells for .NET 17.11 update.

Please also check the following article:

Hi,

Works fine. Thanks.

But i now get a lot of Debug.WriteLine (With no content) when calling Range.Copy(From, options).

grafik.png (4.7 KB)
grafik.png (928 Bytes)

Is this wanted?

@sabrinaluedtke,

I am not sure about your issue. Could you provide us more details and sample code (runnable) with template files to reproduce the issue, we will check it soon.

Hi,

Use the same code as mentioned in the first post, and the same xlsm files.
Use Aspose Cells from Nuget:
grafik.png (4.7 KB)

You will get a lot of senseless Debug.WriteLine or Console.WriteLine.

@sabrinaluedtke

Thanks for using Aspose APIs.

Please download and try the following latest fix and let us know your feedback. It fixes the issue CELLSNET-45760.

Same with this version.
Check the code for Debug.WriteLine and Console.WriteLine, or other logging mechanism, that writes to that output.

@sabrinaluedtke,

Please make sure you are using the latest fix/version: Aspose.Cells for .NET v17.11.1. I have tested with it and could not find the issue (i.e., get a lot of Debug.WriteLine (With no content) when calling Range.Copy(From, options)) which was there in v17.11.0. You may print the version number at the start to confirm if you are using the latest fix:
e.g
Sample code:

..........
Console.WriteLine(CellsHelper.GetVersion());
..........

Let us know if you still find the issue.

Ok, thanks.
Sorry, my fault. I used the nuget version again.
The version via nuget says officially it is 17.11.1, but is 17.11.0.
This should be fixed too:

grafik.png (11.5 KB)
grafik.png (9.3 KB)

Problem with Debug.Prints solved.

@sabrinaluedtke,

Thanks for the screenshots.

Good to know that your issue is sorted out by the new fix/version.

You are right. Well, we first uploaded the Aspose.Cells for .NET v17.11 version to nuget repos. but we had to remove it since it has some issues. I think there are some issues or some sort of limitation over nuget repos which might not remove the version (we uploaded) completely. We tried to upload fixed version with same name/version number v17.11.0 but we were not successful. We later even tried to edit the existing package to replace the Dlls but in vain. In short, we have to live with version number, i.e., v17.11.1 (although it has Dlls version v17.11.0).