Skip to content

Commit

Permalink
interim
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaliance committed Sep 28, 2017
1 parent e00296f commit 01bceae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions spreadsheet/stylesheet.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ func NewStyleSheet(wb *Workbook) StyleSheet {

ss.CellXfs.Xf = append(ss.CellXfs.Xf, xf2)
ss.CellXfs.CountAttr = gooxml.Uint32(uint32(len(ss.CellXfs.Xf)))

ss.TableStyles = sml.NewCT_TableStyles()
ss.TableStyles.DefaultPivotStyleAttr = gooxml.String("PivotStyleMedium7")
ss.TableStyles.DefaultTableStyleAttr = gooxml.String("TableStyleMedium9")

return s
}

Expand Down
5 changes: 2 additions & 3 deletions spreadsheet/workbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,8 @@ func (wb *Workbook) AddPivotTable() PivotTable {
wb.pivotCache = append(wb.pivotCache, pcache)
crel := common.NewRelationships()
wb.pivotCacheRels = append(wb.pivotCacheRels, crel)
crel.AddAutoRelationship(gooxml.DocTypeSpreadsheet, gooxml.PivotCacheDefinitionType, len(wb.pivotCache), gooxml.PivotCacheRecordsType)
recID := crel.AddAutoRelationship(gooxml.DocTypeSpreadsheet, gooxml.PivotCacheDefinitionType, len(wb.pivotCache), gooxml.PivotCacheRecordsType)
pcache.IdAttr = gooxml.String(recID.ID())

precs := sml.NewPivotCacheRecords()
wb.pivotRecords = append(wb.pivotRecords, precs)
Expand All @@ -649,8 +650,6 @@ func (wb *Workbook) AddPivotTable() PivotTable {

pvd.CacheIdAttr = uint32(pc.CacheIdAttr)

// TODO: make configurable
pcache.IdAttr = gooxml.String("rId1")
pvd.Location.FirstHeaderRowAttr = 1
pvd.Location.FirstDataRowAttr = 2
pvd.Location.FirstDataColAttr = 1
Expand Down

0 comments on commit 01bceae

Please sign in to comment.