2022-01-09 00:20:42 +08:00
|
|
|
// Copyright 2016 - 2022 The excelize Authors. All rights reserved. Use of
|
2019-06-27 21:58:14 +08:00
|
|
|
// this source code is governed by a BSD-style license that can be found in
|
|
|
|
// the LICENSE file.
|
|
|
|
//
|
2022-02-17 00:09:11 +08:00
|
|
|
// Package excelize providing a set of functions that allow you to write to and
|
|
|
|
// read from XLAM / XLSM / XLSX / XLTM / XLTX files. Supports reading and
|
|
|
|
// writing spreadsheet documents generated by Microsoft Excel™ 2007 and later.
|
|
|
|
// Supports complex components by high compatibility, and provided streaming
|
|
|
|
// API for generating or reading data from a worksheet with huge amounts of
|
|
|
|
// data. This library needs Go version 1.15 or later.
|
2019-06-27 21:58:14 +08:00
|
|
|
|
|
|
|
package excelize
|
|
|
|
|
|
|
|
import "encoding/xml"
|
|
|
|
|
2021-12-26 14:55:53 +08:00
|
|
|
// AppProperties directly maps the document application properties.
|
|
|
|
type AppProperties struct {
|
Breaking change: changed the function signature for 11 exported functions
* Change
`func (f *File) NewConditionalStyle(style string) (int, error)`
to
`func (f *File) NewConditionalStyle(style *Style) (int, error)`
* Change
`func (f *File) NewStyle(style interface{}) (int, error)`
to
`func (f *File) NewStyle(style *Style) (int, error)`
* Change
`func (f *File) AddChart(sheet, cell, opts string, combo ...string) error`
to
`func (f *File) AddChart(sheet, cell string, chart *ChartOptions, combo ...*ChartOptions) error`
* Change
`func (f *File) AddChartSheet(sheet, opts string, combo ...string) error`
to
`func (f *File) AddChartSheet(sheet string, chart *ChartOptions, combo ...*ChartOptions) error`
* Change
`func (f *File) AddShape(sheet, cell, opts string) error`
to
`func (f *File) AddShape(sheet, cell string, opts *Shape) error`
* Change
`func (f *File) AddPictureFromBytes(sheet, cell, opts, name, extension string, file []byte) error`
to
`func (f *File) AddPictureFromBytes(sheet, cell, name, extension string, file []byte, opts *PictureOptions) error`
* Change
`func (f *File) AddTable(sheet, hCell, vCell, opts string) error`
to
`func (f *File) AddTable(sheet, reference string, opts *TableOptions) error`
* Change
`func (sw *StreamWriter) AddTable(hCell, vCell, opts string) error`
to
`func (sw *StreamWriter) AddTable(reference string, opts *TableOptions) error`
* Change
`func (f *File) AutoFilter(sheet, hCell, vCell, opts string) error`
to
`func (f *File) AutoFilter(sheet, reference string, opts *AutoFilterOptions) error`
* Change
`func (f *File) SetPanes(sheet, panes string) error`
to
`func (f *File) SetPanes(sheet string, panes *Panes) error`
* Change
`func (sw *StreamWriter) AddTable(hCell, vCell, opts string) error`
to
`func (sw *StreamWriter) AddTable(reference string, opts *TableOptions) error`
* Change
`func (f *File) SetConditionalFormat(sheet, reference, opts string) error`
to
`func (f *File) SetConditionalFormat(sheet, reference string, opts []ConditionalFormatOptions) error`
* Add exported types:
* AutoFilterListOptions
* AutoFilterOptions
* Chart
* ChartAxis
* ChartDimension
* ChartLegend
* ChartLine
* ChartMarker
* ChartPlotArea
* ChartSeries
* ChartTitle
* ConditionalFormatOptions
* PaneOptions
* Panes
* PictureOptions
* Shape
* ShapeColor
* ShapeLine
* ShapeParagraph
* TableOptions
* This added support for set sheet visible as very hidden
* Return error when missing required parameters for set defined name
* Update unit test and comments
2022-12-30 00:50:08 +08:00
|
|
|
Application string
|
|
|
|
ScaleCrop bool
|
|
|
|
DocSecurity int
|
|
|
|
Company string
|
|
|
|
LinksUpToDate bool
|
|
|
|
HyperlinksChanged bool
|
|
|
|
AppVersion string
|
2021-12-26 14:55:53 +08:00
|
|
|
}
|
|
|
|
|
2019-08-11 00:36:14 +08:00
|
|
|
// xlsxProperties specifies to an OOXML document properties such as the
|
|
|
|
// template used, the number of pages and words, and the application name and
|
|
|
|
// version.
|
2019-06-27 21:58:14 +08:00
|
|
|
type xlsxProperties struct {
|
|
|
|
XMLName xml.Name `xml:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties Properties"`
|
2021-12-26 14:55:53 +08:00
|
|
|
Vt string `xml:"xmlns:vt,attr"`
|
|
|
|
Template string `xml:",omitempty"`
|
|
|
|
Manager string `xml:",omitempty"`
|
|
|
|
Company string `xml:",omitempty"`
|
|
|
|
Pages int `xml:",omitempty"`
|
|
|
|
Words int `xml:",omitempty"`
|
|
|
|
Characters int `xml:",omitempty"`
|
|
|
|
PresentationFormat string `xml:",omitempty"`
|
|
|
|
Lines int `xml:",omitempty"`
|
|
|
|
Paragraphs int `xml:",omitempty"`
|
|
|
|
Slides int `xml:",omitempty"`
|
|
|
|
Notes int `xml:",omitempty"`
|
|
|
|
TotalTime int `xml:",omitempty"`
|
|
|
|
HiddenSlides int `xml:",omitempty"`
|
|
|
|
MMClips int `xml:",omitempty"`
|
|
|
|
ScaleCrop bool `xml:",omitempty"`
|
2019-06-27 21:58:14 +08:00
|
|
|
HeadingPairs *xlsxVectorVariant
|
|
|
|
TitlesOfParts *xlsxVectorLpstr
|
2021-12-26 14:55:53 +08:00
|
|
|
LinksUpToDate bool `xml:",omitempty"`
|
|
|
|
CharactersWithSpaces int `xml:",omitempty"`
|
|
|
|
SharedDoc bool `xml:",omitempty"`
|
|
|
|
HyperlinkBase string `xml:",omitempty"`
|
2019-06-27 21:58:14 +08:00
|
|
|
HLinks *xlsxVectorVariant
|
2021-12-26 14:55:53 +08:00
|
|
|
HyperlinksChanged bool `xml:",omitempty"`
|
2019-06-27 21:58:14 +08:00
|
|
|
DigSig *xlsxDigSig
|
2021-12-26 14:55:53 +08:00
|
|
|
Application string `xml:",omitempty"`
|
|
|
|
AppVersion string `xml:",omitempty"`
|
|
|
|
DocSecurity int `xml:",omitempty"`
|
2019-06-27 21:58:14 +08:00
|
|
|
}
|
|
|
|
|
2019-08-11 00:36:14 +08:00
|
|
|
// xlsxVectorVariant specifies the set of hyperlinks that were in this
|
|
|
|
// document when last saved.
|
2019-06-27 21:58:14 +08:00
|
|
|
type xlsxVectorVariant struct {
|
|
|
|
Content string `xml:",innerxml"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type xlsxVectorLpstr struct {
|
|
|
|
Content string `xml:",innerxml"`
|
|
|
|
}
|
|
|
|
|
2019-08-11 00:36:14 +08:00
|
|
|
// xlsxDigSig contains the signature of a digitally signed document.
|
2019-06-27 21:58:14 +08:00
|
|
|
type xlsxDigSig struct {
|
|
|
|
Content string `xml:",innerxml"`
|
|
|
|
}
|