Flexible and versatile organisational charts for ASP.NET using
Org Chart Component.


Exporting 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


Code:

C# Code

   1:  // First ensure that the command bar is visible
   2:          MyChart.CommandBarSettings.Visible = true;
   3:          // And that the "Export" Link is enabled
   4:          MyChart.CommandBarSettings.ShowExport = true;
   5:   
   6:          // Set the fields to be exported
   7:          MyChart.ExportSettings.Fields = "Firstname,eMail";
   8:          // Optionally set the field headers, by first disabling the Auto Generated headers
   9:          MyChart.ExportSettings.AutogenerateHeaders = false;
  10:          // And then by setting the field headers
  11:          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>