Options
All
  • Public
  • Public/Protected
  • All
Menu

project: to-excel author: m0rtadelo (ricard.figuls)

license

MIT 2019

Hierarchy

Index

Constructors

constructor

Properties

Static Private replaceItems

replaceItems: any[] = []

Methods

Static Private addHeaders

  • addHeaders(columns: IHeader[]): string
  • Returns the XML headers for the columns

    Parameters

    • columns: IHeader[]

      The headers info array

    Returns string

    XML headers

Static Private addRows

  • addRows(data: any[], columns: IHeader[]): string
  • Returns XML rows

    Parameters

    • data: any[]

      The cells data

    • columns: IHeader[]

      The columns data

    Returns string

    XML rows

Static Private download

  • download(filename: string, data: any): void
  • Uses browser integrated method to download the generated file

    Parameters

    • filename: string

      The filename

    • data: any

      The data to be in the file

    Returns void

    void

Static exportXLS

  • exportXLS(columns: IHeader[], data: any[], options?: string | IOptions): string
  • Generates compatible Excel xls file (xml in fact) and returns content and downloads (if set)

    Parameters

    • columns: IHeader[]

      This object defines column labels and maps worksheet data.

    • data: any[]

      Sets the data of the worksheet.

    • Optional options: string | IOptions

      Options to define behaviour

    Returns string

    content of file

Static Private generateXML

  • Generates compatible Excel xls file (xml in fact)

    Parameters

    • columns: IHeader[]

      This object defines column labels and maps worksheet data.

    • data: any[]

      Sets the data of the worksheet.

    • options: IOptions

      Options to define behaviour

    Returns string

    content of file

Static Private getData

  • getData(row: any, item: string): string
  • Returns the correct data value

    Parameters

    • row: any

      Data object that contains value

    • item: string

      The name of the item where data is

    Returns string

    The value

Static Private parseXML

  • parseXML(input: string): string
  • Sanitizes the string to be used in the XML value cell

    Parameters

    • input: string

      The input string to sanitize

    Returns string

    Sanitized xml string

Static Private replaceValue

  • replaceValue(value: string): string
  • Replaces the value

    Parameters

    • value: string

      The vaue to be replaced

    Returns string

    The value or replaced value

Static setReplace

  • setReplace(value?: any, replacementValue?: any): void
  • Replaces value

    Parameters

    • Optional value: any

      value

    • Optional replacementValue: any

      replacementValue

    Returns void

    void

Generated using TypeDoc