• Articles
  • Buy Now
  • Back to Orgchartcomponent.com
  • View Demo:

Demo 1Exporting The Organisation Chart To Excel

The OrgChartComponent has an export to Excel feature that allows end users to open the current organisation chart into Excel. This useful feature allows users to get data into Excel easily from where they can perform advanced analysis.

To do this simply:

  • Ensure that the CommandBar is visible
  • Set the ShowExport property to True.
  • Set the ExportSettings.FieldNames property to indicate which fields should be exported, in this example it is set to "FirstName,Email"
Organisation Chart Commands   Export
John
Barry
Alan
Kevin

CodeCode

C# Code


        // First ensure that the command bar is visible
        MyChart.CommandBarSettings.Visible = true;
        // And that the "Export" Link is enabled
        MyChart.CommandBarSettings.ShowExport = true;

        // Set the fields to be exported
        MyChart.ExportSettings.Fields = "Firstname,eMail";
        // Optionally set the field headers, by first disabling the Auto Generated headers
        MyChart.ExportSettings.AutogenerateHeaders = false;
        // And then by setting the field headers
        MyChart.ExportSettings.FieldHeaders = "First Name, email";
        

Html Markup

<cc1:XmlBoundOrganisationChart ID="MyChart" runat="server" DataSourceID="XmlDataSource1"> <ExportSettings FieldHeaders="First Name,eMail" Fields="Firstname,eMail" /> <CommandBarSettings ShowExport="True" ShowMaxDepth="False" Visible="True"> </CommandBarSettings> <ChartItem HtmlTemplate="{Firstname}"> </ChartItem> </cc1:XmlBoundOrganisationChart>

Valid XHTML 1.0 Transitional Valid CSS!