Skip to main content

IXlTableStyleInfo.Name Property

Gets or sets the name of the built-in style applied to a table.

Namespace: DevExpress.Export.Xl

Assembly: DevExpress.Printing.v23.2.Core.dll

NuGet Package: DevExpress.Printing.Core

Declaration

string Name { get; set; }

Property Value

Type Description
String

A string specifying the built-in table style name.

Remarks

Use this property to apply one of the Microsoft® Excel® built-in table styles to the table. Note that the built-in table style names can be obtained as constant fields of the XlBuiltInTableStyleId class.

If the style name is not valid, the table will be formatted using the None table style that specifies no formatting for the table.

Example

Note

A complete sample project is available at https://github.com/DevExpress-Examples/excel-export-api-examples

IXlTable table;
// Specify an array containing column headings for a table.
string[] columnNames = new string[] { "Product", "Category", "Amount" };

// Create the first row in the worksheet from which the table starts.
using (IXlRow row = sheet.CreateRow())
{
    // Start generating the table with a header row displayed.
    table = row.BeginTable(columnNames, true);

    // Apply the table style.
    table.Style.Name = XlBuiltInTableStyleId.Dark7;
}

// Generate table rows and populate them with data.
using (IXlRow row = sheet.CreateRow())
    row.BulkCells(new object[] { "Camembert Pierrot", "Dairy Products", 17000 }, null);
using (IXlRow row = sheet.CreateRow())
    row.BulkCells(new object[] { "Gnocchi di nonna Alice", "Grains/Cereals", 15500 }, null);
using (IXlRow row = sheet.CreateRow())
    row.BulkCells(new object[] { "Mascarpone Fabioli", "Dairy Products", 15000 }, null);
// Create the last table row and finish the table.
// The total row is not displayed for the table. 
using (IXlRow row = sheet.CreateRow())
{
    row.BulkCells(new object[] { "Ravioli Angelo", "Grains/Cereals", 12500 }, null);
    row.EndTable(table, false);
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Name property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also