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

Free Support Forum - aspose.com

Worksheet CopyConditionalFormatting not working

Can you check why copying of conditional formatting rules from one cell to another doesnt work?

Please see attached input and output and below code.

It is supposed to copy cell highlighting conditional formatting rules from J2 to K2

Workbook wb = new Workbook(sTemplate);

String sOutputFileName = ReportName + ReportExtension;

//modify data:

Worksheet ws = wb.Worksheets[“Data”];
//ws.Cells.DeleteRows(20, 300);


ws.CopyConditionalFormatting(0, 9, 0, 10);


wb.Save(sOutputFolder + @"" + “Test-Output.xlsx”, SaveFormat.Xlsx);

Hi,

Thanks for your posting and using Aspose.Cells.

Please note, in Aspose.Cells, row index or column index starts from 0 not 1.

Please change this line

ws.CopyConditionalFormatting(0, 9, 0, 10);

into

ws.CopyConditionalFormatting(1, 9, 1, 10);

and your issue should be fixed.