diff options
author | Olivier Mengué <dolmen@cpan.org> | 2017-11-05 02:16:41 +0100 |
---|---|---|
committer | Olivier Mengué <dolmen@cpan.org> | 2017-11-16 12:00:36 +0100 |
commit | 88e48e079a91191e05f32a232f8dec4454b25238 (patch) | |
tree | c7d42ad32a89db79be454a4017c64026207dc9b0 /xmlWorksheet.go | |
parent | a4ffb4fbfc9048998345e979577dab2a81bf57ff (diff) |
Add SetSheetViewOptions and GetSheetViewOptions (#145)
Two new methods:
- SetSheetViewOptions(sheetName string, viewIndex int, opts ...SheetViewOption) error
- GetSheetViewOptions(sheetName string, viewIndex int, opts ...SheetViewOptionPtr) error
The option values are given by the user through types that have privates methods
that implement the private SheetViewOption and SheetViewOptionPtr interfaces:
- DefaultGridColor(bool)
- RightToLeft(bool)
- ShowFormulas(bool)
- ShowGridLines(bool)
- ShowRowColHeaders(bool)
Examples:
err := xl.SetSheetViewOptions("Sheet1", -1, excelize.ShowGridLines(true))
var showGridLines excelize.ShowGridLines
err := xl.GetSheetViewOptions("Sheet1", -1, &showGridLines)
Fixes #145.
Diffstat (limited to 'xmlWorksheet.go')
-rw-r--r-- | xmlWorksheet.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xmlWorksheet.go b/xmlWorksheet.go index de7ea93..22feca8 100644 --- a/xmlWorksheet.go +++ b/xmlWorksheet.go @@ -145,17 +145,18 @@ type xlsxSheetViews struct { // last sheetView definition is loaded, and the others are discarded. When // multiple windows are viewing the same sheet, multiple sheetView elements // (with corresponding workbookView entries) are saved. +// See https://msdn.microsoft.com/en-us/library/office/documentformat.openxml.spreadsheet.sheetview.aspx type xlsxSheetView struct { WindowProtection bool `xml:"windowProtection,attr,omitempty"` ShowFormulas bool `xml:"showFormulas,attr,omitempty"` - ShowGridLines string `xml:"showGridLines,attr,omitempty"` - ShowRowColHeaders bool `xml:"showRowColHeaders,attr,omitempty"` + ShowGridLines *bool `xml:"showGridLines,attr"` + ShowRowColHeaders *bool `xml:"showRowColHeaders,attr"` ShowZeros bool `xml:"showZeros,attr,omitempty"` RightToLeft bool `xml:"rightToLeft,attr,omitempty"` TabSelected bool `xml:"tabSelected,attr,omitempty"` ShowWhiteSpace *bool `xml:"showWhiteSpace,attr"` ShowOutlineSymbols bool `xml:"showOutlineSymbols,attr,omitempty"` - DefaultGridColor bool `xml:"defaultGridColor,attr"` + DefaultGridColor *bool `xml:"defaultGridColor,attr"` View string `xml:"view,attr,omitempty"` TopLeftCell string `xml:"topLeftCell,attr,omitempty"` ColorID int `xml:"colorId,attr,omitempty"` |