How to get the icon used in the conditional formatting of a cell

Hi:

Using the aspose api, how can I read what icon was used in the formatting of a cell with conditional formatting that uses Icon Sets (i.e. the icon that displayed in the cell as a result of the conditional formatting evaluation)? I attached a spreadsheet that has quite a few cells with this kind of formatting, perhaps you can post a sample.

Also is it possible to export the icon to an image? I noticed that the export to pdf includes such an icon, however the export to html doesn’t.

Thank you

Hi,


Sorry for a bit delay.

We are working over your query and may soon share a sample code snippet for your needs here.

Thank you.

Hi,


I am afraid, I tried to find out the appropriate API to read/get the conditional formatting types and their sub types etc. in Aspose.Cells API Reference but it looks the API for your needs are not currently available or supported. I have logged a ticket as an id “CELLSNET-41605” for your feature request in our database. We will look into it in the next month to sort it out. Your thread is also linked to the appropriate JIRA ticket, so that once it is resolved, you could be notified here.

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

Thank you.

Could you please tell me where this is at?

Thank you

Hi,


I checked the status of your issue, it is fixed. Hopefully, we could provide you a new fix/supported version before the end of this week or so.

Keep in touch,

Thanks,

Sounds great! Thank you

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

Please download and try this fix: Aspose.Cells for .NET v7.4.3.2 with the following code.

C#


Workbook workbook = new Workbook(@“D:\Shapes\user\2007\Testoutput.xlsx”);


Worksheet sheet = workbook.Worksheets[0];


Cell cell=sheet.Cells[“A1”];


ConditionalFormattingResult cfr = cell.GetConditionalFormattingResult();


ConditionalFormattingIcon icon = cfr.ConditionalFormattingIcon;


File.WriteAllBytes(“c:\2.jpg”,icon.ImageData);




Thank you!

I just noticed that the icons generated by aspose are slightly different than the ones in Excel. Just as an example, the oblique arrow pointing up. N10.jpg is the one generated using Aspose and arrow.png is a screenshot of excel. But I don’t think it is a problem.

Would it be possible to generate gif files with transparent backgrounds instead of jpg?

Thanks again!


I used this code:

System.Drawing.Image image1 = System.Drawing.Image.FromStream(new MemoryStream(icon.ImageData));

File.WriteAllBytes(String.Format(@“c:\temp{0}.jpg”, cellName), icon.ImageData);
image1.Save(String.Format(@“c:\temp{0}.gif”, cellName), ImageFormat.Gif);
image1.Save(String.Format(@“c:\temp{0}_1.jpg”, cellName), ImageFormat.Jpeg);

but the saved image doesn’t look very good.

See the attachments. N11.jpg is the one generated using aspose.

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

We have generated the image of cell N11 and found that it is generated fine. Please see the following code and the attached generated image. If you encounter any issue, please provide us your runnable sample code to look into this issue.

C#


Workbook workbook = new Workbook(@“F:\Shak-Data-RW\Downloads\Testoutput.xlsx”);


Worksheet sheet = workbook.Worksheets[0];


Cell cell = sheet.Cells[“N11”];


ConditionalFormattingResult cfr = cell.GetConditionalFormattingResult();


ConditionalFormattingIcon icon = cfr.ConditionalFormattingIcon;


File.WriteAllBytes(@“F:\Shak-Data-RW\Downloads\N11.jpg”, icon.ImageData);



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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.