Missing Styles extraction from Excel Sheet

In the attached Excel my customer claims that there are 81 Styles as below. I am only able to fine 62. How do I get the remaining. For example I am missing "Warning Text", "Total", "Output", "Note", "Neutral", "Linked Cell", "Heading 4", "Heading 3", "Input", "Explanatory Text", "Calculation", "Check Cell" etc. How do I get the missing ones?

Thanks,
Rohit
{
"namedStyles": [
{"name": "Warning Text","foreColor": "#FF0000","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "Total","foreColor": "Text 1 0","font": "normal bold 16px Arial","themeFont": "Body"},
{"name": "Title","foreColor": "Text 1 24","font": "normal bold 29.3px Arial","themeFont": "Headings"},
{"name": "Percent"},
{"name": "Output","backColor": "#F2F2F2","foreColor": "#3F3F3F","font": "normal bold 16px Arial","themeFont": "Body"},
{"name": "Note","backColor": "#FFFFCC"},
{"name": "Normal","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "Neutral","backColor": "#FFEB9C","foreColor": "#9C6500","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "Linked Cell","foreColor": "#FA7D00","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "Input","backColor": "#FFCC99","foreColor": "#3F3F76","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "Heading 4","foreColor": "Text 2 0","font": "normal bold 14.7px Arial","themeFont": "Body"},
{"name": "Heading 3","foreColor": "Text 1 24","font": "normal bold 18.7px Arial","themeFont": "Body"},
{"name": "Heading 2","backColor": "Accent 1 79","foreColor": "Text 1 24","font": "normal bold 16px Arial","themeFont": "Body"},
{"name": "Heading 1","foreColor": "Text 2 0","font": "normal bold 20px Arial","themeFont": "Body"},
{"name": "Good","backColor": "#C6EFCE","foreColor": "#006100","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "Explanatory Text","foreColor": "#7F7F7F","font": "italic normal 16px Arial","themeFont": "Body"},
{"name": "Currency [0]"},
{"name": "Currency"},
{"name": "Comma [0]"},
{"name": "Comma"},
{"name": "Check Cell","backColor": "#A5A5A5","foreColor": "Background 1 0","font": "normal bold 16px Arial","themeFont": "Body"},
{"name": "Calculation","backColor": "#F2F2F2","foreColor": "#FA7D00","font": "normal bold 16px Arial","themeFont": "Body"},
{"name": "Bad","backColor": "#FFC7CE","foreColor": "#9C0006","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "Accent6","backColor": "Accent 6 0","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "Accent5","backColor": "Accent 5 0","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "Accent4","backColor": "Accent 4 0","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "Accent3","backColor": "Accent 3 0","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "Accent2","backColor": "Accent 2 0","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "Accent1","backColor": "Accent 1 0","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "60% - Accent6","backColor": "Accent 6 39","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "60% - Accent5","backColor": "Accent 5 39","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "60% - Accent4","backColor": "Accent 4 39","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "60% - Accent3","backColor": "Accent 3 39","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "60% - Accent2","backColor": "Accent 2 39","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "60% - Accent1","backColor": "Accent 1 39","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "40% - Accent6","backColor": "Accent 6 59","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "40% - Accent5","backColor": "Accent 5 59","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "40% - Accent4","backColor": "Accent 4 59","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "40% - Accent3","backColor": "Accent 3 59","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "40% - Accent2","backColor": "Accent 2 59","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "40% - Accent1","backColor": "Accent 1 59","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "20% - Accent6","backColor": "Accent 6 79","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "20% - Accent5","backColor": "Accent 5 79","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "20% - Accent4","backColor": "Accent 4 79","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "20% - Accent3","backColor": "Accent 3 79","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "20% - Accent2","backColor": "Accent 2 79","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "20% - Accent1","backColor": "Accent 1 79","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle15","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle62","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle63","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle64","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle65","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle66","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle67","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle68","foreColor": "Text 1 0","font": "normal bold 16px Arial","themeFont": "Headings"},
{"name": "__builtInStyle69","foreColor": "Text 1 0","font": "normal bold 16px Arial","themeFont": "Headings"},
{"name": "__builtInStyle70","foreColor": "Text 1 0","font": "normal bold 16px Arial","themeFont": "Headings"},
{"name": "__builtInStyle71","foreColor": "Text 1 0","font": "normal bold 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle72","foreColor": "Text 1 0","font": "normal bold 16px Arial","themeFont": "Headings"},
{"name": "__builtInStyle73","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle74","parentName": "Heading 3","foreColor": "Text 1 24","font": "normal bold 18.7px Arial","themeFont": "Body"},
{"name": "__builtInStyle75","parentName": "Heading 3","foreColor": "Text 1 24","font": "normal bold 18.7px Arial","themeFont": "Body"},
{"name": "__builtInStyle76","backColor": "Accent 1 39","parentName": "60% - Accent1","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle77","backColor": "Accent 1 39","parentName": "60% - Accent1","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle78","backColor": "Accent 1 39","parentName": "60% - Accent1","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle79","backColor": "Accent 1 39","parentName": "60% - Accent1","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle80","backColor": "Accent 1 39","parentName": "60% - Accent1","foreColor": "Background 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle81","parentName": "Heading 3","foreColor": "Text 1 24","font": "normal bold 18.7px Arial","themeFont": "Body"},
{"name": "__builtInStyle82","parentName": "Title","foreColor": "Text 1 24","font": "normal bold 29.3px Arial","themeFont": "Headings"},
{"name": "__builtInStyle83","parentName": "Title","foreColor": "Text 1 24","font": "normal bold 29.3px Arial","themeFont": "Headings"},
{"name": "__builtInStyle84","parentName": "Title","foreColor": "Text 1 24","font": "normal bold 29.3px Arial","themeFont": "Headings"},
{"name": "__builtInStyle85","parentName": "Heading 3","foreColor": "Text 1 24","font": "normal bold 18.7px Arial","themeFont": "Body"},
{"name": "__builtInStyle86","parentName": "Heading 2","foreColor": "Text 1 24","font": "normal bold 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle87","parentName": "Heading 2","foreColor": "Text 1 24","font": "normal bold 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle88","parentName": "Heading 2","foreColor": "Text 1 24","font": "normal bold 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle89","parentName": "Heading 2","foreColor": "Text 1 24","font": "normal bold 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle90","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle91","foreColor": "Text 1 0","font": "normal normal 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle92","parentName": "Heading 3","foreColor": "Text 1 24","font": "normal bold 18.7px Arial","themeFont": "Body"},
{"name": "__builtInStyle93","parentName": "60% - Accent1","foreColor": "Background 1 0","font": "normal bold 16px Arial","themeFont": "Body"},
{"name": "__builtInStyle94","parentName": "Heading 4","foreColor": "Text 2 0","font": "normal bold 14.7px Arial","themeFont": "Body"}
]
}

Any updates on this ?

Hi Rohit,

Thanks for your posting and using Aspose.Cells.

Please let us know the cell names and styles which you think are missing so that we could investigate this issue at our end and help you.

Hi Shakeel,


I think I may have made an mistake. In the attached document I am getting 100+ Styles. Can you validate. On the same note, every cell has an api called "getSharedStyleIndex"

Which index is it referencing to ? I am extracting all styles as
for (int i = 0; i < workbook.getCountOfStylesInPool(); i++) {
Style c = workbook.getStyleInPool(i);
}

thanks,
Rohit


Hi Rohit,

Thanks for your posting and using Aspose.Cells.

SharedStyleIndex is actually the index of cell style in style pool. If two cells share the same style, then their shared style indices will be same.

Please check the source Excel file attached with this post. Cells A1, B1 have same style, they are yellow cell and cells C1, D1 have also same style, they are red cells. If you check the share style indices of these cells, you will find A1 and B1 have same index while C1 and D1 have same index.

Please see the following sample code and its console output for your reference.

Java


Workbook workbook = new Workbook(“source.xlsx”);


Worksheet worksheet = workbook.getWorksheets().get(0);


Cell cell1 = worksheet.getCells().get(“A1”);

Cell cell2 = worksheet.getCells().get(“B1”);

Cell cell3 = worksheet.getCells().get(“C1”);

Cell cell4 = worksheet.getCells().get(“D1”);


//Yellow Colored Cells

System.out.println(cell1.getSharedStyleIndex());

System.out.println(cell2.getSharedStyleIndex());


//Red Colored Cells

System.out.println(cell3.getSharedStyleIndex());

System.out.println(cell4.getSharedStyleIndex());


Console Output:
21
21
22
22

Hi Shakeel,

Thanks this helps

Rohit