excel

package
v0.0.0-...-95cbda5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2023 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CTRels          = "application/vnd.openxmlformats-package.relationships+xml"
	CTXML           = "application/xml"
	CTWorkbook      = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"
	CTWorksheet     = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"
	CTSharedStrings = "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"
)

Well known content types.

View Source
const (
	RELOfficeDocument = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
	RELWorksheet      = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"
	RELSharedStrings  = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings"
)
View Source
const (
	NSPackageCT     = "http://schemas.openxmlformats.org/package/2006/content-types"
	NSPackageRels   = "http://schemas.openxmlformats.org/package/2006/relationships"
	NSSpreadsheetML = "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
	NSOfficeDocRels = "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
)

Well known XML-namespace names.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	// contains filtered or unexported fields
}

A Cell in the worksheet.

func (*Cell) MarshalXML

func (c *Cell) MarshalXML(enc *xml.Encoder, root xml.StartElement) error

func (*Cell) SetText

func (c *Cell) SetText(t string)

SetText writes text t to the cell.

type Document

type Document struct {
	// contains filtered or unexported fields
}

A Document represents Excel's document package.

func NewDocument

func NewDocument() *Document

NewDocument creates and initializes a new Excel document. It returns a document containing workbook and a single worksheet. This resambles the case of running Excel program and creating a new blank document. Saving this document produces a valid .xlsx file.

func (*Document) Save

func (doc *Document) Save(w io.Writer) error

Save writes the document using the given writer. The written document is the complete (and hopefully valid) .xlsx file.

func (*Document) Workbook

func (doc *Document) Workbook() *Workbook

Workbook returns the document's workbook.

type Row

type Row struct {
	// contains filtered or unexported fields
}

A row inside Excel's worksheet.

func (*Row) MarshalXML

func (r *Row) MarshalXML(enc *xml.Encoder, root xml.StartElement) error

type Workbook

type Workbook struct {
	// contains filtered or unexported fields
}

A workbook inside an Excel document.

func (*Workbook) AddWorksheet

func (wkb *Workbook) AddWorksheet()

func (*Workbook) MarshalXML

func (wkb *Workbook) MarshalXML(enc *xml.Encoder, root xml.StartElement) error

func (*Workbook) Worksheet

func (wkb *Workbook) Worksheet(id int) *Worksheet

Worksheet returns a worksheet by its id.

type Worksheet

type Worksheet struct {
	// contains filtered or unexported fields
}

A worksheet inside Excel's workbook.

func (*Worksheet) MarshalXML

func (wks *Worksheet) MarshalXML(enc *xml.Encoder, root xml.StartElement) error

func (*Worksheet) SetText

func (wks *Worksheet) SetText(t string, ri int, ci int)

SetText writes a string value into the cell. Row and cell indices are zero-based.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL