Leer en inglés

Compartir a través de


WorksheetBase.ConsolidationOptions Property

Definition

Gets a three-element Array of consolidation options.

C#
public object ConsolidationOptions { get; }

Property Value

A three-element Array of consolidation options.

Examples

The following code example uses the ConsolidationOptions property to display the values of the consolidation options for the current worksheet.

This example is for a document-level customization.

C#
private void ShowConsolidationOptions()
{
    if (this.ConsolidationOptions != null)
    {
        Array options = (Array)this.ConsolidationOptions;

        this.Range["A1"].Value2 = "Use labels in top row";
        this.Range["A2"].Value2 = "Use labels in left column";
        this.Range["A3"].Value2 = "Create links to source data";

        for (int i = 1; i <= 3; i++)
        {
            if ((bool)options.GetValue(i))
            {
                this.Range["B" + i.ToString()].Value2 = "True";
            }
            else
            {
                this.Range["B" + i.ToString()].Value2 = "False";
            }
            this.Columns.AutoFit();
        }
    }
}

Remarks

If an element in the returned array is true, then the corresponding option is set. The three elements in the array are:

Element Meaning
1 Use labels in top row
2 Use labels in left column
3 Create links to source data

Applies to

Producto Versiones
Visual Studio Tools for Office 2017, 2019, 2022