Default Table Style not retrieved

Looks like Default Table Style is not retrieved from Excel.
Create a new Excel File > In ribbon open Format As Table > Right click one of the styles and choose Set as Default.
Observe that this value is saved in xml files of excel in styles.xml
<tableStyles count=“0” defaultTableStyle=“TableStyleDark3” defaultPivotStyle=“PivotStyleLight16” />
When loading up this excel file in Aspose.Cells.Workbook or Worksheets.TableStyles in dotnet, there is no reference to default table style.

How do I get the default table style defied in excel? I’m using version 21.7.0

@axar,

Formatting or styles regarding Tables are stored/retrieved via ListObject in the worksheet. You may try to use ListObject.TableStyleName/TableStyleType to get/set the table style name. See the sample code with attached template file for your reference:
e.g.
Sample code:

Workbook workbook = new Workbook("g:\\test2\\Bk_defaulttablestyle1.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
ListObject table1 = worksheet.ListObjects[0];

Console.WriteLine(table1.TableStyleName);
Console.WriteLine(table1.TableStyleType.ToString()); 

Hope, this helps a bit.
Bk_defaulttablestyle1.zip (7.1 KB)

Thanks; however, the workbook doesn’t have any tables.

We are using this workbook as Template and we would like the use to be able to define default table style without inserting a table. Excel allows saving default table style without table in workbook by right clicking a Table Style. This is also saved in workbook xml data.

@axar,

Could you please zip and attach sample Excel file, we will check it soon.

Attached excel.
test-style-book.zip (5.6 KB)

Create a new Table and observe the style is “Table Styling Dark 3”, which is defaulted.

@axar
Through sample file testing, we can reproduce the issue. Currently, there is no interface to obtain default table and pivot table styles.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-53937

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like

@axar,

We are pleased to inform you that your issue has been resolved. The fix/enhancement will be included in our upcoming release (Aspose.Cells 23.9) which is scheduled in the first half of September 2023. You will be notified when the next version is released.

1 Like

Thanks for your help. Appreciate the speedy response in getting this issue resolved.

@axar,

You are welcome.

The issues you have found earlier (filed as CELLSNET-53937) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi