Aspose Cell : How to extract the Table details

We are now able to get the single table details out. Any idea how to get these out ?


BudgetDetails
1
1
61
6
true
true
false
false
true
false
Family Budget Table Style
Text 2 0
normal bold 10pt Arial
Accent 1 0
normal bold 10pt Arial
Accent 1 0
6
Text 2 0
normal normal 10pt Arial
Background 1 -24
1
Accent 1 79
2
1
59
6
-1
Description
null
Total
-1
Category
null
null
-1
Projected Cost
null
“7915”
-1
Actual Cost
null
“7860”
-1
Difference
null
“55”
-1
Actual Cost Overview
null
null

Hi,

Thanks for your posting and using Aspose.Cells.

Please see the following sample code which extracts your Table and its Style Information from your source Excel file. I have also shown the console output of this code for your reference.

Java


Workbook workbook = new Workbook("__Trends_1_1_1_18_1_SingleCF.xlsx");


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


//Access your Table object

ListObject lo = worksheet.getListObjects().get(0);


System.out.println("Display Name: " + lo.getDisplayName());

System.out.println("Table Style Name: " + lo.getTableStyleName());

System.out.println("Custom: " + (lo.getTableStyleType() == TableStyleType.CUSTOM));


System.out.println("Start Column: " + lo.getStartColumn());

System.out.println("End Column: " + lo.getEndColumn());

System.out.println("Start Row: " + lo.getStartRow());

System.out.println("End Row: " + lo.getEndRow());


System.out.println("Show Header Row: " + lo.getShowHeaderRow());


System.out.println(“List Columns Count: " + lo.getListColumns().getCount());

System.out.println(“First Column Name: " + lo.getListColumns().get(0).getName());


//Access your custom defined Table

System.out.println(”\r\n---------------Reading Custome Definied Table Style----------”);


TableStyle ts = workbook.getWorksheets().getTableStyles().get(0);

System.out.println("Table Style Name: " + ts.getName());

System.out.println("Table Style Elements Count: " + ts.getTableStyleElements().getCount());


TableStyleElement tse = ts.getTableStyleElements().get(1);

System.out.println("Is Header Row: " + (tse.getType() == TableStyleElementType.HEADER_ROW));

Style tseStyle = tse.getElementStyle();


System.out.println("Header Row Font Name: " + tseStyle.getFont().getName());

System.out.println("Header Row Font Size: " + tseStyle.getFont().getSize());

System.out.println("Header Row Font Italic: " + tseStyle.getFont().isItalic());


//Create built-in Table Style

TableStyle builtinTs = workbook.getWorksheets().getTableStyles().getBuiltinTableStyle(TableStyleType.TABLE_STYLE_DARK_1);

Console Output:
Display Name: BudgetDetails
Table Style Name: Family Budget Table Style
Custom: true
Start Column: 1
End Column: 6
Start Row: 1
End Row: 61
Show Header Row: true
List Columns Count: 6
First Column Name: Description

---------------Reading Custome Definied Table Style----------
Table Style Name: Family Budget
Table Style Elements Count: 2
Is Header Row: true
Header Row Font Name: Georgia
Header Row Font Size: 10
Header Row Font Italic: true