diff options
Diffstat (limited to 'pivotTable.go')
-rw-r--r-- | pivotTable.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/pivotTable.go b/pivotTable.go index 3a277c3..96e3627 100644 --- a/pivotTable.go +++ b/pivotTable.go @@ -15,7 +15,6 @@ import ( "encoding/xml" "errors" "fmt" - "path/filepath" "strconv" "strings" ) @@ -139,9 +138,7 @@ func (f *File) AddPivotTable(opt *PivotTableOption) error { } // workbook pivot cache - wbPath := f.getWorkbookPath() - wbRelsPath := strings.TrimPrefix(filepath.Join(filepath.Dir(wbPath), "_rels", filepath.Base(wbPath)+".rels"), string(filepath.Separator)) - workBookPivotCacheRID := f.addRels(wbRelsPath, SourceRelationshipPivotCache, fmt.Sprintf("/xl/pivotCache/pivotCacheDefinition%d.xml", pivotCacheID), "") + workBookPivotCacheRID := f.addRels(f.getWorkbookRelsPath(), SourceRelationshipPivotCache, fmt.Sprintf("/xl/pivotCache/pivotCacheDefinition%d.xml", pivotCacheID), "") cacheID := f.addWorkbookPivotCache(workBookPivotCacheRID) pivotCacheRels := "xl/pivotTables/_rels/pivotTable" + strconv.Itoa(pivotTableID) + ".xml.rels" |