Browse Source

Worksheet output identical to LibreOffice for empty sheet.

Geoffrey J. Teale 11 years ago
parent
commit
5bc19360e7
5 changed files with 323 additions and 29 deletions
  1. 9 4
      col.go
  2. 36 4
      file_test.go
  3. 17 8
      sheet.go
  4. 37 5
      sheet_test.go
  5. 224 8
      xmlWorksheet.go

+ 9 - 4
col.go

@@ -1,8 +1,13 @@
 package xlsx
 
+// Default column width in excel
+const ColWidth = 9.5
+
 type Col struct {
-	Min    int
-	Max    int
-	Hidden bool
-	Width  float64
+	Min       int
+	Max       int
+	Hidden    bool
+	Width     float64
+	Collapsed bool
+	Style     int
 }

+ 36 - 4
file_test.go

@@ -286,10 +286,22 @@ func (l *FileSuite) TestMarshalFile(c *C) {
 	// sheets
 	expectedSheet1 := `<?xml version="1.0" encoding="UTF-8"?>
   <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
-    <dimension ref="A1:A1"></dimension>
+    <sheetPr filterMode="false">
+      <pageSetUpPr fitToPage="false"></pageSetUpPr>
+    </sheetPr>
+    <sheetViews>
+      <sheetView windowProtection="false" showFormulas="false" showGridLines="true" showRowColHeaders="true" showZeros="true" rightToLeft="false" tabSelected="true" showOutlineSymbols="true" defaultGridColor="true" view="normal" topLeftCell="A1" colorId="64" zoomScale="100" zoomScaleNormal="100" zoomScalePageLayoutView="100" workbookViewId="0">
+        <selection pane="topLeft" activeCell="A1" activeCellId="0" sqref="A1"></selection>
+      </sheetView>
+    </sheetViews>
+    <sheetFormatPr defaultRowHeight="12.85"></sheetFormatPr>
+    <dimension ref="A1"></dimension>
     <cols>
-      <col min="1" max="1" width="9.5"></col>
+      <col collapsed="false" hidden="false" max="1" min="1" style="0" width="9.5"></col>
     </cols>
+    <printOptions headings="false" gridLines="false" gridLinesSet="true" horizontalCentered="false" verticalCentered="false"></printOptions>
+    <pageMargins left="0.7875" right="0.7875" top="1.05277777777778" bottom="1.05277777777778" header="0.7875" footer="0.7875"></pageMargins>
+    <pageSetup paperSize="9" scale="100" firstPageNumber="1" fitToWidth="1" fitToHeight="1" pageOrder="downThenOver" orientation="portrait" usePrinterDefaults="false" blackAndWhite="false" draft="false" cellComments="none" useFirstPageNumber="true" horizontalDpi="300" verticalDpi="300" copies="1"></pageSetup>
     <sheetData>
       <row r="1">
         <c r="A1" s="0" t="s">
@@ -297,15 +309,31 @@ func (l *FileSuite) TestMarshalFile(c *C) {
         </c>
       </row>
     </sheetData>
+    <headerFooter differentFirst="false" differentOddEven="false">
+      <oddHeader>&amp;C&amp;&#34;Times New Roman,Regular&#34;&amp;12&amp;A</oddHeader>
+      <oddFooter>&amp;C&amp;&#34;Times New Roman,Regular&#34;&amp;12Page &amp;P</oddFooter>
+    </headerFooter>
   </worksheet>`
 	c.Assert(parts["xl/worksheets/sheet1.xml"], Equals, expectedSheet1)
 
 	expectedSheet2 := `<?xml version="1.0" encoding="UTF-8"?>
   <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
-    <dimension ref="A1:A1"></dimension>
+    <sheetPr filterMode="false">
+      <pageSetUpPr fitToPage="false"></pageSetUpPr>
+    </sheetPr>
+    <sheetViews>
+      <sheetView windowProtection="false" showFormulas="false" showGridLines="true" showRowColHeaders="true" showZeros="true" rightToLeft="false" tabSelected="true" showOutlineSymbols="true" defaultGridColor="true" view="normal" topLeftCell="A1" colorId="64" zoomScale="100" zoomScaleNormal="100" zoomScalePageLayoutView="100" workbookViewId="0">
+        <selection pane="topLeft" activeCell="A1" activeCellId="0" sqref="A1"></selection>
+      </sheetView>
+    </sheetViews>
+    <sheetFormatPr defaultRowHeight="12.85"></sheetFormatPr>
+    <dimension ref="A1"></dimension>
     <cols>
-      <col min="1" max="1" width="9.5"></col>
+      <col collapsed="false" hidden="false" max="1" min="1" style="0" width="9.5"></col>
     </cols>
+    <printOptions headings="false" gridLines="false" gridLinesSet="true" horizontalCentered="false" verticalCentered="false"></printOptions>
+    <pageMargins left="0.7875" right="0.7875" top="1.05277777777778" bottom="1.05277777777778" header="0.7875" footer="0.7875"></pageMargins>
+    <pageSetup paperSize="9" scale="100" firstPageNumber="1" fitToWidth="1" fitToHeight="1" pageOrder="downThenOver" orientation="portrait" usePrinterDefaults="false" blackAndWhite="false" draft="false" cellComments="none" useFirstPageNumber="true" horizontalDpi="300" verticalDpi="300" copies="1"></pageSetup>
     <sheetData>
       <row r="1">
         <c r="A1" s="1" t="s">
@@ -313,6 +341,10 @@ func (l *FileSuite) TestMarshalFile(c *C) {
         </c>
       </row>
     </sheetData>
+    <headerFooter differentFirst="false" differentOddEven="false">
+      <oddHeader>&amp;C&amp;&#34;Times New Roman,Regular&#34;&amp;12&amp;A</oddHeader>
+      <oddFooter>&amp;C&amp;&#34;Times New Roman,Regular&#34;&amp;12Page &amp;P</oddFooter>
+    </headerFooter>
   </worksheet>`
 	c.Assert(parts["xl/worksheets/sheet2.xml"], Equals, expectedSheet2)
 

+ 17 - 8
sheet.go

@@ -5,9 +5,6 @@ import (
 	"strconv"
 )
 
-// Default column width in excel
-const colWidth = 9.5
-
 // Sheet is a high level structure intended to provide user access to
 // the contents of a particular sheet within an XLSX file.
 type Sheet struct {
@@ -31,7 +28,14 @@ func (s *Sheet) AddRow() *Row {
 // Make sure we always have as many Cols as we do cells.
 func (s *Sheet) maybeAddCol(cellCount int) {
 	if cellCount > s.MaxCol {
-		s.Cols = append(s.Cols, &Col{Min: cellCount, Max: cellCount, Hidden: false})
+		col := &Col{
+			Min:       cellCount,
+			Max:       cellCount,
+			Hidden:    false,
+			Collapsed: false,
+			Style:     0,
+			Width:     ColWidth}
+		s.Cols = append(s.Cols, col)
 		s.MaxCol = cellCount
 	}
 }
@@ -55,7 +59,7 @@ func (sh *Sheet) Cell(row, col int) *Cell {
 
 // Dump sheet to it's XML representation, intended for internal use only
 func (s *Sheet) makeXLSXSheet(refTable *RefTable, styles *xlsxStyleSheet) *xlsxWorksheet {
-	worksheet := &xlsxWorksheet{}
+	worksheet := newXlsxWorksheet()
 	xSheet := xlsxSheetData{}
 	maxRow := 0
 	maxCell := 0
@@ -99,14 +103,19 @@ func (s *Sheet) makeXLSXSheet(refTable *RefTable, styles *xlsxStyleSheet) *xlsxW
 	for _, col := range s.Cols {
 		worksheet.Cols.Col = append(worksheet.Cols.Col,
 			xlsxCol{Min: col.Min,
-				Max:    col.Max,
-				Hidden: col.Hidden,
-				Width:  colWidth})
+				Max:       col.Max,
+				Hidden:    col.Hidden,
+				Width:     col.Width,
+				Collapsed: col.Collapsed,
+				Style:     col.Style})
 	}
 	worksheet.SheetData = xSheet
 	dimension := xlsxDimension{}
 	dimension.Ref = fmt.Sprintf("A1:%s%d",
 		numericToLetters(maxCell), maxRow+1)
+	if dimension.Ref == "A1:A1" {
+		dimension.Ref = "A1"
+	}
 	worksheet.Dimension = dimension
 	return worksheet
 }

+ 37 - 5
sheet_test.go

@@ -30,7 +30,7 @@ func (s *SheetSuite) TestMakeXLSXSheetFromRows(c *C) {
 	refTable := NewSharedStringRefTable()
 	styles := &xlsxStyleSheet{}
 	xSheet := sheet.makeXLSXSheet(refTable, styles)
-	c.Assert(xSheet.Dimension.Ref, Equals, "A1:A1")
+	c.Assert(xSheet.Dimension.Ref, Equals, "A1")
 	c.Assert(xSheet.SheetData.Row, HasLen, 1)
 	xRow := xSheet.SheetData.Row[0]
 	c.Assert(xRow.R, Equals, 1)
@@ -136,10 +136,22 @@ func (s *SheetSuite) TestMarshalSheet(c *C) {
 	c.Assert(err, IsNil)
 	expectedXLSXSheet := `<?xml version="1.0" encoding="UTF-8"?>
   <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
-    <dimension ref="A1:A1"></dimension>
+    <sheetPr filterMode="false">
+      <pageSetUpPr fitToPage="false"></pageSetUpPr>
+    </sheetPr>
+    <sheetViews>
+      <sheetView windowProtection="false" showFormulas="false" showGridLines="true" showRowColHeaders="true" showZeros="true" rightToLeft="false" tabSelected="true" showOutlineSymbols="true" defaultGridColor="true" view="normal" topLeftCell="A1" colorId="64" zoomScale="100" zoomScaleNormal="100" zoomScalePageLayoutView="100" workbookViewId="0">
+        <selection pane="topLeft" activeCell="A1" activeCellId="0" sqref="A1"></selection>
+      </sheetView>
+    </sheetViews>
+    <sheetFormatPr defaultRowHeight="12.85"></sheetFormatPr>
+    <dimension ref="A1"></dimension>
     <cols>
-      <col min="1" max="1" width="9.5"></col>
+      <col collapsed="false" hidden="false" max="1" min="1" style="0" width="9.5"></col>
     </cols>
+    <printOptions headings="false" gridLines="false" gridLinesSet="true" horizontalCentered="false" verticalCentered="false"></printOptions>
+    <pageMargins left="0.7875" right="0.7875" top="1.05277777777778" bottom="1.05277777777778" header="0.7875" footer="0.7875"></pageMargins>
+    <pageSetup paperSize="9" scale="100" firstPageNumber="1" fitToWidth="1" fitToHeight="1" pageOrder="downThenOver" orientation="portrait" usePrinterDefaults="false" blackAndWhite="false" draft="false" cellComments="none" useFirstPageNumber="true" horizontalDpi="300" verticalDpi="300" copies="1"></pageSetup>
     <sheetData>
       <row r="1">
         <c r="A1" s="0" t="s">
@@ -147,6 +159,10 @@ func (s *SheetSuite) TestMarshalSheet(c *C) {
         </c>
       </row>
     </sheetData>
+    <headerFooter differentFirst="false" differentOddEven="false">
+      <oddHeader>&amp;C&amp;&#34;Times New Roman,Regular&#34;&amp;12&amp;A</oddHeader>
+      <oddFooter>&amp;C&amp;&#34;Times New Roman,Regular&#34;&amp;12Page &amp;P</oddFooter>
+    </headerFooter>
   </worksheet>`
 	c.Assert(output.String(), Equals, expectedXLSXSheet)
 }
@@ -171,11 +187,23 @@ func (s *SheetSuite) TestMarshalSheetWithMultipleCells(c *C) {
 	c.Assert(err, IsNil)
 	expectedXLSXSheet := `<?xml version="1.0" encoding="UTF-8"?>
   <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
+    <sheetPr filterMode="false">
+      <pageSetUpPr fitToPage="false"></pageSetUpPr>
+    </sheetPr>
+    <sheetViews>
+      <sheetView windowProtection="false" showFormulas="false" showGridLines="true" showRowColHeaders="true" showZeros="true" rightToLeft="false" tabSelected="true" showOutlineSymbols="true" defaultGridColor="true" view="normal" topLeftCell="A1" colorId="64" zoomScale="100" zoomScaleNormal="100" zoomScalePageLayoutView="100" workbookViewId="0">
+        <selection pane="topLeft" activeCell="A1" activeCellId="0" sqref="A1"></selection>
+      </sheetView>
+    </sheetViews>
+    <sheetFormatPr defaultRowHeight="12.85"></sheetFormatPr>
     <dimension ref="A1:B1"></dimension>
     <cols>
-      <col min="1" max="1" width="9.5"></col>
-      <col min="2" max="2" width="9.5"></col>
+      <col collapsed="false" hidden="false" max="1" min="1" style="0" width="9.5"></col>
+      <col collapsed="false" hidden="false" max="2" min="2" style="0" width="9.5"></col>
     </cols>
+    <printOptions headings="false" gridLines="false" gridLinesSet="true" horizontalCentered="false" verticalCentered="false"></printOptions>
+    <pageMargins left="0.7875" right="0.7875" top="1.05277777777778" bottom="1.05277777777778" header="0.7875" footer="0.7875"></pageMargins>
+    <pageSetup paperSize="9" scale="100" firstPageNumber="1" fitToWidth="1" fitToHeight="1" pageOrder="downThenOver" orientation="portrait" usePrinterDefaults="false" blackAndWhite="false" draft="false" cellComments="none" useFirstPageNumber="true" horizontalDpi="300" verticalDpi="300" copies="1"></pageSetup>
     <sheetData>
       <row r="1">
         <c r="A1" s="0" t="s">
@@ -186,6 +214,10 @@ func (s *SheetSuite) TestMarshalSheetWithMultipleCells(c *C) {
         </c>
       </row>
     </sheetData>
+    <headerFooter differentFirst="false" differentOddEven="false">
+      <oddHeader>&amp;C&amp;&#34;Times New Roman,Regular&#34;&amp;12&amp;A</oddHeader>
+      <oddFooter>&amp;C&amp;&#34;Times New Roman,Regular&#34;&amp;12Page &amp;P</oddFooter>
+    </headerFooter>
   </worksheet>`
 	c.Assert(output.String(), Equals, expectedXLSXSheet)
 }

+ 224 - 8
xmlWorksheet.go

@@ -9,10 +9,159 @@ import (
 // currently I have not checked it for completeness - it does as much
 // as I need.
 type xlsxWorksheet struct {
-	XMLName   xml.Name      `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main worksheet"`
-	Dimension xlsxDimension `xml:"dimension"`
-	Cols      xlsxCols      `xml:"cols,omitempty"`
-	SheetData xlsxSheetData `xml:"sheetData"`
+	XMLName       xml.Name          `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main worksheet"`
+	SheetPr       xlsxSheetPr       `xml:"sheetPr"`
+	SheetViews    xlsxSheetViews    `xml:"sheetViews"`
+	SheetFormatPr xlsxSheetFormatPr `xml:"sheetFormatPr"`
+	Dimension     xlsxDimension     `xml:"dimension"`
+	Cols          xlsxCols          `xml:"cols"`
+	PrintOptions  xlsxPrintOptions  `xml:"printOptions"`
+	PageMargins   xlsxPageMargins   `xml:"pageMargins"`
+	PageSetUp     xlsxPageSetUp     `xml:"pageSetup"`
+	SheetData     xlsxSheetData     `xml:"sheetData"`
+	HeaderFooter  xlsxHeaderFooter  `xml:"headerFooter"`
+}
+
+// xlsxHeaderFooter directly maps the headerFooter element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main -
+// currently I have not checked it for completeness - it does as much
+// as I need.
+type xlsxHeaderFooter struct {
+	DifferentFirst   bool            `xml:"differentFirst,attr"`
+	DifferentOddEven bool            `xml:"differentOddEven,attr"`
+	OddHeader        []xlsxOddHeader `xml:"oddHeader"`
+	OddFooter        []xlsxOddFooter `xml:"oddFooter"`
+}
+
+// xlsxOddHeader directly maps the oddHeader element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main -
+// currently I have not checked it for completeness - it does as much
+// as I need.
+type xlsxOddHeader struct {
+	Content string `xml:",chardata"`
+}
+
+// xlsxOddFooter directly maps the oddFooter element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main -
+// currently I have not checked it for completeness - it does as much
+// as I need.
+type xlsxOddFooter struct {
+	Content string `xml:",chardata"`
+}
+
+// xlsxPageSetUp directly maps the pageSetup element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main -
+// currently I have not checked it for completeness - it does as much
+// as I need.
+type xlsxPageSetUp struct {
+	PaperSize          string  `xml:"paperSize,attr"`
+	Scale              int     `xml:"scale,attr"`
+	FirstPageNumber    int     `xml:"firstPageNumber,attr"`
+	FitToWidth         int     `xml:"fitToWidth,attr"`
+	FitToHeight        int     `xml:"fitToHeight,attr"`
+	PageOrder          string  `xml:"pageOrder,attr"`
+	Orientation        string  `xml:"orientation,attr"`
+	UsePrinterDefaults bool    `xml:"usePrinterDefaults,attr"`
+	BlackAndWhite      bool    `xml:"blackAndWhite,attr"`
+	Draft              bool    `xml:"draft,attr"`
+	CellComments       string  `xml:"cellComments,attr"`
+	UseFirstPageNumber bool    `xml:"useFirstPageNumber,attr"`
+	HorizontalDPI      float32 `xml:"horizontalDpi,attr"`
+	VerticalDPI        float32 `xml:"verticalDpi,attr"`
+	Copies             int     `xml:"copies,attr"`
+}
+
+// xlsxPrintOptions directly maps the printOptions element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main -
+// currently I have not checked it for completeness - it does as much
+// as I need.
+type xlsxPrintOptions struct {
+	Headings           bool `xml:"headings,attr"`
+	GridLines          bool `xml:"gridLines,attr"`
+	GridLinesSet       bool `xml:"gridLinesSet,attr"`
+	HorizontalCentered bool `xml:"horizontalCentered,attr"`
+	VerticalCentered   bool `xml:"verticalCentered,attr"`
+}
+
+// xlsxPageMargins directly maps the pageMargins element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main -
+// currently I have not checked it for completeness - it does as much
+// as I need.
+type xlsxPageMargins struct {
+	Left   float64 `xml:"left,attr"`
+	Right  float64 `xml:"right,attr"`
+	Top    float64 `xml:"top,attr"`
+	Bottom float64 `xml:"bottom,attr"`
+	Header float64 `xml:"header,attr"`
+	Footer float64 `xml:"footer,attr"`
+}
+
+// xlsxSheetFormatPr directly maps the sheetFormatPr element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main -
+// currently I have not checked it for completeness - it does as much
+// as I need.
+type xlsxSheetFormatPr struct {
+	DefaultRowHeight float64 `xml:"defaultRowHeight,attr"`
+}
+
+// xlsxSheetViews directly maps the sheetViews element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main -
+// currently I have not checked it for completeness - it does as much
+// as I need.
+type xlsxSheetViews struct {
+	SheetView []xlsxSheetView `xml:"sheetView"`
+}
+
+// xlsxSheetView directly maps the sheetView element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main -
+// currently I have not checked it for completeness - it does as much
+// as I need.
+type xlsxSheetView struct {
+	WindowProtection        bool            `xml:"windowProtection,attr"`
+	ShowFormulas            bool            `xml:"showFormulas,attr"`
+	ShowGridLines           bool            `xml:"showGridLines,attr"`
+	ShowRowColHeaders       bool            `xml:"showRowColHeaders,attr"`
+	ShowZeros               bool            `xml:"showZeros,attr"`
+	RightToLeft             bool            `xml:"rightToLeft,attr"`
+	TabSelected             bool            `xml:"tabSelected,attr"`
+	ShowOutlineSymbols      bool            `xml:"showOutlineSymbols,attr"`
+	DefaultGridColor        bool            `xml:"defaultGridColor,attr"`
+	View                    string          `xml:"view,attr"`
+	TopLeftCell             string          `xml:"topLeftCell,attr"`
+	ColorId                 int             `xml:"colorId,attr"`
+	ZoomScale               float64         `xml:"zoomScale,attr"`
+	ZoomScaleNormal         float64         `xml:"zoomScaleNormal,attr"`
+	ZoomScalePageLayoutView float64         `xml:"zoomScalePageLayoutView,attr"`
+	WorkbookViewId          int             `xml:"workbookViewId,attr"`
+	Selection               []xlsxSelection `xml:"selection"`
+}
+
+// xlsxSelection directly maps the selection element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main -
+// currently I have not checked it for completeness - it does as much
+// as I need.
+type xlsxSelection struct {
+	Pane         string `xml:"pane,attr"`
+	ActiveCell   string `xml:"activeCell,attr"`
+	ActiveCellId int    `xml:"activeCellId,attr"`
+	SQRef        string `xml:"sqref,attr"`
+}
+
+// xlsxSheetPr directly maps the sheetPr element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main -
+// currently I have not checked it for completeness - it does as much
+// as I need.
+type xlsxSheetPr struct {
+	FilterMode  bool              `xml:"filterMode,attr"`
+	PageSetUpPr []xlsxPageSetUpPr `xml:"pageSetUpPr"`
+}
+
+// xlsxPageSetUpPr directly maps the pageSetupPr element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main -
+// currently I have not checked it for completeness - it does as much
+// as I need.
+type xlsxPageSetUpPr struct {
+	FitToPage bool `xml:"fitToPage,attr"`
 }
 
 // xlsxCols directly maps the cols element in the namespace
@@ -28,10 +177,12 @@ type xlsxCols struct {
 // currently I have not checked it for completeness - it does as much
 // as I need.
 type xlsxCol struct {
-	Min    int     `xml:"min,attr"`
-	Max    int     `xml:"max,attr"`
-	Hidden bool    `xml:"hidden,attr,omitempty"`
-	Width  float64 `xml:"width,attr,omitempty"`
+	Collapsed bool    `xml:"collapsed,attr"`
+	Hidden    bool    `xml:"hidden,attr"`
+	Max       int     `xml:"max,attr"`
+	Min       int     `xml:"min,attr"`
+	Style     int     `xml:"style,attr"`
+	Width     float64 `xml:"width,attr"`
 }
 
 // xlsxDimension directly maps the dimension element in the namespace
@@ -72,3 +223,68 @@ type xlsxC struct {
 	T string `xml:"t,attr"` // Type.
 	V string `xml:"v"`      // Value
 }
+
+// Create a new XLSX Worksheet with default values populated.
+// Strictly for internal use only!
+func newXlsxWorksheet() (worksheet *xlsxWorksheet) {
+	worksheet = &xlsxWorksheet{}
+	worksheet.SheetPr.FilterMode = false
+	worksheet.SheetPr.PageSetUpPr = make([]xlsxPageSetUpPr, 1)
+	worksheet.SheetPr.PageSetUpPr[0] = xlsxPageSetUpPr{FitToPage: false}
+	worksheet.SheetViews.SheetView = make([]xlsxSheetView, 1)
+	worksheet.SheetViews.SheetView[0] = xlsxSheetView{
+		ColorId:                 64,
+		DefaultGridColor:        true,
+		RightToLeft:             false,
+		Selection:               make([]xlsxSelection, 1),
+		ShowFormulas:            false,
+		ShowGridLines:           true,
+		ShowOutlineSymbols:      true,
+		ShowRowColHeaders:       true,
+		ShowZeros:               true,
+		TabSelected:             true,
+		TopLeftCell:             "A1",
+		View:                    "normal",
+		WindowProtection:        false,
+		WorkbookViewId:          0,
+		ZoomScale:               100,
+		ZoomScaleNormal:         100,
+		ZoomScalePageLayoutView: 100}
+	worksheet.SheetViews.SheetView[0].Selection[0] = xlsxSelection{
+		Pane:         "topLeft",
+		ActiveCell:   "A1",
+		ActiveCellId: 0,
+		SQRef:        "A1"}
+	worksheet.SheetFormatPr.DefaultRowHeight = 12.85
+	worksheet.PrintOptions.Headings = false
+	worksheet.PrintOptions.GridLines = false
+	worksheet.PrintOptions.GridLinesSet = true
+	worksheet.PrintOptions.HorizontalCentered = false
+	worksheet.PrintOptions.VerticalCentered = false
+	worksheet.PageMargins.Left = 0.7875
+	worksheet.PageMargins.Right = 0.7875
+	worksheet.PageMargins.Top = 1.05277777777778
+	worksheet.PageMargins.Bottom = 1.05277777777778
+	worksheet.PageMargins.Header = 0.7875
+	worksheet.PageMargins.Footer = 0.7875
+	worksheet.PageSetUp.PaperSize = "9"
+	worksheet.PageSetUp.Scale = 100
+	worksheet.PageSetUp.FirstPageNumber = 1
+	worksheet.PageSetUp.FitToWidth = 1
+	worksheet.PageSetUp.FitToHeight = 1
+	worksheet.PageSetUp.PageOrder = "downThenOver"
+	worksheet.PageSetUp.Orientation = "portrait"
+	worksheet.PageSetUp.UsePrinterDefaults = false
+	worksheet.PageSetUp.BlackAndWhite = false
+	worksheet.PageSetUp.Draft = false
+	worksheet.PageSetUp.CellComments = "none"
+	worksheet.PageSetUp.UseFirstPageNumber = true
+	worksheet.PageSetUp.HorizontalDPI = 300
+	worksheet.PageSetUp.VerticalDPI = 300
+	worksheet.PageSetUp.Copies = 1
+	worksheet.HeaderFooter.OddHeader = make([]xlsxOddHeader, 1)
+	worksheet.HeaderFooter.OddHeader[0] = xlsxOddHeader{Content: `&C&"Times New Roman,Regular"&12&A`}
+	worksheet.HeaderFooter.OddFooter = make([]xlsxOddFooter, 1)
+	worksheet.HeaderFooter.OddFooter[0] = xlsxOddFooter{Content: `&C&"Times New Roman,Regular"&12Page &P`}
+	return
+}