In the internal representation of an Excel spreadsheet the styles in the workbook are grouped together in styles.xml.
I attached a spreadsheet and two xml files to see what I mean.
The first 7 values are all bold. If you look at sheet1.xml which is open xml data of sheet 1, all 7 cells reference style “1” which is stored in styles.xml:
As you can see all the cells reference style "1" through the s attribute.
My question to you guys is this. In Apose, are there any methods that allow me to identify the unique styles of a workbook, and then for any given cell, can I identify which unique style that cell uses, in the same way as it is in the internal representation of the spreadsheet? I know about the getStyle or getDisplay style Cell methods but they return objects. I want to be able to identify the unique styles then I want to know for each cell which style that cell uses.
This link gives you more information about the open xml format and the significance of the different tags & attributes.
You can get the style of the cell using the Cell.GetStyle() method. Then if your cell is using named style, then you can access it from Style object using the Style.ParentStyle, it will return the named style which is stored in xml. Please try the Style.ParentStyle property for your needs.
You can also find all the named styles by iterating the Workbook.Styles collection.
The internal definition of the spreadsheet keeps a list of a unique styles even though they are not named. Is there in the Aspose.Cells api a function that can return me those styles? Also is there a way to link a cell to the unique style associated with that cell.
Can you please pass my question to a developer? He/she should know about the internal representation of a spreadsheet and should understand my question.
To better understand what I want, I wrote a little program that uses the Microsoft Open XML SDK 2.5 (http://msdn.microsoft.com/en-us/library/office/bb448854.aspx). You can add it to the c# project via the NuGet (search for DocumentFormat.OpenXml).
I don’t want to use the Microsoft SDK, if Aspose.Cells provides the api to do the same thing.
Here is the source code:
using System; using System.Data; using System.Drawing; using System.Drawing.Imaging; using System.Linq; using System.Linq.Expressions; using System.Text; using Aspose.Cells; using Aspose.Cells.Charts; using Aspose.Cells.Drawing; using Aspose.Cells.Pivot; using Aspose.Cells.Rendering; using Aspose.Cells.Tables; using DocumentFormat.OpenXml.Packaging; using TestAspose.NorthwindDataSetTableAdapters; using pk =DocumentFormat.OpenXml.Packaging; using ox=DocumentFormat.OpenXml; using oxs = DocumentFormat.OpenXml.Spreadsheet;
Well, you want to access all the styles that are in pool. We will look into this requirement and have logged your issue for investigation. We will see if we could provide you some API for this. This issue has been logged as CELLSNET-41992.
Please spare us some time. Once, we will have some update for you, we will let you know asap.
The conditional style is different with normal style, so it’s not in this style.
We are looking into how to provide it to you. Once, we will have some other update for you, we will let you know asap.