Class GridExcelExport
  
  Helper for grid excel export
 
  
  
    Inheritance
    System.Object
    GridExcelExport
   
  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()
    
 
  
  Assembly: Syncfusion.EJ2.GridExport.dll
  Syntax
  
    public class GridExcelExport
   
  Constructors
  
  
  
  
  GridExcelExport()
  
  
  Declaration
  
  Properties
  
  
  
  
  
  
  
  Declaration
  
    public AutoFormat AutoFormat { get; set; }
   
  Property Value
  
  
  
  
  DataSource
  Gets or sets the datasource of the grid.
 
  
  Declaration
  
    public IEnumerable DataSource { get; set; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Collections.IEnumerable | 
        The Datasource of the grid. 
 | 
      
    
  
  
  
  
  Document
  Gets or sets the Document.
 
  
  Declaration
  
    public object Document { get; set; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Object | 
        The Document for exporting. 
 | 
      
    
  
  
  
  
  EmptyText
  Gets or sets the Empty record text of the file.
 
  
  Declaration
  
    public string EmptyText { get; set; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
        The name of the file. 
 | 
      
    
  
  
  
  
  Excelversion
  Gets or sets the excel version.
 
  
  Declaration
  
    public ExcelVersion Excelversion { get; set; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Syncfusion.XlsIO.ExcelVersion | 
        The excel version. 
 | 
      
    
  
  
  
  
  FileName
  Gets or sets the name of the file.
 
  
  Declaration
  
    public string FileName { get; set; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
        The name of the file. 
 | 
      
    
  
  
  
  
  FilePath
  Gets or sets the File Path for saving file.
 
  
  Declaration
  
    public string FilePath { get; set; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
        The File Path for saving file in local. 
 | 
      
    
  
  
  
  
  FontWeight
  
  
  Declaration
  
    public FontWeight FontWeight { get; set; }
   
  Property Value
  
    
      
        | Type | 
        
      
    
    
      
        | Syncfusion.EJ2.GridExport.FontWeight | 
        
      
    
  
  
  
  
  
  Gets or sets the Header Text for multiple export.
 
  
  Declaration
  
    public string HeaderText { get; set; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
        HeaderText for multiple export. 
 | 
      
    
  
  
  
  
  IsHideColumnIncude
  Gets or sets the IsHideColumnInclude for grid.
 
  
  Declaration
  
    public bool IsHideColumnIncude { get; set; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
        IsHideColumnInclude in file. 
 | 
      
    
  
  
  
  
  LocalSave
  Gets or sets the is file locally saved.
 
  
  Declaration
  
    public bool LocalSave { get; set; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
        The LocalSave option for file. 
 | 
      
    
  
  
  
  
  SourceType
  
  
  Declaration
  
    public Type SourceType { get; set; }
   
  Property Value
  
  
  
  
  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. 
 | 
      
    
  
  
  
  
  WorkBook
  Gets or sets the excel workbook.
 
  
  Declaration
  
    public IWorkbook WorkBook { get; set; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Syncfusion.XlsIO.IWorkbook | 
        The excel workbook. 
 | 
      
    
  
  Methods
  
  
  
  
  CopyBorders(GridTableCellType, IRange)
  
  
  Declaration
  
    protected void CopyBorders(GridTableCellType style, IRange range)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | GridTableCellType | 
        style | 
        The style. 
 | 
      
      
        | Syncfusion.XlsIO.IRange | 
        range | 
        The range. 
 | 
      
    
  
  
  
  
  CopyStyles(GridTableCellType, IRange)
  
  
  Declaration
  
    protected void CopyStyles(GridTableCellType style, IRange range)
   
  Parameters
  
  
  
  
  CsvExport<T>(Grid, IEnumerable, ExcelExportProperties)
  
  
  Declaration
  
    public ActionResult CsvExport<T>(Grid GridModel, IEnumerable result, ExcelExportProperties ExportProperties = null)
   
  Parameters
  
  Returns
  
    
      
        | Type | 
        
      
    
    
      
        | System.Web.Mvc.ActionResult | 
        
      
    
  
  Type Parameters
  
  
  
  
  CsvExport<T>(Grid, IEnumerable, Boolean, ExcelExportProperties)
  
  
  Declaration
  
    public object CsvExport<T>(Grid GridModel, IEnumerable result, bool AsMemoryStream, ExcelExportProperties ExportProperties = null)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Grid | 
        GridModel | 
         | 
      
      
        | System.Collections.IEnumerable | 
        result | 
         | 
      
      
        | System.Boolean | 
        AsMemoryStream | 
         | 
      
      
        | ExcelExportProperties | 
        ExportProperties | 
         | 
      
    
  
  Returns
  
  Type Parameters
  
  
  
  
  ExcelExport<T>(Grid, IEnumerable, ExcelExportProperties)
  Gets or sets the excel workbook.
 
  
  Declaration
  
    public ActionResult ExcelExport<T>(Grid GridModel, IEnumerable result, ExcelExportProperties ExportProperties = null)
   
  Parameters
  
  Returns
  
    
      
        | Type | 
        
      
    
    
      
        | System.Web.Mvc.ActionResult | 
        
      
    
  
  Type Parameters
  
  
  
  
  ExcelExport<T>(Grid, IEnumerable, Boolean, ExcelExportProperties)
  
  
  Declaration
  
    public object ExcelExport<T>(Grid GridModel, IEnumerable result, bool AsMemoryStream, ExcelExportProperties ExportProperties = null)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Grid | 
        GridModel | 
         | 
      
      
        | System.Collections.IEnumerable | 
        result | 
         | 
      
      
        | System.Boolean | 
        AsMemoryStream | 
         | 
      
      
        | ExcelExportProperties | 
        ExportProperties | 
         | 
      
    
  
  Returns
  
  Type Parameters
  
  
  
  
  ExcelTextSize(String, Single, String)
  Calculate the text width and height.
 
  
  Declaration
  
    public SizeF ExcelTextSize(string fontFamily, float size, string text)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        fontFamily | 
         | 
      
      
        | System.Single | 
        size | 
         | 
      
      
        | System.String | 
        text | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        
      
    
    
      
        | System.Drawing.SizeF | 
        
      
    
  
  
  
  
  ExportRecordRow(String)
  
  
  Declaration
  
    protected void ExportRecordRow(string value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        value | 
        The value. 
 | 
      
    
  
  
  
  
  
  Rotate the Header cell text based on the degree value.
 
  
  Declaration
  
    public void HeaderCellRotate(ServerExcelHeaderQueryCellInfoEventArgs args, int degree)
   
  Parameters
  
  
  
  
  SetFontStyles(IRange, Boolean)
  
  
  Declaration
  
    protected void SetFontStyles(IRange range, bool summary)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Syncfusion.XlsIO.IRange | 
        range | 
         | 
      
      
        | System.Boolean | 
        summary | 
         |