Conditional formatting is not retaining after excel is processed in Aspose dll


#1

Conditional formatting is not retaining after excel is processed in Aspose dll.
Below are the details:

Tool using–
Dll Name : Aspose.Cells
Version: 19.2.0.0

Below is the code snippet–
Workbook sourceWorkbook = new Workbook(@“ConditionalFormattingIssue.xlsx”);
sourceWorkbook.Save(“ConditionalFormattingIssue_Output.xlsx”);

attached below files
“ConditionalFormattingIssue.xlsx” —> File before processing in Aspose dll
“ConditionalFormattingIssue_Output.xlsx” --> File after processing in Aspose dll
“ConditionalFormattingIssue_Output_1.xlsx” --> File created after opening “ConditionalFormattingIssue_Output.xlsx” file and saved the file using “SaveAs” functionality.

Here on opening of “ConditionalFormattingIssue_Output_1.xlsx” file it showing some error and it loosing conditional formatting. (might be some configuration related to conditional formatting is loosing after processing in Aspose Dll)

If you have any doubts please reach out to us.

Thanks,

ConditionalFormattingIssue.zip (20.4 KB)


#2

@rajendrak,

I tested your scenario/ case using the following sample code and template file with Aspose.Cells for .NET v19.8.x (please try it), it works fine and the output file (attached) is ok with conditional formattings in tact (when opening the file into MS Excel):
e.g
Sample code:

Workbook sourceWorkbook = new Workbook("e:\\test2\\ConditionalFormattingIssue.xlsx");
            sourceWorkbook.Save("e:\\test2\\out1.xlsx");

Please open the output file (attached) into MS Excel and let us know if you see any issue. In case, your scenario is little different then explain and provide more details to reproduce the issue on our end, we will check it soon.
files1.zip (7.5 KB)


#3

Hi,
yes the output file “out1.xlsx” is ok with conditional formatting.
But my concern is if you will open out1.xlsx file in MS excel and save it using SaveAs functionality of MS Excel, lets save it with name “out2.xlsx”. After that open out2.xlsx file which is not able to retain conditional formatting.
That is the issue, Could you please check on this why after saveas with different name is not retaining conditional formatting?

Thanks,


#4

@rajendrak,

Thanks for providing further details.

I am able to reproduce the issue as you mentioned. I found conditional formatting is not retained after MS Excel processes file (open and save/save it as) upon the file (saved by Aspose.Cells APIs). Even MS Excel prompts an error message “Excel found unreadable content…” when opening the output file into it. I used the following two steps to reproduce the issue:

Step 1) - Ok
I used the following sample code and template file with Aspose.Cells for .NET v19.8.x, it works fine and the output file (attached) is ok with conditional formattings in tact (when opening the file into MS Excel):
e.g
Sample code:

Workbook sourceWorkbook = new Workbook("e:\\test2\\ConditionalFormattingIssue.xlsx");
sourceWorkbook.Save("e:\\test2\\out1.xlsx");

Step 2) - Not Ok
If I open out1.xlsx file into MS Excel and save it using SaveAs functionality of MS Excel, the output file is not Ok. When I open out2.xlsx file which is not able to retain conditional formatting and that is the issue.

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

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


#5

@rajendrak,

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


#6

@rajendrak,

Please try our latest version/fix: Aspose.Cells for .NET v19.8.5 (attached)

Your issue should be fixed in it.

Let us know your feedback.
Aspose.Cells19.8.5 For .Net2_AuthenticodeSigned.Zip (4.9 MB)
Aspose.Cells19.8.5 For .Net4.0.Zip (4.9 MB)