menu

ASP.NET MVC - EJ2

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TreeGridExcelExport - ASP.NETMVC-EJ2 API Reference | Syncfusion

    Show / Hide Table of Contents

    Class TreeGridExcelExport

    Represents a base class for exporting.

    Inheritance
    System.Object
    TreeGridExportBase
    TreeGridExcelExport
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    TreeGridExportBase.DataSource
    TreeGridExportBase.EmptyText
    TreeGridExportBase.FileName
    TreeGridExportBase.FilePath
    TreeGridExportBase.FontWeight
    TreeGridExportBase.FormatOptions
    TreeGridExportBase.HeaderText
    TreeGridExportBase.IncludeHiddenColumns
    Namespace: Syncfusion.EJ2.TreeGridExport
    Assembly: Syncfusion.EJ2.GridExport.dll
    Syntax
    public class TreeGridExcelExport : TreeGridExportBase
    Remarks

    This class provides the fundamental properties for exporting data to Excel, PDF, and CSV formats. It includes essential properties that define common export settings and behaviors, making it easier to create specialized exporting functionalities.

    Constructors

    TreeGridExcelExport()

    Declaration
    public TreeGridExcelExport()

    Properties

    Document

    Gets or sets the Document.

    Declaration
    public object Document { get; set; }
    Property Value
    Type Description
    System.Object

    The Document for exporting.

    Remarks

    This property represents the document associated with the current instance for exporting. Use the Document property to get or set the document.

    Excelversion

    Gets or sets a value that indicates the Excel version of the document to be exported.

    Declaration
    public ExcelVersion Excelversion { get; set; }
    Property Value
    Type Description
    Syncfusion.XlsIO.ExcelVersion

    One of the Syncfusion.XlsIO.ExcelVersion enumerations that specifies the version of the exported document. The default value is Syncfusion.XlsIO.ExcelVersion.Excel97to2003.

    Remarks

    Use this property to set the desired Excel version for the exported document. The supported versions are defined in the Syncfusion.XlsIO.ExcelVersion enumeration.

    IsSaveLocally

    Gets or sets a flag indicating whether the file should be saved locally.

    Declaration
    public bool IsSaveLocally { get; set; }
    Property Value
    Type Description
    System.Boolean

    true, if the document will be saved locally based on the provided file path; otherwise, false.The default value is false.

    Remarks

    Set this property to true if you want the document to be saved locally after it has been processed. The local saving operation will depend on the provided .

    SourceType

    Gets or sets the type of the source data for a specific operation.

    Declaration
    public Type SourceType { get; set; }
    Property Value
    Type
    System.Type
    Remarks

    This property represents the type of the source data that is used in a specific operation. It allows you to specify the data type that will be processed or manipulated in the operation.

    Theme

    Gets or sets the Theme of the file.

    Declaration
    public string Theme { get; set; }
    Property Value
    Type Description
    System.String

    The Theme of the file.

    Remarks

    This property represents the theme associated with the current instance. Use the Theme property to get or set the theme.

    WorkBook

    Declaration
    public IWorkbook WorkBook { get; set; }
    Property Value
    Type
    Syncfusion.XlsIO.IWorkbook

    Methods

    ExcelTextSize(String, Single, String)

    Calculates the size of the text when rendered in an excel cell using the specified font and size.

    Declaration
    public SizeF ExcelTextSize(string fontFamily, float size, string text)
    Parameters
    Type Name Description
    System.String fontFamily

    The font family to be used for rendering the text.

    System.Single size

    The font size to be used for rendering the text.

    System.String text

    The text for which the size needs to be calculated.

    Returns
    Type
    System.Drawing.SizeF
    Remarks

    This method is useful when customizing the appearance of a cell based on its content. For example, you can use this method to dynamically adjust cell dimensions to fit the rendered text.

    ExportRecordRow(String)

    Exports the record row.

    Declaration
    protected void ExportRecordRow(string value)
    Parameters
    Type Name Description
    System.String value

    The value.

    ExportToCsv<T>(TreeGrid, IEnumerable, ExcelExportProperties)

    Exports data to a CSV (Comma-Separated Values) file using the specified tree grid model and export properties.

    Declaration
    public ActionResult ExportToCsv<T>(TreeGrid TreeGridModel, IEnumerable result, ExcelExportProperties ExportProperties = null)
    Parameters
    Type Name Description
    TreeGrid TreeGridModel

    The TreeGrid model containing configuration settings.

    System.Collections.IEnumerable result

    The data items/datsource to be exported.

    ExcelExportProperties ExportProperties

    Optional export properties to be export.

    Returns
    Type
    System.Web.Mvc.ActionResult
    Type Parameters
    Name Description
    T

    The type of data to be exported.

    ExportToExcel<T>(TreeGrid, IEnumerable, ExcelExportProperties)

    Generates and exports data to an Excel file using the specified Tree Grid model and export properties.

    Declaration
    public ActionResult ExportToExcel<T>(TreeGrid TreeGridModel, IEnumerable result, ExcelExportProperties ExportProperties = null)
    Parameters
    Type Name Description
    TreeGrid TreeGridModel

    The Tree Grid model containing configuration settings.

    System.Collections.IEnumerable result

    The data items/datasource to be exported.

    ExcelExportProperties ExportProperties

    Optional export properties to be export.

    Returns
    Type
    System.Web.Mvc.ActionResult
    Type Parameters
    Name Description
    T

    The type of data to be exported.

    RotateHeaderCell(ExcelHeaderCellEventArgs, Int32)

    Rotates the text of a header cell in an Excel sheet based on the specified degree value.

    Declaration
    public void RotateHeaderCell(ExcelHeaderCellEventArgs args, int degree)
    Parameters
    Type Name Description
    ExcelHeaderCellEventArgs args

    The event ExcelHeaderCellEventArgs containing information about the header cell.

    System.Int32 degree

    The degree value to set for the rotation. Valid range: 0 to 180 degrees.

    SetFontStyles(IRange, Boolean)

    Declaration
    protected void SetFontStyles(IRange range, bool summary)
    Parameters
    Type Name Description
    Syncfusion.XlsIO.IRange range
    System.Boolean summary
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved