Click or drag to resize
SheetOpenTableByDefinedName Method
Opens the table with the specified name defined in Excel and returns the Table object.

Namespace: Aceoffix.ExcelReader
Assembly: Aceoffix (in Aceoffix.dll) Version: 5.0.0.1
Syntax
public Table OpenTableByDefinedName(
	string DefinedName
)

Parameters

DefinedName
Type: SystemString
The name defined in Excel can be a global name or a local name. This method will only be valid when the table has a DedinedName.

Return Value

Type: Table
Return a Table object.
Examples
The following code example shows how to use the OpenTableByDefinedName to get the value of the specified table.
Aceoffix.ExcelReader.Workbook wb = new Aceoffix.ExcelReader.Workbook();
Aceoffix.ExcelReader.Sheet sheet1 = wb.OpenSheet("sheet1");
//Get the data of a table
Aceoffix.ExcelReader.Table table1 = sheet1.OpenTableByDefinedName("SalesInfo"); 
while (!table1.EOF)
{
    string strValues = "";
    if (!table1.DataFields.IsEmpty)
    {
        for (int i = 0; i < table1.DataFields.Count; i++)
            strValues = strValues + table1.DataFields[i].Value + "&nbsp;&nbsp;";
        // Output the data to the current page. Typically, you can save them to the database.
        Response.Write(strValues + "<br>\r\n");
    }
    table1.NextRow();
}
table1.Close();
Response.Write("table1.RowCount = " + table1.RowCount.ToString());
wb.ShowPage(800, 600); // Pop up a HTML dialog to show the data of table. 
wb.Close();
See Also