Skip to main content

SpreadsheetOption

Definition

Namespace: Surya.Ab.Export.Client.Models
Assembly: Surya.Ab.Export.dll

Provides the optional arguments needed each sheet in Excel for Export.

public class SpreadsheetOption

Properties

NameDefinition
HeaderHeader for the Sheet
FooterFooter for the Footer
SheetNameName of the Sheet
SheetStyleStyle properties for the Sheet
HeaderMergeCellCountNumbers of cells to be merged to Display SheetHeader
FooterMergeCellCountNumbers of cells to be merged to Display SheetFooter
FreezeRowCountNumbers of rows to freeze in a sheet
FreezeColumnCountNumbers of columns to freeze in a sheet
GridViewBool property for GridView
MaxColumnWidthMaximum width a column can have
MinColumnWidthMinimum width a column must have
ClientLogoTo set footer with image of ClientLogo

Structure

public class SpreadsheetOption
{
public string? Header { get; set; }
public string? Footer { get; set; }
public string? SheetName { get; set; }
public int HeaderMergeCellCount { get; set; }
public int FooterMergeCellCount { get; set; }
public int FreezeRowCount { get; set; }
public int FreezeColumnCount { get; set; }
public SheetStyle? SheetStyle { get; set; }
public bool GridView { get; set; } = false;
public float MaxColumnWidth { get; set; }
public float MinColumnWidth { get; set; }
public FooterLogo? ClientLogo { get; set; }
}

Example

var spreadsheetOptions = new List<SpreadsheetOption>()
{
new SpreadsheetOption()
{
SheetName = "Sheet 1",
Header = "SheetHeader 1",
Footer = "SheetFooter 1"
},
new SpreadsheetOption()
{
SheetName = "Sheet 2",
Header = "SheetHeader 2",
Footer = "SheetFooter 2"
}
}

Edit on GitHub