Free Support Forum - aspose.com

Conditional Formatting doesn't work in Smart Markers with shift

Hi,

I came across an issue that the conditional formatting.

If any cell has conditional formatting and with smart marker variable:

&=$VariableArray(horizontal,shift)
or
&=[Table1].ColumnA(horizontal,shift)

the conditional formatting is not copied to the “expanded” cells, but if I don’t use the “shift”, i can see the conditional formatting exist in these new cells.

is it by design or a bug? In our case, if we want to fill the values horizontally, we have to use the “shift” otherwise the columns won’t be aligned.

Thanks

@4engkai,

Thanks for the details.

It might be a bug but we are not sure about it. Could you provide us sample code (runnable) or preferably a simple console demo application (you may zip it prior attaching it here) and template file to show the issue, we will log a ticket with the artifacts after confirming the issue to get it resolved.

PS. Please use dynamic dataset/datatable in code to remove any inter dependencies with external source or database, so we could run your code seamlessly.

Hi,

A sample code is attached.

ConsoleApp27.zip (155.9 KB)

Because of the upload file size limitation, the Aspose.Cells.dll is not included, please add it to the “lib” folder which is referenced by the project, and after you run it, please check the generated “Result.xlsx” file.

Thanks

@4engkai,

Thanks for providing us sample code with template file.

After an initial test, I am able to reproduce the issue as you mentioned by using your sample code with your template file. I found that the conditional formatting does not work properly in Smart Markers with shift parameter.
e.g
Sample code:

   var wbd = new WorkbookDesigner(); 
            wbd.Workbook = new Workbook("e:\\test2\\ConditionalFormattingTest.xlsx"); 

            wbd.SetDataSource("Array1", new string[5] { "A", "B", "C", "D", "E" }); 

            var dataTable = new DataTable("Table1"); 
            dataTable.Columns.Add("ColumnA"); 

            for (var i = 0; i < 5; i++) 
            { 
                var dr = dataTable.NewRow(); 
                dr["ColumnA"] = "Row" + i; 
                dataTable.Rows.Add(dr); 
            } 

            wbd.SetDataSource(dataTable); 

            wbd.Process(); 

            var ms = new MemoryStream(); 

            wbd.Workbook.Save(ms, SaveFormat.Xlsx); 

            using (FileStream file = new FileStream("e:\\test2\\out1.xlsx", FileMode.OpenOrCreate, FileAccess.Write)) 
            { 
                ms.WriteTo(file); 
            }   

I have logged a ticket with an id “CELLSNET-46048” for your issue. We will look into it soon.

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

@4engkai,

This is to inform you that we have fixed your issue (logged earlier as “CELLSNET-46048”) now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

Thanks! @Amjad_Sahi

@4engkai

Thanks for using Aspose APIs.

Please download and try the following fix and let us know your feedback.

@shakeel.faiz, CELLSNET-46048 is fixed for me, thanks!

@4engkai

Thanks for your feedback and using Aspose.Cells.

It is good to know that your issue is resolved with the latest fix. Let us know if you encounter any other issue, we will be glad to look into it and help you further.

The issues you have found earlier (filed as CELLSNET-46048) have been fixed in this update. Please also check the document/article for your reference: https://docs.aspose.com/display/cellsnet/Installation