Jelajahi Sumber

导出excel的go服务

haozi 5 tahun lalu
induk
melakukan
838c6534f8
100 mengubah file dengan 28207 tambahan dan 3 penghapusan
  1. 0 3
      laravel-echo-server.lock
  2. 2 0
      serves/excelExportGo/.gitignore
  3. 8 0
      serves/excelExportGo/.idea/bswas.iml
  4. 6 0
      serves/excelExportGo/.idea/misc.xml
  5. 8 0
      serves/excelExportGo/.idea/modules.xml
  6. 70 0
      serves/excelExportGo/.idea/workspace.xml
  7. 188 0
      serves/excelExportGo/api/controller/controller.go
  8. 130 0
      serves/excelExportGo/api/controller/inventoryController.go
  9. 35 0
      serves/excelExportGo/api/controller/laborReportController.go
  10. 429 0
      serves/excelExportGo/api/controller/orderController.go
  11. 122 0
      serves/excelExportGo/api/controller/packageController.go
  12. 113 0
      serves/excelExportGo/api/controller/processController.go
  13. 120 0
      serves/excelExportGo/api/controller/rejectedController.go
  14. 170 0
      serves/excelExportGo/api/controller/waybillController.go
  15. 41 0
      serves/excelExportGo/excel/export.go
  16. 9 0
      serves/excelExportGo/go.mod
  17. 52 0
      serves/excelExportGo/go.sum
  18. 9 0
      serves/excelExportGo/logs/2020-09-09.log
  19. 37 0
      serves/excelExportGo/logs/2020-09-10.log
  20. TEMPAT SAMPAH
      serves/excelExportGo/main.exe
  21. 14 0
      serves/excelExportGo/main.go
  22. 59 0
      serves/excelExportGo/orm/query.go
  23. 70 0
      serves/excelExportGo/utilities/connect.go
  24. 11 0
      serves/excelExportGo/utilities/format.go
  25. 61 0
      serves/excelExportGo/utilities/log.go
  26. 5 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/.gitignore
  27. 26 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/.travis.yml
  28. 46 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/CODE_OF_CONDUCT.md
  29. 465 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/CONTRIBUTING.md
  30. 29 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/LICENSE
  31. 45 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/PULL_REQUEST_TEMPLATE.md
  32. 183 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/README.md
  33. 183 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/README_zh.md
  34. 9 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/SECURITY.md
  35. 336 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/adjust.go
  36. 3134 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/calc.go
  37. 78 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/calcchain.go
  38. 864 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/cell.go
  39. 877 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/chart.go
  40. 722 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/col.go
  41. 367 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/comment.go
  42. 267 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/datavalidation.go
  43. 184 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/date.go
  44. 158 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/docProps.go
  45. 1313 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/drawing.go
  46. 30 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/errors.go
  47. 379 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/excelize.go
  48. 0 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/excelize.svg
  49. 122 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/file.go
  50. 17 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/go.mod
  51. 39 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/go.sum
  52. 139 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/hsl.go
  53. 463 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/lib.go
  54. TEMPAT SAMPAH
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/logo.png
  55. 196 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/merge.go
  56. 634 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/picture.go
  57. 595 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/pivotTable.go
  58. 675 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/rows.go
  59. 462 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/shape.go
  60. 1661 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/sheet.go
  61. 554 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/sheetpr.go
  62. 217 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/sheetview.go
  63. 544 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/sparkline.go
  64. 517 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/stream.go
  65. 3073 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/styles.go
  66. 516 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/table.go
  67. 41 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/templates.go
  68. 146 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/vmlDrawing.go
  69. 63 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlApp.go
  70. 85 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlCalcChain.go
  71. 657 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlChart.go
  72. 88 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlChartSheet.go
  73. 87 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlComments.go
  74. 37 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlContentTypes.go
  75. 91 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlCore.go
  76. 235 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlDecodeDrawing.go
  77. 469 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlDrawing.go
  78. 229 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlPivotCache.go
  79. 296 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlPivotTable.go
  80. 105 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlSharedStrings.go
  81. 368 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlStyles.go
  82. 217 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlTable.go
  83. 151 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlTheme.go
  84. 301 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlWorkbook.go
  85. 864 0
      serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlWorksheet.go
  86. 1 0
      serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/.gitignore
  87. 18 0
      serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/.travis.yml
  88. 48 0
      serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/CHANGELOG.md
  89. 22 0
      serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/LICENSE
  90. 33 0
      serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/README.md
  91. 237 0
      serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/decode.go
  92. 6 0
      serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/doc.go
  93. 322 0
      serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/encode.go
  94. 3 0
      serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/go.mod
  95. 277 0
      serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/jsonstring.go
  96. 9 0
      serves/excelExportGo/vendor/github.com/go-sql-driver/mysql/.gitignore
  97. 129 0
      serves/excelExportGo/vendor/github.com/go-sql-driver/mysql/.travis.yml
  98. 105 0
      serves/excelExportGo/vendor/github.com/go-sql-driver/mysql/AUTHORS
  99. 206 0
      serves/excelExportGo/vendor/github.com/go-sql-driver/mysql/CHANGELOG.md
  100. 373 0
      serves/excelExportGo/vendor/github.com/go-sql-driver/mysql/LICENSE

+ 0 - 3
laravel-echo-server.lock

@@ -1,3 +0,0 @@
-{
-	"process": 25908
-}

+ 2 - 0
serves/excelExportGo/.gitignore

@@ -0,0 +1,2 @@
+vendor
+.idea

+ 8 - 0
serves/excelExportGo/.idea/bswas.iml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 6 - 0
serves/excelExportGo/.idea/misc.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="JavaScriptSettings">
+    <option name="languageLevel" value="ES6" />
+  </component>
+</project>

+ 8 - 0
serves/excelExportGo/.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/bswas.iml" filepath="$PROJECT_DIR$/.idea/bswas.iml" />
+    </modules>
+  </component>
+</project>

+ 70 - 0
serves/excelExportGo/.idea/workspace.xml

@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ChangeListManager">
+    <list default="true" id="62530a3c-1320-4654-9bf7-3f72d23e5c44" name="Default Changelist" comment="" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="GOROOT" path="D:\Go" />
+  <component name="GoLibraries">
+    <option name="indexEntireGoPath" value="false" />
+  </component>
+  <component name="ProjectId" id="1hFxkt2nC7GaKCcHDpJNfGCirF8" />
+  <component name="ProjectViewState">
+    <option name="hideEmptyMiddlePackages" value="true" />
+    <option name="showExcludedFiles" value="true" />
+    <option name="showLibraryContents" value="true" />
+  </component>
+  <component name="PropertiesComponent">
+    <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
+    <property name="WebServerToolWindowFactoryState" value="false" />
+    <property name="go.import.settings.migrated" value="true" />
+    <property name="go.tried.to.enable.integration.vgo.integrator" value="true" />
+    <property name="go.vendoring.notification.had.been.shown" value="true" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
+    <property name="settings.editor.selected.configurable" value="reference.settings.ide.settings.file-colors" />
+  </component>
+  <component name="ServiceViewManager">
+    <option name="viewStates">
+      <list>
+        <serviceView>
+          <treeState>
+            <expand />
+            <select />
+          </treeState>
+        </serviceView>
+      </list>
+    </option>
+  </component>
+  <component name="TypeScriptGeneratedFilesManager">
+    <option name="version" value="1" />
+  </component>
+  <component name="VgoProject">
+    <integration-enabled>true</integration-enabled>
+    <proxy>direct</proxy>
+  </component>
+  <component name="WindowStateProjectService">
+    <state x="233" y="0" key="#GOROOT" timestamp="1599621171372">
+      <screen x="0" y="0" width="1280" height="680" />
+    </state>
+    <state x="233" y="0" key="#GOROOT/0.0.1280.680/-1920.-414.1920.1040@0.0.1280.680" timestamp="1599621171372" />
+    <state x="96" y="0" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1599620920315">
+      <screen x="0" y="0" width="1280" height="680" />
+    </state>
+    <state x="96" y="0" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1280.680/-1920.-414.1920.1040@0.0.1280.680" timestamp="1599620920315" />
+    <state x="-1222" y="-91" key="#com.intellij.fileTypes.FileTypeChooser" timestamp="1600045955252">
+      <screen x="-1920" y="-414" width="1920" height="1040" />
+    </state>
+    <state x="-1222" y="-91" key="#com.intellij.fileTypes.FileTypeChooser/0.0.1280.680/-1920.-414.1920.1040@-1920.-414.1920.1040" timestamp="1600045955252" />
+    <state x="141" y="0" key="SettingsEditor" timestamp="1599620916903">
+      <screen x="0" y="0" width="1280" height="680" />
+    </state>
+    <state x="141" y="0" key="SettingsEditor/0.0.1280.680/-1920.-414.1920.1040@0.0.1280.680" timestamp="1599620916903" />
+    <state x="-1284" y="-295" width="647" height="801" key="find.popup" timestamp="1599648249968">
+      <screen x="-1920" y="-414" width="1920" height="1040" />
+    </state>
+    <state x="-1284" y="-295" width="647" height="801" key="find.popup/0.0.1280.680/-1920.-414.1920.1040@-1920.-414.1920.1040" timestamp="1599648249968" />
+  </component>
+</project>

+ 188 - 0
serves/excelExportGo/api/controller/controller.go

@@ -0,0 +1,188 @@
+package controller
+
+import (
+	"bswas/excel"
+	"bswas/orm"
+	"bswas/utilities"
+	"encoding/json"
+	"fmt"
+	"net/http"
+)
+
+func Export(w http.ResponseWriter,req *http.Request)  {
+	errorMsg := utilities.NewError()
+	decoder := json.NewDecoder(req.Body)
+	var params map[string]string
+	// 解析参数 存入map
+	e := decoder.Decode(&params)
+	if e != nil{
+		utilities.WriteLog("/api/controller/controller.go:17   参数解析失败!","ERROR")
+		return
+	}
+	file := excel.CreateFile(selectModule(params))
+	if errorMsg.GetMsg() != "" {
+		w.Header().Set("Msg",errorMsg.GetMsg())
+		w.WriteHeader(500)
+		return
+	}
+	if _, err := file.WriteTo(w); err != nil {
+		utilities.WriteLog("/api/controller/controller.go:22   返回二进制流失败!","ERROR")
+		return
+	}
+}
+
+func selectModule(params map[string]string) (row []interface{}, list [][]interface{}, mergeRow map[string]string, mergeColumn []string) {
+	var data []map[string]string
+	switch params["type"] {
+	case "waybill":
+		data = orm.GetMysqlData(params["sql"])
+		row, list = WaybillFormat(data)
+	case "waybillDelivering":
+		data = orm.GetMysqlData(params["sql"])
+		row, list = WaybillDeliveringFormat(data)
+	case "waybillFinancial":
+		data = orm.GetMysqlData(params["sql"])
+		row, list = WaybillFinancialFormat(data)
+	case "rejected":
+		data = orm.GetMysqlData(params["sql"])
+		row, list, mergeRow = RejectedFormat(data)
+		mergeColumn = []string{
+			"A","B","C","D","E","F","G","H","I","J","K","T","U",
+		}
+	case "rejectedStatistics":
+		data = orm.GetMysqlData(params["sql"])
+		row, list = RejectedStatisticsFormat(data)
+	case "order":
+		data = orm.GetOracleData(params["sql"])
+		row, list, mergeRow = OrderFormat(data)
+		mergeColumn = []string{
+			"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P",
+			"Q","R","S","Z","AA","AB","AC","AD",
+		}
+	case "orderWave":
+		data = orm.GetOracleData(params["sql"])
+		row, list = OrderWaveFormat(data)
+	case "package":
+		data = orm.GetMysqlData(params["sql"])
+		row, list = PackageFormat(data)
+	case "packageIssuedException":
+		data = orm.GetMysqlData(params["sql"])
+		row, list = PackageIssuedExceptionFormat(data)
+	case "packageCreateException":
+		data = orm.GetMysqlData(params["sql"])
+		row, list = PackageCreateExceptionFormat(data)
+	case "inventory":
+		if params["sql"] != "" {
+			data = orm.GetOracleData(params["sql"])
+		}else{
+			err := json.Unmarshal([]byte(params["data"]), &data)
+			if err != nil {
+				utilities.WriteLog("/api/controller/controller.go:73   库存数据json解析失败!","ERROR")
+			}
+		}
+		row, list = InventoryFormat(data, true)
+	case "allInventory":
+		if params["sql"] != "" {
+			data = orm.GetOracleData(params["sql"])
+		}else{
+			err := json.Unmarshal([]byte(params["data"]), &data)
+			if err != nil {
+				utilities.WriteLog("/api/controller/controller.go:83   全部库存数据json解析失败!","ERROR")
+			}
+		}
+		row, list = InventoryFormat(data, false)
+	case "inventoryDailyLog":
+		data = orm.GetMysqlData(params["sql"])
+		row, list = InventoryDailyLogFormat(data)
+	case "process":
+		data = orm.GetMysqlData(params["sql"])
+		row, list, mergeRow = ProcessFormat(data)
+		mergeColumn = []string{
+			"A","B","C","D","E","F","G","H","I",
+		}
+	case "processStatistic":
+		data = orm.GetMysqlData(params["sql"])
+		row, list = ProcessStatisticFormat(data)
+	case "laborReport":
+		err := json.Unmarshal([]byte(params["data"]), &data)
+		if err != nil {
+			utilities.WriteLog("/api/controller/controller.go:102   临时工报表数据json解析失败!","ERROR")
+		}
+		row, list = LaborReportFormat(data)
+	case "orderIssue":
+		sqlList := make(map[string]string)
+		err := json.Unmarshal([]byte(params["sqlList"]), &sqlList)
+		if err != nil {
+			utilities.WriteLog("/api/controller/controller.go:110   订单问题件数据json解析失败!","ERROR")
+		}
+		if sqlList["orderPackageSql"] == "" || sqlList["secondOrderPackageSql"] == "" || sqlList["orderIssueSql"] == "" || sqlList["rejectedBillItemSql"] == "" || sqlList["logSql"] == ""{
+			return
+		}
+		orderIssues := orm.GetMysqlData(sqlList["orderIssueSql"])
+		if len(orderIssues) < 1 {
+			break
+		}
+		modelData, orderPackageConditionValue, secondOrderPackageConditionValue, rejectedBillItemConditionValue, logConditionValue := GetOrderIssuesModel(orderIssues)
+		orderPackages := make([]map[string]string,0)
+		secondOrderPackages := make([]map[string]string,0)
+		rejectedBillItems := make([]map[string]string,0)
+		logs := make([]map[string]string,0)
+		OP := len(orderPackageConditionValue)
+		SOP := len(secondOrderPackageConditionValue)
+		RB := len(rejectedBillItemConditionValue)
+		L := len(logConditionValue)
+		if  orderPackageConditionValue[OP-2:] != "()"{
+			if orderPackageConditionValue[OP-2:OP-1] == "," {
+				orderPackageConditionValue = orderPackageConditionValue[0:OP-2] + orderPackageConditionValue[OP-1:]
+			}
+			orderPackages = orm.GetMysqlData(sqlList["orderPackageSql"]+orderPackageConditionValue)
+		}
+		if  secondOrderPackageConditionValue[len(secondOrderPackageConditionValue)-2:] != "()"{
+			if secondOrderPackageConditionValue[SOP-2:SOP-1] == "," {
+				secondOrderPackageConditionValue = secondOrderPackageConditionValue[0:SOP-2] + secondOrderPackageConditionValue[SOP-1:]
+			}
+			secondOrderPackages = orm.GetMysqlData(sqlList["secondOrderPackageSql"]+secondOrderPackageConditionValue)
+		}
+		if  rejectedBillItemConditionValue[len(rejectedBillItemConditionValue)-2:] != "()"{
+			if rejectedBillItemConditionValue[RB-2:RB-1] == "," {
+				rejectedBillItemConditionValue = rejectedBillItemConditionValue[0:RB-2] + rejectedBillItemConditionValue[RB-1:]
+			}
+			rejectedBillItems = orm.GetMysqlData(sqlList["rejectedBillItemSql"]+rejectedBillItemConditionValue)
+		}
+		if  logConditionValue[len(logConditionValue)-2:] != "()"{
+			if logConditionValue[L-2:L-1] == "," {
+				logConditionValue = logConditionValue[0:L-2] + logConditionValue[L-1:]
+			}
+			logs = orm.GetMysqlData(sqlList["logSql"]+logConditionValue)
+		}
+		result := MergerOrderIssueData(modelData,orderPackages,secondOrderPackages,rejectedBillItems,logs)
+		row, list, mergeRow = OrderIssueFormat(result)
+		mergeColumn = []string{
+			"A","B","C","D","E","F","G","H","I","J","K","L",
+			"U","Y","Z","AA","AF","AG","AH","AI","AJ","AK",
+		}
+	case "packageStatistic":
+		type paramList struct {
+			ROW []interface{} `json:"row"`
+			LIST []map[int]string `json:"list"`
+		}
+		request := paramList{}
+		err := json.Unmarshal([]byte(params["data"]), &request)
+		if err != nil {
+			utilities.WriteLog("/api/controller/controller.go:137   称重统计数据json解析失败!","ERROR")
+		}
+		row, list = PackageStatisticFormat(request.ROW, request.LIST)
+	case "inventoryAccountMission":
+		fmt.Println(params["data"])
+		err := json.Unmarshal([]byte(params["data"]), &data)
+		if err != nil {
+			fmt.Println(err)
+			utilities.WriteLog("/api/controller/controller.go:178   库存盘点数据json解析失败!","ERROR")
+		}
+		row, list = InventoryAccountMissionFormat(data)
+	case "inventoryCompare":
+		data = orm.GetMysqlData(params["sql"])
+		row, list = InventoryCompareFormat(data)
+	}
+	return row,list,mergeRow,mergeColumn
+}

+ 130 - 0
serves/excelExportGo/api/controller/inventoryController.go

@@ -0,0 +1,130 @@
+package controller
+
+import (
+	"bswas/utilities"
+)
+
+func InventoryFormat(data []map[string]string, requestType bool) ([]interface{}, [][]interface{})  {
+	row := []interface{}{
+		"货主","库位","产品编码","产品条码","商品名称","属性仓	","质量状态","失效日期","批号",
+	}
+	if requestType == true {
+		row = append(row,"移出数量","移入数量")
+	}
+	row = append(row,"在库数量","占用数量")
+	list := make([][]interface{},len(data))
+	for k,v := range data{
+		line := make([]interface{},len(row))
+		for index,column := range row {
+			line[index] = v[column.(string)]
+		}
+		list[k] = line
+	}
+	return row, list
+}
+
+func InventoryDailyLogFormat(data []map[string]string) ([]interface{}, [][]interface{})  {
+	row := []interface{}{
+		"货主","日期","商品名称","商品编码","商品条码","在库数量","长","宽","高","体积","总占用体积",
+	}
+	column := map[string]int{
+		"owner_name" : 0,
+		"created_at" : 1,
+		"commodity_name" : 2,
+		"commodity_sku" : 3,
+		"commodity_barcode_code" : 4,
+		"amount" : 5,
+		"commodity_length" : 6,
+		"commodity_width" : 7,
+		"commodity_height" : 8,
+		"commodity_volumn" : 9,
+		"volumn_occupied" : 10,
+	}
+	list := make([][]interface{},len(data))
+	for k,v := range data{
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			if key == "created_at" {
+				line[value] = utilities.DateFormat(v[key])
+				continue
+			}
+			line[value] = v[key]
+		}
+		list[k] = line
+	}
+	return row, list
+}
+func InventoryAccountMissionFormat(data []map[string]string) ([]interface{}, [][]interface{})  {
+	row := []interface{}{
+		"库位","产品名","商品条码","商品编码","生产日期","失效日期","批号","盘点人","ERP属性仓","质量状态","库存数量",
+		"可用数量","盘点数量","复盘数量","复盘差异","分配数量","状态",
+	}
+		column := map[string]int{
+		"location" : 0,
+		"commodity_name" : 1,
+		"commodity_barcode" : 2,
+		"commodity_sku" : 3,
+		"produced_at" : 4,
+		"valid_at" : 5,
+		"batch_number" : 6,
+		"stock_person" : 7,
+		"erp_type_position" : 8,
+		"quality" : 9,
+		"stored_amount" : 10,
+		"valid_amount" : 11,
+		"verified_amount" : 12,
+		"re_checked_amount" : 13,
+		"difference_amount" : 14,
+		"occupied_amount" : 15,
+		"mark" : 16,
+
+	}
+	list := make([][]interface{},len(data))
+	for k,v := range data{
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			if key == "produced_at" && v[key] != "" {
+				line[value] = utilities.DateFormat(v[key])
+				continue
+			}
+			if key == "valid_at" && v[key] != "" {
+				line[value] = utilities.DateFormat(v[key])
+				continue
+			}
+			line[value] = v[key]
+		}
+		list[k] = line
+	}
+	return row, list
+}
+func InventoryCompareFormat(data []map[string]string) ([]interface{}, [][]interface{})  {
+	row := []interface{}{
+		"货主","任务号","生产时间","商品名称","商品编码","商品条码","属性仓","质量状态","宝时库存","参考库存","差值",
+	}
+	column := map[string]int{
+		"owner_name" : 0,
+		"mission_code" : 1,
+		"created_at" : 2,
+		"commodity_name" : 3,
+		"commodity_sku" : 4,
+		"commodity_barcode_code" : 5,
+		"custom_location" : 6,
+		"quality" : 7,
+		"amount_in_sys" : 8,
+		"amount_in_compare" : 9,
+		"differ" : 10,
+	}
+	list := make([][]interface{},len(data))
+	for k,v := range data{
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			if key == "created_at" {
+				line[value] = utilities.DateFormat(v[key])
+				continue
+			}
+			line[value] = v[key]
+		}
+		list[k] = line
+	}
+	return row, list
+}

+ 35 - 0
serves/excelExportGo/api/controller/laborReportController.go

@@ -0,0 +1,35 @@
+package controller
+
+func LaborReportFormat(data []map[string]string) ([]interface{}, [][]interface{})  {
+	row := []interface{}{
+		"进厂编号","小组","临时工","电话","身份证号","劳务所","进场时间","进组时间","退组时间",
+		"退场时间","审核时间","审核人","晚饭时间(分)","在线时长","本次工作时长","备注",
+	}
+	column := map[string]int{
+		"enter_number" : 0,
+		"user_workgroup_name" : 1,
+		"name" : 2,
+		"mobile_phone" : 3,
+		"identity_number" : 4,
+		"labor_company" : 5,
+		"enter_at" : 6,
+		"check_in_at" : 7,
+		"check_out_at" : 8,
+		"exit_at" : 9,
+		"verify_at" : 10,
+		"group_user_id" : 11,
+		"relax_time" : 12,
+		"online_duration" : 13,
+		"working_duration" : 14,
+		"remark" : 15,
+	}
+	list := make([][]interface{},len(data))
+	for k,v := range data{
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			line[value] = v[key]
+		}
+		list[k] = line
+	}
+	return row, list
+}

+ 429 - 0
serves/excelExportGo/api/controller/orderController.go

@@ -0,0 +1,429 @@
+package controller
+
+import (
+	"bswas/utilities"
+	"strconv"
+	"strings"
+)
+
+func OrderFormat(data []map[string]string) ([]interface{}, [][]interface{}, map[string]string) {
+	row := []interface{}{
+		"编号","订单状态","备注","接口下发时间","店铺名称","客户","客户订单号","承运人","快递单号","收货人名称","收货人电话",
+		"省","市","区","收货人地址","波次编号","仓库","快递获取标记","快递获取时间","产品代码","产品条码","明细状态",
+		"产品名称","订单数量","复核时间","接口取消标记","拣货单打印标记","接口回传标记","接口回传异常备注","订单冻结",
+	}
+	column := map[string]int{
+		"ORDERNO" : 0,
+		"ORDERCODENAME" : 1,
+		"NOTES" : 2,
+		"ADDTIME" : 3,
+		"ISSUEPARTYNAME" : 4,
+		"CUSTOMER_DESCR_C" : 5,
+		"SOREFERENCE1" : 6,
+		"CARRIERNAME" : 7,
+		"SOREFERENCE5" : 8,
+		"C_CONTACT" : 9,
+		"C_TEL2" : 10,
+		"C_PROVINCE" : 11,
+		"C_CITY" : 12,
+		"C_DISTRICT" : 13,
+		"C_ADDRESS1" : 14,
+		"WAVENO" : 15,
+		"WAREHOUSEID" : 16,
+		"EDISENDFLAG2" : 17,
+		"EDISENDTIME2" : 18,
+		"SKU" : 19,
+		"ALTERNATE_SKU1" : 20,
+		"ORDERDETAILCODENAME" : 21,
+		"DESCR_C" : 22,
+		"QTYORDERED" : 23,
+		"CHECKTIME" : 24,
+		"ERPCANCELFLAG" : 25,
+		"PICKING_PRINT_FLAG" : 26,
+		"EDISENDFLAG" : 27,
+		"EDIREMARKS2" : 28,
+		"RELEASESTATUS" : 29,
+	}
+	list := make([][]interface{},len(data))
+	mergeRow := make(map[string]string)
+	var columnName string
+	var startIndex int
+	rowAmount := 0
+	for k,v := range data{
+		if columnName == v["ORDERNO"] {
+			rowAmount++
+		}else{
+			if rowAmount != 0 {
+				mergeRow[strconv.Itoa(startIndex+2)] = strconv.Itoa(startIndex+2+rowAmount)
+			}
+			columnName = v["ORDERNO"]
+			startIndex = k
+			rowAmount = 0
+		}
+		if rowAmount != 0 {
+			mergeRow[strconv.Itoa(startIndex+2)] = strconv.Itoa(startIndex+2+rowAmount)
+		}
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			val := v[key]
+			line[value] = val
+		}
+		list[k] = line
+	}
+	return row,list,mergeRow
+}
+
+func OrderWaveFormat(data []map[string]string) ([]interface{}, [][]interface{})  {
+	row := []interface{}{
+		"波次号","波次状态","波次规则","波次描述","承运人","操作员","创建时间","拣货单打印人","拣货单打印时间",
+		"快递单号打印人","快递单号打印时间",
+	}
+	column := map[string]int{
+		"WAVENO"  :  0,
+		"CODENAME_C"  :  1,
+		"WAVERULE"  :  2,
+		"DESCR"  :  3,
+		"DESCR_C"  :  4,
+		"ADDWHO"  :  5,
+		"ADDTIME"  :  6,
+		"pickerPrint"  :  7,
+		"pickerPrintTime"  :  8,
+		"expressPrinting"  :  9,
+		"expressPrintTime"  :  10,
+	}
+	list := make([][]interface{},len(data))
+	for k,v := range data{
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			val := ""
+			if key == "pickerPrint" && v["USERDEFINE1"] != ""{
+				index := strings.IndexAny(v["USERDEFINE1"],"-PK")
+				if  index != -1{
+					val = v["USERDEFINE1"][0:index-1]
+				}
+			}
+			if key == "pickerPrintTime" && v["USERDEFINE1"] != ""{
+				index := strings.IndexAny(v["USERDEFINE1"],"-PK")
+				if  index != -1{
+					val = v["USERDEFINE1"][index+3:len(v["USERDEFINE1"])-1]
+				}
+			}
+			if key == "expressPrinting" && v["USERDEFINE2"] != ""{
+				index := strings.IndexAny(v["USERDEFINE2"],"-EX")
+				if  index != -1{
+					val = v["USERDEFINE2"][0:index-1]
+				}else{
+					index := strings.IndexAny(v["USERDEFINE2"],"-Auto")
+					if  index != -1{
+						val = v["USERDEFINE2"][0:index-1]
+					}
+				}
+			}
+			if key == "expressPrintTime" && v["USERDEFINE2"] != ""{
+				index := strings.IndexAny(v["USERDEFINE2"],"-EX")
+				if  index != -1{
+					val = v["USERDEFINE2"][index+3:len(v["USERDEFINE2"])-1]
+				}else{
+					index := strings.IndexAny(v["USERDEFINE2"],"-Auto")
+					if  index != -1{
+						val = v["USERDEFINE2"][index+5:len(v["USERDEFINE2"])-1]
+					}
+				}
+			}
+			if val != ""{
+				line[value] = val
+			}else{
+				line[value] = v[key]
+			}
+		}
+		list[k] = line
+	}
+	return row, list
+}
+func MergerOrderIssueData(data map[string]map[string]interface{}, orderPackages []map[string]string,
+						secondOrderPackages []map[string]string, rejectedBillItems []map[string]string, logs []map[string]string) map[string]map[string]interface{} {
+	if len(orderPackages) > 0{
+		data = mergerOrderPackage(data, orderPackages)
+	}
+	if len(secondOrderPackages) > 0{
+		data = mergerSecondOrderPackage(data, secondOrderPackages)
+	}
+	if len(rejectedBillItems) > 0{
+		data = mergerRejectedBillItem(data, rejectedBillItems)
+	}
+	if len(logs) > 0{
+		data = mergerLog(data, logs)
+	}
+	return data
+}
+
+func mergerOrderPackage(data map[string]map[string]interface{}, orderPackages []map[string]string) map[string]map[string]interface{} {
+	for _,orderPackage := range orderPackages {
+		_,isExist := data[orderPackage["order_issue_id"]]["orderPackages"]
+		if isExist {
+			data[orderPackage["order_issue_id"]]["orderPackages"] = append(data[orderPackage["order_issue_id"]]["orderPackages"].([]map[string]string),orderPackage)
+		}else{
+			sliced := []map[string]string{
+				orderPackage,
+			}
+			data[orderPackage["order_issue_id"]]["orderPackages"] = sliced
+		}
+	}
+	return data
+}
+func mergerSecondOrderPackage(data map[string]map[string]interface{}, secondOrderPackages []map[string]string) map[string]map[string]interface{} {
+	for _,secondOrderPackage := range secondOrderPackages {
+		_,isExist := data[secondOrderPackage["order_issue_id"]]["secondOrderPackages"]
+		if isExist {
+			data[secondOrderPackage["order_issue_id"]]["secondOrderPackages"] = append(data[secondOrderPackage["order_issue_id"]]["secondOrderPackages"].([]map[string]string),secondOrderPackage)
+		}else{
+			sliced := []map[string]string{
+				secondOrderPackage,
+			}
+			data[secondOrderPackage["order_issue_id"]]["secondOrderPackages"] = sliced
+		}
+	}
+	return data
+}
+func mergerRejectedBillItem(data map[string]map[string]interface{}, rejectedBillItems []map[string]string) map[string]map[string]interface{} {
+	for _,rejectedBillItem := range rejectedBillItems {
+		_,isExist := data[rejectedBillItem["order_issue_id"]]["rejectedBillItems"]
+		if isExist {
+			data[rejectedBillItem["order_issue_id"]]["rejectedBillItems"] = append(data[rejectedBillItem["order_issue_id"]]["rejectedBillItems"].([]map[string]string),rejectedBillItem)
+		}else{
+			sliced := []map[string]string{
+				rejectedBillItem,
+			}
+			data[rejectedBillItem["order_issue_id"]]["rejectedBillItems"] = sliced
+		}
+	}
+	return data
+}
+func mergerLog(data map[string]map[string]interface{}, logs []map[string]string) map[string]map[string]interface{} {
+	for _,log := range logs {
+		_,isExist := data[log["order_issue_id"]]["logs"]
+		if isExist {
+			data[log["order_issue_id"]]["logs"] = append(data[log["order_issue_id"]]["logs"].([]map[string]string),log)
+		}else{
+			sliced := []map[string]string{
+				log,
+			}
+			data[log["order_issue_id"]]["logs"] = sliced
+		}
+	}
+	return data
+}
+func OrderIssueFormat(dataMap map[string]map[string]interface{}) ([]interface{}, [][]interface{}, map[string]string)  {
+	row := []interface{}{
+		"登记日期","创建日期","客户","店铺","客户订单号","原始承运商","收货人",
+		"收货电话","省","市","区","收货人地址","原始运单号","原始商品条码","原始商品名称","原始商品数量",
+		"退单备注","退单商品名","退单商品条码","退单商品数量","退单状态",
+		"操作类型","说明","操作者","问题类别","二次订单号","二次承运商","二次运单号",
+		"二次商品条码","二次商品名","二次商品数量","最终状态",
+		"承运商赔偿金额","承运商快递减免",
+		"宝时赔偿金额","宝时快递减免","事故责任方",
+	}
+	column := map[string]int{
+		"order_created_at"  :  0,
+		"order_issues_created_at"  :  1,
+		"owner_name"  :  2,
+		"shop_name"  :  3,
+		"client_code"  :  4,
+		"logistic_name"  :  5,
+		"consignee_name"  :  6,
+		"consignee_phone"  :  7,
+		"province"  :  8,
+		"city"  :  9,
+		"district"  :  10,
+		"address"  :  11,
+		"order_package_logistic_number"  :  12,
+		"commodity_sku"  :  13,
+		"commodity_name"  :  14,
+		"commodity_amount" : 15,
+		"remark" : 16,
+		"name_goods"  :  17,
+		"barcode_goods"  :  18,
+		"rejected_bill_amount"  :  19,
+		"rejecting_status"  :  20,
+		"log_type"  :  21,
+		"log_content"  :  22,
+		"user_name"  :  23,
+		"order_issue_type_name"  :  24,
+		"s_o_client_code"  :  25,
+		"s_logistics_name"  :  26,
+		"logistic_number"  :  27,
+		"s_c_sku"  :  28,
+		"s_c_name"  :  29,
+		"s_o_p_c_amount"  :  30,
+		"final_status"  :  31,
+		"logistic_indemnity_money"  :  32,
+		"logistic_express_remission"  :  33,
+		"baoshi_indemnity_money"  :  34,
+		"baoshi_express_remission"  :  35,
+		"user_workgroup_name"  :  36,
+	}
+	data := make([]map[string]interface{},len(dataMap))
+	for _,value := range dataMap {
+		data[value["index"].(int)] = value
+	}
+	var list [][]interface{}
+	mergeRow := make(map[string]string)
+	rownum := 0
+	for _,v := range data{
+		var orderPackages []map[string]string
+		var secondOrderPackages []map[string]string
+		var rejectedBillItems []map[string]string
+		var logs []map[string]string
+		if v["orderPackages"] != nil {
+			orderPackages = v["orderPackages"].([]map[string]string)
+		}
+		orderPackagesLength := len(orderPackages)
+
+		if v["secondOrderPackages"] != nil {
+			secondOrderPackages = v["secondOrderPackages"].([]map[string]string)
+		}
+		secondOrderPackagesLength := len(secondOrderPackages)
+
+		if v["rejectedBillItems"] != nil {
+			rejectedBillItems = v["rejectedBillItems"].([]map[string]string)
+		}
+		rejectedBillItemsLength := len(rejectedBillItems)
+
+		if v["logs"] != nil {
+			logs = v["logs"].([]map[string]string)
+		}
+		logsLength := len(logs)
+
+		count := 1
+		if  orderPackagesLength> count {
+			count = orderPackagesLength
+		}
+		if secondOrderPackagesLength > count {
+			count = secondOrderPackagesLength
+		}
+		if rejectedBillItemsLength > count {
+			count = rejectedBillItemsLength
+		}
+		if logsLength > count {
+			count = logsLength
+		}
+		if count > 1{
+			mergeRow[strconv.Itoa(rownum+2)] = strconv.Itoa(rownum+1+count)
+		}
+		for i := 0; i<count; i++ {
+			line := make([]interface{},len(row))
+			for key,value := range column {
+				if key == "order_created_at" || key == "order_issues_created_at" {
+					line[value] = utilities.DateFormat(v[key].(string))
+					continue
+				}
+				if key == "order_package_logistic_number" || key == "commodity_sku" || key == "commodity_name" || key == "commodity_amount"{
+					if i < orderPackagesLength && orderPackages != nil{
+						line[value] = orderPackages[i][key]
+					}else{
+						line[value] = ""
+					}
+					continue
+				}
+				if key == "logistic_number" || key == "s_c_sku" || key == "s_c_name" || key == "s_o_p_c_amount"{
+					if i < secondOrderPackagesLength && secondOrderPackages != nil{
+						line[value] = secondOrderPackages[i][key]
+					}else{
+						line[value] = ""
+					}
+					continue
+				}
+				if key == "rejected_bill_amount" || key == "name_goods" || key == "barcode_goods" || key == "remark"{
+					if i < rejectedBillItemsLength && rejectedBillItems != nil{
+						line[value] = rejectedBillItems[i][key]
+					}else{
+						line[value] = ""
+					}
+					continue
+				}
+				if key == "log_type" || key == "log_content" || key == "user_name"{
+					if i < logsLength && logs != nil{
+						line[value] = logs[i][key]
+					}else{
+						line[value] = ""
+					}
+					continue
+				}
+				line[value] = v[key]
+			}
+			list = append(list,line)
+			rownum++
+		}
+	}
+	return row, list, mergeRow
+}
+
+func GetOrderIssuesModel(orderIssues []map[string]string)(modelData map[string]map[string]interface{}, orderPackageConditionValue string,
+	secondOrderPackageConditionValue string, rejectedBillItemConditionValue string, logConditionValue string){
+	modelData = make(map[string]map[string]interface{})
+	orderPackageConditionValue = " WHERE order_packages.order_id IN ("
+	secondOrderPackageConditionValue = " WHERE s_o_p.order_id IN ("
+	rejectedBillItemConditionValue = " WHERE rejected_bill_items.id_rejected_bill IN ("
+	logConditionValue = " WHERE order_issue_process_logs.order_issue_id IN ("
+	for index,value := range orderIssues{
+		orderIssue := map[string]interface{}{
+			"index": 					  index,
+			"id":                         value["id"],
+			"district":                   value["district"],
+			"address":                    value["address"],
+			"city":                       value["city"],
+			"province":                   value["province"],
+			"consignee_name":             value["consignee_name"],
+			"consignee_phone":            value["consignee_phone"],
+			"client_code":                value["client_code"],
+			"order_created_at":           value["order_created_at"],
+			"logistic_name":              value["logistic_name"],
+			"owner_name":                 value["owner_name"],
+			"s_o_client_code":            value["s_o_client_code"],
+			"logistic_number":            value["logistic_number"],
+			"order_issues_created_at":    value["order_issues_created_at"],
+			"shop_name":                  value["shop_name"],
+			"rejecting_status":           value["rejecting_status"],
+			"order_issue_type_name":      value["order_issue_type_name"],
+			"final_status":               value["final_status"],
+			"logistic_indemnity_money":   value["logistic_indemnity_money"],
+			"logistic_express_remission": value["logistic_express_remission"],
+			"baoshi_indemnity_money":     value["baoshi_indemnity_money"],
+			"baoshi_express_remission":   value["baoshi_express_remission"],
+			"user_workgroup_name":        value["user_workgroup_name"],
+		}
+		modelData[value["id"]] = orderIssue
+		if index < len(orderIssues)-1{
+			if value["order_id"] != "" {
+				orderPackageConditionValue += value["order_id"]+","
+			}
+			if value["s_o_id"] != "" {
+				secondOrderPackageConditionValue += value["s_o_id"]+","
+			}
+			if value["rejected_bill_id"] != "" {
+				rejectedBillItemConditionValue += value["rejected_bill_id"]+","
+			}
+			if value["id"] != "" {
+				logConditionValue += value["id"]+","
+			}
+		}else{
+			if value["order_id"] != "" {
+				orderPackageConditionValue += value["order_id"]
+			}
+			if value["s_o_id"] != "" {
+				secondOrderPackageConditionValue += value["s_o_id"]
+			}
+			if value["rejected_bill_id"] != "" {
+				rejectedBillItemConditionValue += value["rejected_bill_id"]
+			}
+			if value["id"] != "" {
+				logConditionValue += value["id"]
+			}
+		}
+	}
+	orderPackageConditionValue += ")"
+	secondOrderPackageConditionValue += ")"
+	rejectedBillItemConditionValue += ")"
+	logConditionValue += ")"
+	return
+}

+ 122 - 0
serves/excelExportGo/api/controller/packageController.go

@@ -0,0 +1,122 @@
+package controller
+
+import (
+	"bswas/utilities"
+	"strconv"
+)
+
+func PackageFormat(data []map[string]string) ([]interface{}, [][]interface{})  {
+	row := []interface{}{
+		"货主","快递单号","发货单号","波次号","波次规则","操作时间","收件人","收件人电话","承运商","设备",
+		"重量(KG)","长(CM)","宽(CM)","高(CM)","体积(CM³)","纸箱","状态",
+	}
+	column := map[string]int{
+		"owner_name" : 0,
+		"logistic_number" : 1,
+		"delivery_number" : 2,
+		"batch_number" : 3,
+		"batch_rule" : 4,
+		"created_at" : 5,
+		"recipient" : 6,
+		"recipient_mobile" : 7,
+		"logistic_name" : 8,
+		"measuring_machine_name" : 9,
+		"weight" : 10,
+		"length" : 11,
+		"width" : 12,
+		"height" : 13,
+		"bulk" : 14,
+		"paper_box_name" : 15,
+		"status" : 16,
+	}
+	list := make([][]interface{},len(data))
+	for k,v := range data{
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			line[value] = v[key]
+		}
+		list[k] = line
+	}
+	return row,list
+}
+
+func PackageCreateExceptionFormat(data []map[string]string) ([]interface{}, [][]interface{})  {
+	row := []interface{}{
+		"快递单号","承运商","设备","称重时间","重(KG)","长(CM)","宽(CM)","高(CM)","体积(CM³)",
+		"纸箱","异常类型",
+	}
+	column := map[string]int{
+		"logistic_number" : 0,
+		"logistic_name" : 1,
+		"measuring_machine_name" : 2,
+		"weigh_time" : 3,
+		"weight" : 4,
+		"length" : 5,
+		"width" : 6,
+		"height" : 7,
+		"bulk" : 8,
+		"paper_box_name" : 9,
+		"status" : 10,
+	}
+	list := make([][]interface{},len(data))
+	for k,v := range data{
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			line[value] = v[key]
+		}
+		list[k] = line
+	}
+	return row,list
+}
+func PackageIssuedExceptionFormat(data []map[string]string) ([]interface{}, [][]interface{})  {
+	row := []interface{}{
+		"快递单号","下发时间","发货单号","波次号","波次规则","收件人","收件人电话","承运商","异常类型",
+	}
+	column := map[string]int{
+		"logistic_number" : 0,
+		"created_at" : 1,
+		"delivery_number" : 2,
+		"batch_number" : 3,
+		"batch_rule" : 4,
+		"recipient" : 5,
+		"recipient_mobile" : 6,
+		"logistic_name" : 7,
+		"status" : 8,
+	}
+	list := make([][]interface{},len(data))
+	for k,v := range data{
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			if key == "created_at"{
+				line[value] = utilities.DateFormat(v[key])
+				continue
+			}
+			line[value] = v[key]
+		}
+		list[k] = line
+	}
+	return row,list
+}
+
+func PackageStatisticFormat(ROW []interface{},LIST []map[int]string) ([]interface{}, [][]interface{}) {
+	list := make([][]interface{},len(LIST))
+	for k,v := range LIST {
+		line := make([]interface{},len(ROW))
+		amount := 0
+		for index,_ := range ROW {
+			_,sign := v[index]
+			if sign {
+				if index > 1 {
+					number,_ := strconv.Atoi(v[index])
+					amount += number
+				}
+				line[index] = v[index]
+			}else{
+				line[index] = "0"
+			}
+		}
+		line[1] = amount
+		list[k] = line
+	}
+	return ROW,list
+}

+ 113 - 0
serves/excelExportGo/api/controller/processController.go

@@ -0,0 +1,113 @@
+package controller
+
+import (
+	"bswas/utilities"
+	"strconv"
+)
+
+func ProcessFormat(data []map[string]string) ([]interface{}, [][]interface{}, map[string]string) {
+	row := []interface{}{
+		"任务号","货主","加工类型","预期数量","实际数量","状态","备注",
+		"单价","提交日期","单据类型","单据号","商品编码","商品名称","商品条码","本次数量",
+	}
+	column := map[string]int{
+		"code" : 0,
+		"owner_name" : 1,
+		"process_method_name" : 2,
+		"amount" : 3,
+		"completed_amount" : 4,
+		"status" : 5,
+		"remark" : 6,
+		"unit_price" : 7,
+		"created_at" : 8,
+		"content_bill_type" : 9,
+		"content_wms_code" : 10,
+		"commodity_sku" : 11,
+		"commodity_name" : 12,
+		"commodity_barcode_code" : 13,
+		"content_amount" : 14,
+	}
+	list := make([][]interface{},len(data))
+	mergeRow := make(map[string]string)
+	var columnName string
+	var startIndex int
+	rowAmount := 0
+	for k,v := range data{
+		if columnName == v["code"]{
+			rowAmount++
+		}else{
+			if rowAmount != 0 {
+				mergeRow[strconv.Itoa(startIndex+2)] = strconv.Itoa(startIndex+2+rowAmount)
+			}
+			columnName = v["code"]
+			startIndex = k
+			rowAmount = 0
+		}
+		if rowAmount != 0 {
+			mergeRow[strconv.Itoa(startIndex+2)] = strconv.Itoa(startIndex+2+rowAmount)
+		}
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			val := v[key]
+			if key == "commodity_sku" && v["sign_commodity_sku_mark"] != "" {
+				val = v["sign_commodity_sku_mark"]
+			}
+			if key == "commodity_name" && v["sign_commodity_name_mark"] != "" {
+				val = v["sign_commodity_name_mark"]
+			}
+			if key == "commodity_barcode_code" && v["sign_commodity_barcode_mark"] != "" {
+				val = v["sign_commodity_barcode_mark"]
+			}
+			if key == "created_at"{
+				val = utilities.DateFormat(v[key])
+			}
+			line[value] = val
+		}
+		list[k] = line
+	}
+	return row,list,mergeRow
+}
+
+func ProcessStatisticFormat(data []map[string]string) ([]interface{}, [][]interface{}) {
+	row := []interface{}{
+		"任务号", "货主", "开始日期", "完成日期", "单价", "预期数量", "完成数量", "收入合计",
+		"完成时间(天)'", "总工时", "加工类型", "最高日产能", "最低日产能", "日均产能", "合计成本", "毛利润",
+		"毛利率", "状态",
+	}
+	column := map[string]int{
+		"process_code" : 0,
+		"owner_name" : 1,
+		"started_at" : 2,
+		"ended_at" : 3,
+		"process_unit_price" : 4,
+		"process_amount" : 5,
+		"process_completed_amount" : 6,
+		"revenue" : 7,
+		"duration_days" : 8,
+		"duration_man_hours" : 9,
+		"process_method_name" : 10,
+		"top_capacity" : 11,
+		"bottom_capacity" : 12,
+		"average_capacity" : 13,
+		"total_cost" : 14,
+		"gross_profit" : 15,
+		"gross_profit_rate" : 16,
+		"process_status" : 17,
+	}
+	list := make([][]interface{},len(data))
+	for k,v := range data{
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			if key == "gross_profit_rate" {
+				rate,_ := strconv.ParseFloat(v[key],64)
+				if rate != 0 {
+					line[value] = strconv.FormatFloat(rate * 100, 'f', 2, 64)+"%"
+				}
+				continue
+			}
+			line[value] = v[key]
+		}
+		list[k] = line
+	}
+	return row,list
+}

+ 120 - 0
serves/excelExportGo/api/controller/rejectedController.go

@@ -0,0 +1,120 @@
+package controller
+
+import (
+	"bswas/utilities"
+	"strconv"
+)
+
+func RejectedFormat(data []map[string]string) ([]interface{}, [][]interface{}, map[string]string) {
+	row := []interface{}{
+		"日期","审核号","客户名称","订单号","姓名",
+		"手机","原单单号","退回单号","退回公司","到付费用",
+		"是否入库","商品条码","商品名称",
+	}
+	column := map[string]int{
+		"created_at" : 0,
+		"checked_numbers" : 1,
+		"owner_name" : 2,
+		"order_number" : 3,
+		"sender" : 4,
+		"mobile_sender" : 5,
+		"logistic_number" : 6,
+		"logistic_number_return" : 7,
+		"logistic_name" : 8,
+		"fee_collected" : 9,
+		"is_loaded" : 10,
+		"item_barcode" : 11,
+		"item_name" : 12,
+	}
+	dataLength := len(data)
+	if  dataLength > 0 && data[0]["id_owner"] == "94"{
+		row = append(row, "寄件方省","重量")
+		column["common_01"] = 13
+		column["common_02"] = 14
+	}
+	thisRowLength := len(row)
+	column["item_amount"] = thisRowLength
+	column["quality_label_name"] = thisRowLength+1
+	column["item_batch_number"] = thisRowLength+2
+	column["item_made_at"] = thisRowLength+3
+	column["item_validity_at"] = thisRowLength+4
+	column["item_remark"] = thisRowLength+5
+	column["remark"] = thisRowLength+6
+	column["operator_name"] = thisRowLength+7
+	row = append(row ,"数量","是否正品", "批次号","生产日期","效期","备注","退单备注","录入人")
+	list := make([][]interface{},len(data))
+	mergeRow := make(map[string]string)
+	var columnName string
+	var startIndex int
+	rowAmount := 0
+	for k,v := range data{
+		if columnName == v["id"] {
+			rowAmount++
+		}else{
+			if rowAmount != 0 {
+				mergeRow[strconv.Itoa(startIndex+2)] = strconv.Itoa(startIndex+2+rowAmount)
+			}
+			columnName = v["id"]
+			startIndex = k
+			rowAmount = 0
+		}
+		if rowAmount != 0 {
+			mergeRow[strconv.Itoa(startIndex+2)] = strconv.Itoa(startIndex+2+rowAmount)
+		}
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			if key == "created_at"{
+				line[value] = utilities.DateFormat(v[key])
+				continue
+			}
+			val := v[key]
+			if key == "is_loaded" {
+				switch v[key] {
+				case "":
+					val = "无需入库"
+				case "0":
+					val = "否"
+				case "1":
+					val = "是"
+				case "2":
+					val = "待推单"
+				case "3":
+					val = "上传异常"
+				}
+			}
+			line[value] = val
+		}
+		list[k] = line
+	}
+
+	return row,list,mergeRow
+}
+
+func RejectedStatisticsFormat(data []map[string]string) ([]interface{}, [][]interface{}){
+	row := []interface{}{
+		"货主名","退件单数","审核单数","未审核单数","入库单数","未入库单数",
+	}
+	column := map[string]int{
+		"owner_name" : 0,
+		"bounce_amount" : 1,
+		"check_amount" : 2,
+		"uncheck_amount" : 3,
+		"in_storage_count" : 4,
+		"not_in_storage_count" : 5,
+	}
+	list := make([][]interface{},len(data))
+	for k,v := range data{
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			if key == "uncheck_amount" {
+				bounce,_ := strconv.Atoi(v["bounce_amount"])
+				check,_ := strconv.Atoi(v["check_amount"])
+				line[value] = strconv.Itoa(bounce - check)
+			}else{
+				line[value] = v[key]
+			}
+		}
+		list[k] = line
+	}
+	return row, list
+}

+ 170 - 0
serves/excelExportGo/api/controller/waybillController.go

@@ -0,0 +1,170 @@
+package controller
+
+import (
+	"bswas/utilities"
+	"encoding/json"
+)
+
+func WaybillFormat(data []map[string]string) ([]interface{}, [][]interface{}) {
+	row := []interface{}{
+		"运单类型", "货主", "上游单号", "wms订单号", "运单号", "运输收费",
+		"其他收费", "其他收费备注", "始发地", "目的地", "承运商", "承运商单号",
+		"仓库计抛", "承运商计抛", "仓库计重", "承运商计重", "车型", "车辆信息",
+		"计件", "里程数", "运费(元)", "提货费(元)", "其他费用(元)", "发货时间",
+		"调度备注", "创建时间",
+	}
+	column := map[string]int{
+		"type" : 0,
+		"owner_name" : 1,
+		"source_bill" : 2,
+		"wms_bill_number" : 3,
+		"waybill_number" : 4,
+		"charge" : 5,
+		"other_charge" : 6,
+		"other_charge_remark" : 7,
+		"origination" : 8,
+		"destination" : 9,
+		"carrier_name" : 10,
+		"carrier_bill" : 11,
+		"warehouse_weight" : 12,
+		"carrier_weight" : 13,
+		"warehouse_weight_other" : 14,
+		"carrier_weight_other" : 15,
+		"car_type_name" : 16,
+		"car_owner_info" : 17,
+		"amount" : 18,
+		"mileage" : 19,
+		"fee" : 20,
+		"pick_up_fee" : 21,
+		"other_fee" : 22,
+		"deliver_at" : 23,
+		"dispatch_remark" : 24,
+		"created_at" : 25,
+	}
+	list := make([][]interface{},len(data))
+	for k,v := range data{
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			if key == "created_at" {
+				line[value] = utilities.DateFormat(v[key])
+				continue
+			}
+			line[value] = v[key]
+		}
+		list[k] = line
+	}
+	return row,list
+}
+
+func WaybillDeliveringFormat(data []map[string]string) ([]interface{}, [][]interface{}) {
+	row := []interface{}{
+		"日期", "承运商", "宝时运单号", "提货仓", "货主", "预估重量",
+		"预估体积", "状态", "专线运单号", "查件电话", "件数", "重量",
+		"体积",
+	}
+	column := map[string]int{
+		"created_at" : 0,
+		"carrier_name" : 1,
+		"waybill_number" : 2,
+		"origination" : 3,
+		"owner_name" : 4,
+		"warehouse_weight_other" : 5,
+		"warehouse_weight" : 6,
+		"status" : 7,
+		"carrier_bill" : 8,
+		"inquire_tel" : 9,
+		"amount" : 10,
+		"carrier_weight_other" : 11,
+		"carrier_weight" : 12,
+	}
+	list := make([][]interface{},len(data))
+	for k,v := range data{
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			if key == "status" {
+				if v[key] == "已完结" {
+					line[value] = "已完成"
+				}else{
+					if v["carrier_bill"] != "" {
+						line[value] = "已提交"
+					}else{
+						line[value] = "待提交"
+					}
+				}
+				continue
+			}
+			if key == "created_at" {
+				line[value] = utilities.DateFormat(v[key])
+				continue
+			}
+			line[value] = v[key]
+		}
+		list[k] = line
+	}
+	return row,list
+}
+func WaybillFinancialFormat(data []map[string]string) ([]interface{}, [][]interface{}) {
+	row := []interface{}{
+		"运单类型", "运单号", "货主", "WMS单号", "始发地", "目的地", "收件人", "收件人电话",
+		"收费(元)", "下单备注", "承运商", "承运商单号", "始发市", "目的市", "仓库计数(抛)", "仓库计数二",
+		"承运商计数(抛)", "承运商计数二", "车型", "车辆信息","运费(元)", "提货费(元)", "其他费用(元)", "到付金额(元)",
+		"调度备注", "终审人员", "运单创建时间", "应收款(元)", "应付款(元)", "毛利(元)",
+		"毛利率(元)", "报表生成时间",
+	}
+	column := map[string]int{
+		"type" : 0,
+		"waybill_number" : 1,
+		"owner_name" : 2,
+		"wms_bill_number" : 3,
+		"origination" : 4,
+		"destination" : 5,
+		"recipient" : 6,
+		"recipient_mobile" : 7,
+		"charge" : 8,
+		"ordering_remark" : 9,
+		"carrier" : 10,
+		"carrier_bill" : 11,
+		"origination_city" : 12,
+		"destination_city" : 13,
+		"warehouse_weight" : 14,
+		"warehouse_weight_other" : 15,
+		"carrier_weight" : 16,
+		"carrier_weight_other" : 17,
+		"car_type_name" : 18,
+		"car_owner_info" : 19,
+		"fee" : 20,
+		"pick_up_fee" : 21,
+		"other_fee" : 22,
+		"collect_fee" : 23,
+		"dispatch_remark" : 24,
+		"auditLog_user_name" : 25,
+		"created_at" : 26,
+		"total_receivable" : 27,
+		"total_expense" : 28,
+		"gross_margin" : 29,
+		"gross_profit_rate" : 30,
+		"snapshotCreated_at" : 31,
+	}
+	list := make([][]interface{},len(data))
+	for k,v := range data{
+		m := make(map[string]string)
+		err := json.Unmarshal([]byte(v["json_content"]),&m)
+		if err != nil {
+			utilities.WriteLog("/api/controller/waybillController.go:145  运单财务记录内字段json解析失败!","ERROR")
+		}
+		line := make([]interface{},len(row))
+		for key,value := range column {
+			if key == "snapshotCreated_at" {
+				line[value] = utilities.DateFormat(v["created_at"])
+				continue
+			}
+			if key == "created_at"{
+				line[value] = utilities.DateFormat(m[key])
+				continue
+			}
+			line[value] = m[key]
+		}
+		list[k] = line
+	}
+	return row,list
+}

+ 41 - 0
serves/excelExportGo/excel/export.go

@@ -0,0 +1,41 @@
+package excel
+
+import (
+	"bswas/utilities"
+	"github.com/360EntSecGroup-Skylar/excelize/v2"
+)
+
+const SHEET  = "Sheet1"
+
+func CreateFile(row []interface{},list [][]interface{}, mergeRow map[string]string, mergeColumn []string) (excel *excelize.File) {
+	file := excelize.NewFile()
+	streamWriter, err := file.NewStreamWriter(SHEET)
+	if err != nil {
+		utilities.WriteLog("/excel/export.go:14   文件生成失败!","ERROR")
+	}
+	cell, _ := excelize.CoordinatesToCellName(1, 1)
+	if err := streamWriter.SetRow(cell, row); err != nil {
+		utilities.WriteLog("/excel/export.go:18  写入表头失败!","ERROR")
+	}
+	for index := 0; index < len(list); index++ {
+		cell, _ := excelize.CoordinatesToCellName(1, index+2)
+		if err := streamWriter.SetRow(cell, list[index]); err != nil {
+			utilities.WriteLog("/excel/export.go:23  数据写入文件失败!","ERROR")
+		}
+	}
+	if mergeRow != nil && mergeColumn != nil {
+		for start,end := range mergeRow {
+			for i := 0;i<len(mergeColumn); i++ {
+				err := file.MergeCell(SHEET,mergeColumn[i]+start,mergeColumn[i]+end)
+				if err != nil {
+					utilities.WriteLog("/excel/export.go:31  合并单元格失败!","ERROR")
+					return
+				}
+			}
+		}
+	}
+	if err := streamWriter.Flush(); err != nil {
+		utilities.WriteLog("/excel/export.go:38  文件流关闭失败!","ERROR")
+	}
+	return file
+}

+ 9 - 0
serves/excelExportGo/go.mod

@@ -0,0 +1,9 @@
+module bswas
+
+go 1.13
+
+require (
+	github.com/360EntSecGroup-Skylar/excelize/v2 v2.3.0
+	github.com/go-sql-driver/mysql v1.5.0
+	github.com/godror/godror v0.19.4
+)

+ 52 - 0
serves/excelExportGo/go.sum

@@ -0,0 +1,52 @@
+github.com/360EntSecGroup-Skylar/excelize/v2 v2.3.0 h1:tDWYNCJrpNnlNg8mVdlzAzPjlPaRbsA/kS8H9LczleQ=
+github.com/360EntSecGroup-Skylar/excelize/v2 v2.3.0/go.mod h1:Uwb0d1GgxJieUWZG5WylTrgQ2SrldfjagAxheU8W6MQ=
+github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw=
+github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4=
+github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
+github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
+github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/godror/godror v0.19.4 h1:uuv6MBcZ0X57Axaz1yiESCqQmEqJgNr7OB13rOhEmOs=
+github.com/godror/godror v0.19.4/go.mod h1:5fX2oe9jOfgNmzAUYWJ5TAQOpMgrme9622vmmjm7lb4=
+github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
+github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
+github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
+github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
+github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
+github.com/xuri/efp v0.0.0-20191019043341-b7dc4fe9aa91 h1:gp02YctZuIPTk0t7qI+wvg3VQwTPyNmSGG6ZqOsjSL8=
+github.com/xuri/efp v0.0.0-20191019043341-b7dc4fe9aa91/go.mod h1:uBiSUepVYMhGTfDeBKKasV4GpgBlzJ46gXUBAqV8qLk=
+golang.org/dl v0.0.0-20200724191219-e4fbcf8a7a81/go.mod h1:IUMfjQLJQd4UTqG1Z90tenwKoCX93Gn3MAQJMOSBsDQ=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/image v0.0.0-20200430140353-33d19683fad8 h1:6WW6V3x1P/jokJBpRQYUJnMHRP6isStQwCozxnU7XQw=
+golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
+golang.org/x/net v0.0.0-20200506145744-7e3656a0809f h1:QBjCr1Fz5kw158VqdE9JfI9cJnl/ymnJWAdMuinqL7Y=
+golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
+golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
+golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
+gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
+gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

+ 9 - 0
serves/excelExportGo/logs/2020-09-09.log

@@ -0,0 +1,9 @@
+
+[ERROR]   11:12:55
+   /api/controller/controller.go:17   参数解析失败!
+[ERROR]   11:12:56
+   /api/controller/controller.go:17   参数解析失败!
+[ERROR]   11:13:49
+   /api/controller/controller.go:17   参数解析失败!
+[ERROR]   11:13:49
+   /api/controller/controller.go:17   参数解析失败!

+ 37 - 0
serves/excelExportGo/logs/2020-09-10.log

@@ -0,0 +1,37 @@
+
+[ERROR]   09:29:38
+   /api/controller/controller.go:174   库存盘点数据json解析失败!
+[ERROR]   09:34:44
+   /api/controller/controller.go:174   库存盘点数据json解析失败!
+[ERROR]   09:36:14
+   /api/controller/controller.go:174   库存盘点数据json解析失败!
+[ERROR]   09:42:33
+   /api/controller/controller.go:174   库存盘点数据json解析失败!
+[ERROR]   09:47:43
+   /api/controller/controller.go:178   库存盘点数据json解析失败!
+[ERROR]   09:48:19
+   /api/controller/controller.go:178   库存盘点数据json解析失败!
+[ERROR]   10:23:27
+   /api/controller/controller.go:178   库存盘点数据json解析失败!
+[ERROR]   10:24:52
+   /api/controller/controller.go:178   库存盘点数据json解析失败!
+[ERROR]   10:29:22
+   /api/controller/controller.go:178   库存盘点数据json解析失败!
+[ERROR]   10:31:32
+   /api/controller/controller.go:178   库存盘点数据json解析失败!
+[ERROR]   10:33:15
+   /api/controller/controller.go:178   库存盘点数据json解析失败!
+[ERROR]   10:44:56
+   /api/controller/controller.go:178   库存盘点数据json解析失败!
+[ERROR]   10:46:42
+   /api/controller/controller.go:178   库存盘点数据json解析失败!
+[ERROR]   11:01:44
+   /api/controller/controller.go:178   库存盘点数据json解析失败!
+[ERROR]   11:06:02
+   /api/controller/controller.go:178   库存盘点数据json解析失败!
+[ERROR]   13:37:16
+   /orm/query.go:11   SQL执行错误!(select inventory_compares.mission_code,inventory_compares.custom_location,inventory_compares.quality,inventory_compares.amount_in_sys,inventory_compares.amount_in_compare,inventory_compares.differ,inventory_compares.created_at, owners.name owner_name, commodities.name commodity_name,commodities.sku commodity_sku, commodity_barcodes.code commodity_barcode_code from `inventory_compares` left join `owners` on `inventory_compares`.`owner_id` = `owners`.`id` left join `commodities` on `inventory_compares`.`commodity_id` = `commodities`.`id` left join `commodity_barcodes` on `commodity_barcodes`.`commodity_id` = `commodities`.`id` order by `id` desc)
+[ERROR]   13:44:31
+   /orm/query.go:11   SQL执行错误!(select inventory_compares.*, owners.name owner_name, commodities.name commodity_name,commodities.sku commodity_sku, commodity_barcodes.code commodity_barcode_code from `inventory_compares` left join `owners` on `inventory_compares`.`owner_id` = `owners`.`id` left join `commodities` on `inventory_compares`.`commodity_id` = `commodities`.`id` left join `commodity_barcodes` on `commodity_barcodes`.`commodity_id` = `commodities`.`id` where `id` = '530,529' order by `id` desc)
+[ERROR]   13:52:09
+   /orm/query.go:11   SQL执行错误!(select inventory_compares.*, owners.name owner_name, commodities.name commodity_name,commodities.sku commodity_sku, commodity_barcodes.code commodity_barcode_code from `inventory_compares` left join `owners` on `inventory_compares`.`owner_id` = `owners`.`id` left join `commodities` on `inventory_compares`.`commodity_id` = `commodities`.`id` left join `commodity_barcodes` on `commodity_barcodes`.`commodity_id` = `commodities`.`id` where `id` in ('680', '679') order by `id` desc)

TEMPAT SAMPAH
serves/excelExportGo/main.exe


+ 14 - 0
serves/excelExportGo/main.go

@@ -0,0 +1,14 @@
+package main
+
+import (
+	"bswas/api/controller"
+	"net/http"
+)
+
+func main() {
+	http.HandleFunc("/", controller.Export)
+	err := http.ListenAndServe("127.0.0.1:8090", nil)
+	if err != nil {
+		panic("端口号已被占用!")
+	}
+}

+ 59 - 0
serves/excelExportGo/orm/query.go

@@ -0,0 +1,59 @@
+package orm
+
+import (
+	"bswas/utilities"
+	"database/sql"
+)
+
+func query(sqlStr string,db *sql.DB)(list []map[string]string) {
+	rows,err := db.Query(sqlStr)
+	if err != nil {
+		utilities.WriteLog("/orm/query.go:11   SQL执行错误!("+sqlStr+")","ERROR")
+		return
+	}
+	//字段名称
+	columns, _ := rows.Columns()
+	//多少个字段
+	length := len(columns)
+	//每一行字段的值
+	values := make([]sql.RawBytes, length)
+	//保存的是values的内存地址
+	pointer := make([]interface{}, length)
+	//
+	for i := 0; i < length; i++ {
+		pointer[i] = &values[i]
+	}
+	//
+	for rows.Next() {
+		//把参数展开,把每一行的值存到指定的内存地址去,循环覆盖,values也就跟着被赋值了
+		err := rows.Scan(pointer...)
+		if err != nil {
+			utilities.WriteLog("/orm/query.go:31   结果集转换错误!("+sqlStr+")","ERROR")
+			return
+		}
+		//每一行
+		row := make(map[string]string)
+		for i := 0; i < length; i++ {
+			row[columns[i]] = string(values[i])
+		}
+		list = append(list, row)
+	}
+	_ = rows.Close()
+	return
+}
+func GetMysqlData(sqlStr string)(list []map[string]string) {
+	db, err := utilities.Mysql()
+	if err != nil {
+		utilities.WriteLog("/orm/query.go:47   Mysql数据库连接错误!","ERROR")
+		return
+	}
+	return query(sqlStr, db)
+}
+func GetOracleData(sqlStr string)(list []map[string]string) {
+	db, err := utilities.Oracle()
+	if err != nil {
+		utilities.WriteLog("/orm/query.go:55   Oracle数据库连接错误!","ERROR")
+		return
+	}
+	return query(sqlStr, db)
+}

+ 70 - 0
serves/excelExportGo/utilities/connect.go

@@ -0,0 +1,70 @@
+package utilities
+
+import (
+	"database/sql"
+	_ "github.com/go-sql-driver/mysql"
+	_ "github.com/godror/godror"
+)
+
+var db *sql.DB
+type connect struct {
+	HOST string
+	PORT string
+	DATABASE string
+	USERNAME string
+	PASSWORD string
+	CHARSET string
+	PARSETIME string
+	SID string
+}
+
+func Mysql()(baseDB *sql.DB, err error)  {
+	//mysql := connect{
+	//	HOST:     "was.baoshi56.com",
+	//	PORT:     "3306",
+	//	DATABASE: "bswas",
+	//	USERNAME: "developer",
+	//	PASSWORD: "developer",
+	//	CHARSET: "utf8mb4",
+	//	PARSETIME: "True",
+	//}
+	mysql := connect{
+		HOST:     "localhost",
+		PORT:     "3307",
+		DATABASE: "bswas_test",
+		USERNAME: "root",
+		PASSWORD: "",
+		CHARSET: "utf8mb4",
+		PARSETIME: "True",
+	}
+	driver := mysql.USERNAME+":"+mysql.PASSWORD+"@"+"tcp("+mysql.HOST+":"+mysql.PORT+")/"+mysql.DATABASE+"?charset="+mysql.CHARSET
+	if mysql.PARSETIME != "" {
+		driver += "&parseTime="+mysql.PARSETIME
+	}
+	db, err = sql.Open("mysql",driver)
+	if err != nil {
+		WriteLog("/utilities/connect.go:37   Mysql数据库连接错误!","ERROR")
+		return
+	}
+	db.SetMaxOpenConns(20)
+	db.SetMaxIdleConns(10)
+	return db,nil
+}
+
+func Oracle()(baseDB *sql.DB, err error){
+	oracle := connect{
+		HOST:      "47.103.12.61",
+		PORT:      "1521",
+		USERNAME:  "WMS_USER",
+		PASSWORD:  "WMS_USER",
+		SID: 	   "orcl",
+	}
+	db, err := sql.Open("godror",`user="`+oracle.USERNAME+`" password="`+oracle.PASSWORD+`" connectString="`+oracle.HOST+`:`+oracle.PORT+`/`+oracle.SID+`"`)
+	if err != nil {
+		WriteLog("/utilities/connect.go:55   Oracle数据库连接错误!","ERROR")
+		return
+	}
+	db.SetMaxOpenConns(20)
+	db.SetMaxIdleConns(10)
+	return db,nil
+}

+ 11 - 0
serves/excelExportGo/utilities/format.go

@@ -0,0 +1,11 @@
+package utilities
+
+import (
+	"time"
+)
+
+func DateFormat(date string)string{
+	var LOC, _ = time.LoadLocation("Asia/Shanghai")
+	dateUTC,_ := time.ParseInLocation("2006-01-02T15:04:05Z",date,LOC)
+	return  dateUTC.Local().Format("2006-01-02 15:04:05")
+}

+ 61 - 0
serves/excelExportGo/utilities/log.go

@@ -0,0 +1,61 @@
+package utilities
+
+import (
+	"os"
+	"time"
+)
+type Error struct{
+	msg string
+}
+
+var err *Error
+
+func NewError()*Error{
+	err = &Error{}
+	return err
+}
+
+func (e *Error)GetMsg()string{
+	return e.msg
+}
+
+func todayFilename()string{
+	today := time.Now().Format("2006-01-02")
+	return today + ".log"
+}
+// 创建打开文件
+func getLogFile(content string){
+	path, _ := os.Getwd()
+	logsPath := path+"/logs"
+	if !isExist(logsPath) {
+		err := os.Mkdir(logsPath,os.ModePerm)
+		if err != nil {
+			panic(err)
+		}
+	}
+	filename := logsPath+"/"+todayFilename()
+	log,err := os.OpenFile(filename, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
+	defer log.Close()
+	if err != nil {
+		panic(err)
+	}
+	str := []byte(content)
+	// 写入文件
+	n, err := log.Write(str)
+	if err == nil && n != len(str) {
+		println(`错误代码:`, n)
+		panic(err)
+	}
+}
+
+func WriteLog(content string, grade string ){
+	grade = "["+grade+"]"
+	createTime := time.Now().Format("15:04:05")
+	getLogFile("\n"+grade+"   "+createTime+"\n"+"   "+content)
+	err.msg = content
+}
+
+func isExist(f string) bool {
+	_, err := os.Stat(f)
+	return err == nil || os.IsExist(err)
+}

+ 5 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/.gitignore

@@ -0,0 +1,5 @@
+~$*.xlsx
+test/Test*.xlsx
+*.out
+*.test
+.idea

+ 26 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/.travis.yml

@@ -0,0 +1,26 @@
+language: go
+
+install:
+  - go get -d -t -v ./... && go build -v ./...
+
+go:
+  - 1.11.x
+  - 1.12.x
+  - 1.13.x
+  - 1.14.x
+
+os:
+  - linux
+  - osx
+
+env:
+  jobs:
+    - GOARCH=amd64
+    - GOARCH=386
+
+script:
+  - env GO111MODULE=on go vet ./...
+  - env GO111MODULE=on go test ./... -v -coverprofile=coverage.txt -covermode=atomic
+
+after_success:
+  - bash <(curl -s https://codecov.io/bash)

+ 46 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/CODE_OF_CONDUCT.md

@@ -0,0 +1,46 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [xuri.me](https://xuri.me). The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct][version]
+
+[homepage]: https://www.contributor-covenant.org
+[version]: https://www.contributor-covenant.org/version/2/0/code_of_conduct

+ 465 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/CONTRIBUTING.md

@@ -0,0 +1,465 @@
+# Contributing to excelize
+
+Want to hack on excelize? Awesome! This page contains information about reporting issues as well as some tips and
+guidelines useful to experienced open source contributors. Finally, make sure
+you read our [community guidelines](#community-guidelines) before you
+start participating.
+
+## Topics
+
+* [Reporting Security Issues](#reporting-security-issues)
+* [Design and Cleanup Proposals](#design-and-cleanup-proposals)
+* [Reporting Issues](#reporting-other-issues)
+* [Quick Contribution Tips and Guidelines](#quick-contribution-tips-and-guidelines)
+* [Community Guidelines](#community-guidelines)
+
+## Reporting security issues
+
+The excelize maintainers take security seriously. If you discover a security
+issue, please bring it to their attention right away!
+
+Please **DO NOT** file a public issue, instead send your report privately to
+[xuri.me](https://xuri.me).
+
+Security reports are greatly appreciated and we will publicly thank you for it.
+We currently do not offer a paid security bounty program, but are not
+ruling it out in the future.
+
+## Reporting other issues
+
+A great way to contribute to the project is to send a detailed report when you
+encounter an issue. We always appreciate a well-written, thorough bug report,
+and will thank you for it!
+
+Check that [our issue database](https://github.com/360EntSecGroup-Skylar/excelize/issues)
+doesn't already include that problem or suggestion before submitting an issue.
+If you find a match, you can use the "subscribe" button to get notified on
+updates. Do *not* leave random "+1" or "I have this too" comments, as they
+only clutter the discussion, and don't help resolving it. However, if you
+have ways to reproduce the issue or have additional information that may help
+resolving the issue, please leave a comment.
+
+When reporting issues, always include the output of `go env`.
+
+Also include the steps required to reproduce the problem if possible and
+applicable. This information will help us review and fix your issue faster.
+When sending lengthy log-files, consider posting them as a gist [https://gist.github.com](https://gist.github.com).
+Don't forget to remove sensitive data from your logfiles before posting (you can
+replace those parts with "REDACTED").
+
+## Quick contribution tips and guidelines
+
+This section gives the experienced contributor some tips and guidelines.
+
+### Pull requests are always welcome
+
+Not sure if that typo is worth a pull request? Found a bug and know how to fix
+it? Do it! We will appreciate it. Any significant improvement should be
+documented as [a GitHub issue](https://github.com/360EntSecGroup-Skylar/excelize/issues) before
+anybody starts working on it.
+
+We are always thrilled to receive pull requests. We do our best to process them
+quickly. If your pull request is not accepted on the first try,
+don't get discouraged!
+
+### Design and cleanup proposals
+
+You can propose new designs for existing excelize features. You can also design
+entirely new features. We really appreciate contributors who want to refactor or
+otherwise cleanup our project.
+
+We try hard to keep excelize lean and focused. Excelize can't do everything for
+everybody. This means that we might decide against incorporating a new feature.
+However, there might be a way to implement that feature *on top of* excelize.
+
+### Conventions
+
+Fork the repository and make changes on your fork in a feature branch:
+
+* If it's a bug fix branch, name it XXXX-something where XXXX is the number of
+    the issue.
+* If it's a feature branch, create an enhancement issue to announce
+    your intentions, and name it XXXX-something where XXXX is the number of the
+    issue.
+
+Submit unit tests for your changes. Go has a great test framework built in; use
+it! Take a look at existing tests for inspiration. Run the full test on your branch before
+submitting a pull request.
+
+Update the documentation when creating or modifying features. Test your
+documentation changes for clarity, concision, and correctness, as well as a
+clean documentation build.
+
+Write clean code. Universally formatted code promotes ease of writing, reading,
+and maintenance. Always run `gofmt -s -w file.go` on each changed file before
+committing your changes. Most editors have plug-ins that do this automatically.
+
+Pull request descriptions should be as clear as possible and include a reference
+to all the issues that they address.
+
+### Successful Changes
+
+Before contributing large or high impact changes, make the effort to coordinate
+with the maintainers of the project before submitting a pull request. This
+prevents you from doing extra work that may or may not be merged.
+
+Large PRs that are just submitted without any prior communication are unlikely
+to be successful.
+
+While pull requests are the methodology for submitting changes to code, changes
+are much more likely to be accepted if they are accompanied by additional
+engineering work. While we don't define this explicitly, most of these goals
+are accomplished through communication of the design goals and subsequent
+solutions. Often times, it helps to first state the problem before presenting
+solutions.
+
+Typically, the best methods of accomplishing this are to submit an issue,
+stating the problem. This issue can include a problem statement and a
+checklist with requirements. If solutions are proposed, alternatives should be
+listed and eliminated. Even if the criteria for elimination of a solution is
+frivolous, say so.
+
+Larger changes typically work best with design documents. These are focused on
+providing context to the design at the time the feature was conceived and can
+inform future documentation contributions.
+
+### Commit Messages
+
+Commit messages must start with a capitalized and short summary
+written in the imperative, followed by an optional, more detailed explanatory
+text which is separated from the summary by an empty line.
+
+Commit messages should follow best practices, including explaining the context
+of the problem and how it was solved, including in caveats or follow up changes
+required. They should tell the story of the change and provide readers
+understanding of what led to it.
+
+In practice, the best approach to maintaining a nice commit message is to
+leverage a `git add -p` and `git commit --amend` to formulate a solid
+changeset. This allows one to piece together a change, as information becomes
+available.
+
+If you squash a series of commits, don't just submit that. Re-write the commit
+message, as if the series of commits was a single stroke of brilliance.
+
+That said, there is no requirement to have a single commit for a PR, as long as
+each commit tells the story. For example, if there is a feature that requires a
+package, it might make sense to have the package in a separate commit then have
+a subsequent commit that uses it.
+
+Remember, you're telling part of the story with the commit message. Don't make
+your chapter weird.
+
+### Review
+
+Code review comments may be added to your pull request. Discuss, then make the
+suggested modifications and push additional commits to your feature branch. Post
+a comment after pushing. New commits show up in the pull request automatically,
+but the reviewers are notified only when you comment.
+
+Pull requests must be cleanly rebased on top of master without multiple branches
+mixed into the PR.
+
+**Git tip**: If your PR no longer merges cleanly, use `rebase master` in your
+feature branch to update your pull request rather than `merge master`.
+
+Before you make a pull request, squash your commits into logical units of work
+using `git rebase -i` and `git push -f`. A logical unit of work is a consistent
+set of patches that should be reviewed together: for example, upgrading the
+version of a vendored dependency and taking advantage of its now available new
+feature constitute two separate units of work. Implementing a new function and
+calling it in another file constitute a single logical unit of work. The very
+high majority of submissions should have a single commit, so if in doubt: squash
+down to one.
+
+After every commit, make sure the test passes. Include documentation
+changes in the same pull request so that a revert would remove all traces of
+the feature or fix.
+
+Include an issue reference like `Closes #XXXX` or `Fixes #XXXX` in commits that
+close an issue. Including references automatically closes the issue on a merge.
+
+Please see the [Coding Style](#coding-style) for further guidelines.
+
+### Merge approval
+
+The excelize maintainers use LGTM (Looks Good To Me) in comments on the code review to
+indicate acceptance.
+
+### Sign your work
+
+The sign-off is a simple line at the end of the explanation for the patch. Your
+signature certifies that you wrote the patch or otherwise have the right to pass
+it on as an open-source patch. The rules are pretty simple: if you can certify
+the below (from [developercertificate.org](http://developercertificate.org/)):
+
+```text
+Developer Certificate of Origin
+Version 1.1
+
+Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
+1 Letterman Drive
+Suite D4700
+San Francisco, CA, 94129
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+(a) The contribution was created in whole or in part by me and I
+    have the right to submit it under the open source license
+    indicated in the file; or
+
+(b) The contribution is based upon previous work that, to the best
+    of my knowledge, is covered under an appropriate open source
+    license and I have the right under that license to submit that
+    work with modifications, whether created in whole or in part
+    by me, under the same open source license (unless I am
+    permitted to submit under a different license), as indicated
+    in the file; or
+
+(c) The contribution was provided directly to me by some other
+    person who certified (a), (b) or (c) and I have not modified
+    it.
+
+(d) I understand and agree that this project and the contribution
+    are public and that a record of the contribution (including all
+    personal information I submit with it, including my sign-off) is
+    maintained indefinitely and may be redistributed consistent with
+    this project or the open source license(s) involved.
+```
+
+Then you just add a line to every git commit message:
+
+```text
+Signed-off-by: Ri Xu https://xuri.me
+```
+
+Use your real name (sorry, no pseudonyms or anonymous contributions.)
+
+If you set your `user.name` and `user.email` git configs, you can sign your
+commit automatically with `git commit -s`.
+
+### How can I become a maintainer
+
+First, all maintainers have 3 things
+
+* They share responsibility in the project's success.
+* They have made a long-term, recurring time investment to improve the project.
+* They spend that time doing whatever needs to be done, not necessarily what
+ is the most interesting or fun.
+
+Maintainers are often under-appreciated, because their work is harder to appreciate.
+It's easy to appreciate a really cool and technically advanced feature. It's harder
+to appreciate the absence of bugs, the slow but steady improvement in stability,
+or the reliability of a release process. But those things distinguish a good
+project from a great one.
+
+Don't forget: being a maintainer is a time investment. Make sure you
+will have time to make yourself available. You don't have to be a
+maintainer to make a difference on the project!
+
+If you want to become a meintainer, contact [xuri.me](https://xuri.me) and given a introduction of you.
+
+## Community guidelines
+
+We want to keep the community awesome, growing and collaborative. We need
+your help to keep it that way. To help with this we've come up with some general
+guidelines for the community as a whole:
+
+* Be nice: Be courteous, respectful and polite to fellow community members:
+  no regional, racial, gender, or other abuse will be tolerated. We like
+  nice people way better than mean ones!
+
+* Encourage diversity and participation: Make everyone in our community feel
+  welcome, regardless of their background and the extent of their
+  contributions, and do everything possible to encourage participation in
+  our community.
+
+* Keep it legal: Basically, don't get us in trouble. Share only content that
+  you own, do not share private or sensitive information, and don't break
+  the law.
+
+* Stay on topic: Make sure that you are posting to the correct channel and
+  avoid off-topic discussions. Remember when you update an issue or respond
+  to an email you are potentially sending to a large number of people. Please
+  consider this before you update. Also remember that nobody likes spam.
+
+* Don't send email to the maintainers: There's no need to send email to the
+  maintainers to ask them to investigate an issue or to take a look at a
+  pull request. Instead of sending an email, GitHub mentions should be
+  used to ping maintainers to review a pull request, a proposal or an
+  issue.
+
+### Guideline violations — 3 strikes method
+
+The point of this section is not to find opportunities to punish people, but we
+do need a fair way to deal with people who are making our community suck.
+
+1. First occurrence: We'll give you a friendly, but public reminder that the
+   behavior is inappropriate according to our guidelines.
+
+2. Second occurrence: We will send you a private message with a warning that
+   any additional violations will result in removal from the community.
+
+3. Third occurrence: Depending on the violation, we may need to delete or ban
+   your account.
+
+**Notes:**
+
+* Obvious spammers are banned on first occurrence. If we don't do this, we'll
+  have spam all over the place.
+
+* Violations are forgiven after 6 months of good behavior, and we won't hold a
+  grudge.
+
+* People who commit minor infractions will get some education, rather than
+  hammering them in the 3 strikes process.
+
+* The rules apply equally to everyone in the community, no matter how much
+    you've contributed.
+
+* Extreme violations of a threatening, abusive, destructive or illegal nature
+    will be addressed immediately and are not subject to 3 strikes or forgiveness.
+
+* Contact [xuri.me](https://xuri.me) to report abuse or appeal violations. In the case of
+    appeals, we know that mistakes happen, and we'll work with you to come up with a
+    fair solution if there has been a misunderstanding.
+
+## Coding Style
+
+Unless explicitly stated, we follow all coding guidelines from the Go
+community. While some of these standards may seem arbitrary, they somehow seem
+to result in a solid, consistent codebase.
+
+It is possible that the code base does not currently comply with these
+guidelines. We are not looking for a massive PR that fixes this, since that
+goes against the spirit of the guidelines. All new contributions should make a
+best effort to clean up and make the code base better than they left it.
+Obviously, apply your best judgement. Remember, the goal here is to make the
+code base easier for humans to navigate and understand. Always keep that in
+mind when nudging others to comply.
+
+The rules:
+
+1. All code should be formatted with `gofmt -s`.
+2. All code should pass the default levels of
+   [`golint`](https://github.com/golang/lint).
+3. All code should follow the guidelines covered in [Effective
+   Go](http://golang.org/doc/effective_go.html) and [Go Code Review
+   Comments](https://github.com/golang/go/wiki/CodeReviewComments).
+4. Comment the code. Tell us the why, the history and the context.
+5. Document _all_ declarations and methods, even private ones. Declare
+   expectations, caveats and anything else that may be important. If a type
+   gets exported, having the comments already there will ensure it's ready.
+6. Variable name length should be proportional to its context and no longer.
+   `noCommaALongVariableNameLikeThisIsNotMoreClearWhenASimpleCommentWouldDo`.
+   In practice, short methods will have short variable names and globals will
+   have longer names.
+7. No underscores in package names. If you need a compound name, step back,
+   and re-examine why you need a compound name. If you still think you need a
+   compound name, lose the underscore.
+8. No utils or helpers packages. If a function is not general enough to
+   warrant its own package, it has not been written generally enough to be a
+   part of a util package. Just leave it unexported and well-documented.
+9. All tests should run with `go test` and outside tooling should not be
+   required. No, we don't need another unit testing framework. Assertion
+   packages are acceptable if they provide _real_ incremental value.
+10. Even though we call these "rules" above, they are actually just
+    guidelines. Since you've read all the rules, you now know that.
+
+If you are having trouble getting into the mood of idiomatic Go, we recommend
+reading through [Effective Go](https://golang.org/doc/effective_go.html). The
+[Go Blog](https://blog.golang.org) is also a great resource. Drinking the
+kool-aid is a lot easier than going thirsty.
+
+## Code Review Comments and Effective Go Guidelines
+
+[CodeLingo](https://codelingo.io) automatically checks every pull request against the following guidelines from [Effective Go](https://golang.org/doc/effective_go.html) and [Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments).
+
+### Package Comment
+
+Every package should have a package comment, a block comment preceding the package clause.
+For multi-file packages, the package comment only needs to be present in one file, and any one will do.
+The package comment should introduce the package and provide information relevant to the package as a
+whole. It will appear first on the godoc page and should set up the detailed documentation that follows.
+
+### Single Method Interface Name
+
+By convention, one-method interfaces are named by the method name plus an -er suffix
+or similar modification to construct an agent noun: Reader, Writer, Formatter, CloseNotifier etc.
+
+There are a number of such names and it's productive to honor them and the function names they capture.
+Read, Write, Close, Flush, String and so on have canonical signatures and meanings. To avoid confusion,
+don't give your method one of those names unless it has the same signature and meaning. Conversely,
+if your type implements a method with the same meaning as a method on a well-known type, give it the
+same name and signature; call your string-converter method String not ToString.
+
+### Avoid Annotations in Comments
+
+Comments do not need extra formatting such as banners of stars. The generated output
+may not even be presented in a fixed-width font, so don't depend on spacing for alignment—godoc,
+like gofmt, takes care of that. The comments are uninterpreted plain text, so HTML and other
+annotations such as _this_ will reproduce verbatim and should not be used. One adjustment godoc
+does do is to display indented text in a fixed-width font, suitable for program snippets.
+The package comment for the fmt package uses this to good effect.
+
+### Comment First Word as Subject
+
+Doc comments work best as complete sentences, which allow a wide variety of automated presentations.
+The first sentence should be a one-sentence summary that starts with the name being declared.
+
+### Good Package Name
+
+It's helpful if everyone using the package can use the same name
+to refer to its contents, which implies that the package name should
+be good: short, concise, evocative. By convention, packages are
+given lower case, single-word names; there should be no need for
+underscores or mixedCaps. Err on the side of brevity, since everyone
+using your package will be typing that name. And don't worry about
+collisions a priori. The package name is only the default name for
+imports; it need not be unique across all source code, and in the
+rare case of a collision the importing package can choose a different
+name to use locally. In any case, confusion is rare because the file
+name in the import determines just which package is being used.
+
+### Avoid Renaming Imports
+
+Avoid renaming imports except to avoid a name collision; good package names
+should not require renaming. In the event of collision, prefer to rename the
+most local or project-specific import.
+
+### Context as First Argument
+
+Values of the context.Context type carry security credentials, tracing information,
+deadlines, and cancellation signals across API and process boundaries. Go programs
+pass Contexts explicitly along the entire function call chain from incoming RPCs
+and HTTP requests to outgoing requests.
+
+Most functions that use a Context should accept it as their first parameter.
+
+### Do Not Discard Errors
+
+Do not discard errors using _ variables. If a function returns an error,
+check it to make sure the function succeeded. Handle the error, return it, or,
+in truly exceptional situations, panic.
+
+### Go Error Format
+
+Error strings should not be capitalized (unless beginning with proper nouns
+or acronyms) or end with punctuation, since they are usually printed following
+other context. That is, use fmt.Errorf("something bad") not fmt.Errorf("Something bad"),
+so that log.Printf("Reading %s: %v", filename, err) formats without a spurious
+capital letter mid-message. This does not apply to logging, which is implicitly
+line-oriented and not combined inside other messages.
+
+### Use Crypto Rand
+
+Do not use package math/rand to generate keys, even
+throwaway ones. Unseeded, the generator is completely predictable.
+Seeded with time.Nanoseconds(), there are just a few bits of entropy.
+Instead, use crypto/rand's Reader, and if you need text, print to
+hexadecimal or base64.

+ 29 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/LICENSE

@@ -0,0 +1,29 @@
+BSD 3-Clause License
+
+Copyright (c) 2016-2020 The excelize Authors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+* Neither the name of the copyright holder nor the names of its
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 45 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/PULL_REQUEST_TEMPLATE.md

@@ -0,0 +1,45 @@
+# PR Details
+
+<!--- Provide a general summary of your changes in the Title above -->
+
+## Description
+
+<!--- Describe your changes in detail -->
+
+## Related Issue
+
+<!--- This project only accepts pull requests related to open issues -->
+<!--- If suggesting a new feature or change, please discuss it in an issue first -->
+<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
+<!--- Please link to the issue here: -->
+
+## Motivation and Context
+
+<!--- Why is this change required? What problem does it solve? -->
+
+## How Has This Been Tested
+
+<!--- Please describe in detail how you tested your changes. -->
+<!--- Include details of your testing environment, and the tests you ran to -->
+<!--- see how your change affects other areas of the code, etc. -->
+
+## Types of changes
+
+<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
+
+- [ ] Docs change / refactoring / dependency upgrade
+- [ ] Bug fix (non-breaking change which fixes an issue)
+- [ ] New feature (non-breaking change which adds functionality)
+- [ ] Breaking change (fix or feature that would cause existing functionality to change)
+
+## Checklist
+
+<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
+<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
+
+- [ ] My code follows the code style of this project.
+- [ ] My change requires a change to the documentation.
+- [ ] I have updated the documentation accordingly.
+- [ ] I have read the **CONTRIBUTING** document.
+- [ ] I have added tests to cover my changes.
+- [ ] All new and existing tests passed.

+ 183 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/README.md

@@ -0,0 +1,183 @@
+<p align="center"><img width="650" src="./excelize.svg" alt="Excelize logo"></p>
+
+<p align="center">
+    <a href="https://travis-ci.org/360EntSecGroup-Skylar/excelize"><img src="https://travis-ci.org/360EntSecGroup-Skylar/excelize.svg?branch=master" alt="Build Status"></a>
+    <a href="https://codecov.io/gh/360EntSecGroup-Skylar/excelize"><img src="https://codecov.io/gh/360EntSecGroup-Skylar/excelize/branch/master/graph/badge.svg" alt="Code Coverage"></a>
+    <a href="https://goreportcard.com/report/github.com/360EntSecGroup-Skylar/excelize"><img src="https://goreportcard.com/badge/github.com/360EntSecGroup-Skylar/excelize" alt="Go Report Card"></a>
+    <a href="https://pkg.go.dev/github.com/360EntSecGroup-Skylar/excelize/v2?tab=doc"><img src="https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white" alt="go.dev"></a>
+    <a href="https://opensource.org/licenses/BSD-3-Clause"><img src="https://img.shields.io/badge/license-bsd-orange.svg" alt="Licenses"></a>
+    <a href="https://www.paypal.me/xuri"><img src="https://img.shields.io/badge/Donate-PayPal-green.svg" alt="Donate"></a>
+</p>
+
+# Excelize
+
+## Introduction
+
+Excelize is a library written in pure Go providing a set of functions that allow you to write to and read from XLSX / XLSM / XLTM files. Supports reading and writing spreadsheet documents generated by Microsoft Excel&trade; 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.10 or later. The full API docs can be seen using go's built-in documentation tool, or online at [go.dev](https://pkg.go.dev/github.com/360EntSecGroup-Skylar/excelize/v2?tab=doc) and [docs reference](https://xuri.me/excelize/).
+
+## Basic Usage
+
+### Installation
+
+```bash
+go get github.com/360EntSecGroup-Skylar/excelize
+```
+
+- If your package management with [Go Modules](https://blog.golang.org/using-go-modules), please install with following command.
+
+```bash
+go get github.com/360EntSecGroup-Skylar/excelize/v2
+```
+
+### Create spreadsheet
+
+Here is a minimal example usage that will create spreadsheet file.
+
+```go
+package main
+
+import (
+    "fmt"
+
+    "github.com/360EntSecGroup-Skylar/excelize"
+)
+
+func main() {
+    f := excelize.NewFile()
+    // Create a new sheet.
+    index := f.NewSheet("Sheet2")
+    // Set value of a cell.
+    f.SetCellValue("Sheet2", "A2", "Hello world.")
+    f.SetCellValue("Sheet1", "B2", 100)
+    // Set active sheet of the workbook.
+    f.SetActiveSheet(index)
+    // Save xlsx file by the given path.
+    if err := f.SaveAs("Book1.xlsx"); err != nil {
+        fmt.Println(err)
+    }
+}
+```
+
+### Reading spreadsheet
+
+The following constitutes the bare to read a spreadsheet document.
+
+```go
+package main
+
+import (
+    "fmt"
+
+    "github.com/360EntSecGroup-Skylar/excelize"
+)
+
+func main() {
+    f, err := excelize.OpenFile("Book1.xlsx")
+    if err != nil {
+        fmt.Println(err)
+        return
+    }
+    // Get value from cell by given worksheet name and axis.
+    cell, err := f.GetCellValue("Sheet1", "B2")
+    if err != nil {
+        fmt.Println(err)
+        return
+    }
+    fmt.Println(cell)
+    // Get all the rows in the Sheet1.
+    rows, err := f.GetRows("Sheet1")
+    for _, row := range rows {
+        for _, colCell := range row {
+            fmt.Print(colCell, "\t")
+        }
+        fmt.Println()
+    }
+}
+```
+
+### Add chart to spreadsheet file
+
+With Excelize chart generation and management is as easy as a few lines of code. You can build charts based off data in your worksheet or generate charts without any data in your worksheet at all.
+
+<p align="center"><img width="650" src="./test/images/chart.png" alt="Excelize"></p>
+
+```go
+package main
+
+import (
+    "fmt"
+
+    "github.com/360EntSecGroup-Skylar/excelize"
+)
+
+func main() {
+    categories := map[string]string{"A2": "Small", "A3": "Normal", "A4": "Large", "B1": "Apple", "C1": "Orange", "D1": "Pear"}
+    values := map[string]int{"B2": 2, "C2": 3, "D2": 3, "B3": 5, "C3": 2, "D3": 4, "B4": 6, "C4": 7, "D4": 8}
+    f := excelize.NewFile()
+    for k, v := range categories {
+        f.SetCellValue("Sheet1", k, v)
+    }
+    for k, v := range values {
+        f.SetCellValue("Sheet1", k, v)
+    }
+    if err := f.AddChart("Sheet1", "E1", `{"type":"col3DClustered","series":[{"name":"Sheet1!$A$2","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"},{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4"}],"title":{"name":"Fruit 3D Clustered Column Chart"}}`); err != nil {
+        fmt.Println(err)
+        return
+    }
+    // Save xlsx file by the given path.
+    if err := f.SaveAs("Book1.xlsx"); err != nil {
+        fmt.Println(err)
+    }
+}
+```
+
+### Add picture to spreadsheet file
+
+```go
+package main
+
+import (
+    "fmt"
+    _ "image/gif"
+    _ "image/jpeg"
+    _ "image/png"
+
+    "github.com/360EntSecGroup-Skylar/excelize"
+)
+
+func main() {
+    f, err := excelize.OpenFile("Book1.xlsx")
+    if err != nil {
+        fmt.Println(err)
+        return
+    }
+    // Insert a picture.
+    if err := f.AddPicture("Sheet1", "A2", "image.png", ""); err != nil {
+        fmt.Println(err)
+    }
+    // Insert a picture to worksheet with scaling.
+    if err := f.AddPicture("Sheet1", "D2", "image.jpg", `{"x_scale": 0.5, "y_scale": 0.5}`); err != nil {
+        fmt.Println(err)
+    }
+    // Insert a picture offset in the cell with printing support.
+    if err := f.AddPicture("Sheet1", "H2", "image.gif", `{"x_offset": 15, "y_offset": 10, "print_obj": true, "lock_aspect_ratio": false, "locked": false}`); err != nil {
+        fmt.Println(err)
+    }
+    // Save the xlsx file with the origin path.
+    if err = f.Save(); err != nil {
+        fmt.Println(err)
+    }
+}
+```
+
+## Contributing
+
+Contributions are welcome! Open a pull request to fix a bug, or open an issue to discuss a new feature or change. XML is compliant with [part 1 of the 5th edition of the ECMA-376 Standard for Office Open XML](http://www.ecma-international.org/publications/standards/Ecma-376.htm).
+
+## Licenses
+
+This program is under the terms of the BSD 3-Clause License. See [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause).
+
+The Excel logo is a trademark of [Microsoft Corporation](https://aka.ms/trademarks-usage). This artwork is an adaptation.
+
+gopher.{ai,svg,png} was created by [Takuya Ueda](https://twitter.com/tenntenn). Licensed under the [Creative Commons 3.0 Attributions license](http://creativecommons.org/licenses/by/3.0/).

+ 183 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/README_zh.md

@@ -0,0 +1,183 @@
+<p align="center"><img width="650" src="./excelize.svg" alt="Excelize logo"></p>
+
+<p align="center">
+    <a href="https://travis-ci.org/360EntSecGroup-Skylar/excelize"><img src="https://travis-ci.org/360EntSecGroup-Skylar/excelize.svg?branch=master" alt="Build Status"></a>
+    <a href="https://codecov.io/gh/360EntSecGroup-Skylar/excelize"><img src="https://codecov.io/gh/360EntSecGroup-Skylar/excelize/branch/master/graph/badge.svg" alt="Code Coverage"></a>
+    <a href="https://goreportcard.com/report/github.com/360EntSecGroup-Skylar/excelize"><img src="https://goreportcard.com/badge/github.com/360EntSecGroup-Skylar/excelize" alt="Go Report Card"></a>
+    <a href="https://pkg.go.dev/github.com/360EntSecGroup-Skylar/excelize/v2?tab=doc"><img src="https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white" alt="go.dev"></a>
+    <a href="https://opensource.org/licenses/BSD-3-Clause"><img src="https://img.shields.io/badge/license-bsd-orange.svg" alt="Licenses"></a>
+    <a href="https://www.paypal.me/xuri"><img src="https://img.shields.io/badge/Donate-PayPal-green.svg" alt="Donate"></a>
+</p>
+
+# Excelize
+
+## 简介
+
+Excelize 是 Go 语言编写的用于操作 Office Excel 文档基础库,基于 ECMA-376,ISO/IEC 29500 国际标准。可以使用它来读取、写入由 Microsoft Excel&trade; 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM 等多种文档格式,高度兼容带有样式、图片(表)、透视表、切片器等复杂组件的文档,并提供流式读写 API,用于处理包含大规模数据的工作簿。可应用于各类报表平台、云计算、边缘计算等系统。使用本类库要求使用的 Go 语言为 1.10 或更高版本,完整的 API 使用文档请访问 [go.dev](https://pkg.go.dev/github.com/360EntSecGroup-Skylar/excelize/v2?tab=doc) 或查看 [参考文档](https://xuri.me/excelize/)。
+
+## 快速上手
+
+### 安装
+
+```bash
+go get github.com/360EntSecGroup-Skylar/excelize
+```
+
+- 如果您使用 [Go Modules](https://blog.golang.org/using-go-modules) 管理软件包,请使用下面的命令来安装最新版本。
+
+```bash
+go get github.com/360EntSecGroup-Skylar/excelize/v2
+```
+
+### 创建 Excel 文档
+
+下面是一个创建 Excel 文档的简单例子:
+
+```go
+package main
+
+import (
+    "fmt"
+
+    "github.com/360EntSecGroup-Skylar/excelize"
+)
+
+func main() {
+    f := excelize.NewFile()
+    // 创建一个工作表
+    index := f.NewSheet("Sheet2")
+    // 设置单元格的值
+    f.SetCellValue("Sheet2", "A2", "Hello world.")
+    f.SetCellValue("Sheet1", "B2", 100)
+    // 设置工作簿的默认工作表
+    f.SetActiveSheet(index)
+    // 根据指定路径保存文件
+    if err := f.SaveAs("Book1.xlsx"); err != nil {
+        fmt.Println(err)
+    }
+}
+```
+
+### 读取 Excel 文档
+
+下面是读取 Excel 文档的例子:
+
+```go
+package main
+
+import (
+    "fmt"
+
+    "github.com/360EntSecGroup-Skylar/excelize"
+)
+
+func main() {
+    f, err := excelize.OpenFile("Book1.xlsx")
+    if err != nil {
+        fmt.Println(err)
+        return
+    }
+    // 获取工作表中指定单元格的值
+    cell, err := f.GetCellValue("Sheet1", "B2")
+    if err != nil {
+        fmt.Println(err)
+        return
+    }
+    fmt.Println(cell)
+    // 获取 Sheet1 上所有单元格
+    rows, err := f.GetRows("Sheet1")
+    for _, row := range rows {
+        for _, colCell := range row {
+            fmt.Print(colCell, "\t")
+        }
+        fmt.Println()
+    }
+}
+```
+
+### 在 Excel 文档中创建图表
+
+使用 Excelize 生成图表十分简单,仅需几行代码。您可以根据工作表中的已有数据构建图表,或向工作表中添加数据并创建图表。
+
+<p align="center"><img width="650" src="./test/images/chart.png" alt="Excelize"></p>
+
+```go
+package main
+
+import (
+    "fmt"
+
+    "github.com/360EntSecGroup-Skylar/excelize"
+)
+
+func main() {
+    categories := map[string]string{"A2": "Small", "A3": "Normal", "A4": "Large", "B1": "Apple", "C1": "Orange", "D1": "Pear"}
+    values := map[string]int{"B2": 2, "C2": 3, "D2": 3, "B3": 5, "C3": 2, "D3": 4, "B4": 6, "C4": 7, "D4": 8}
+    f := excelize.NewFile()
+    for k, v := range categories {
+        f.SetCellValue("Sheet1", k, v)
+    }
+    for k, v := range values {
+        f.SetCellValue("Sheet1", k, v)
+    }
+    if err := f.AddChart("Sheet1", "E1", `{"type":"col3DClustered","series":[{"name":"Sheet1!$A$2","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"},{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4"}],"title":{"name":"Fruit 3D Clustered Column Chart"}}`); err != nil {
+        fmt.Println(err)
+        return
+    }
+    // 根据指定路径保存文件
+    if err := f.SaveAs("Book1.xlsx"); err != nil {
+        fmt.Println(err)
+    }
+}
+```
+
+### 向 Excel 文档中插入图片
+
+```go
+package main
+
+import (
+    "fmt"
+    _ "image/gif"
+    _ "image/jpeg"
+    _ "image/png"
+
+    "github.com/360EntSecGroup-Skylar/excelize"
+)
+
+func main() {
+    f, err := excelize.OpenFile("Book1.xlsx")
+    if err != nil {
+        fmt.Println(err)
+        return
+    }
+    // 插入图片
+    if err := f.AddPicture("Sheet1", "A2", "image.png", ""); err != nil {
+        fmt.Println(err)
+    }
+    // 在工作表中插入图片,并设置图片的缩放比例
+    if err := f.AddPicture("Sheet1", "D2", "image.jpg", `{"x_scale": 0.5, "y_scale": 0.5}`); err != nil {
+        fmt.Println(err)
+    }
+    // 在工作表中插入图片,并设置图片的打印属性
+    if err := f.AddPicture("Sheet1", "H2", "image.gif", `{"x_offset": 15, "y_offset": 10, "print_obj": true, "lock_aspect_ratio": false, "locked": false}`); err != nil {
+        fmt.Println(err)
+    }
+    // 保存文件
+    if err = f.Save(); err != nil {
+        fmt.Println(err)
+    }
+}
+```
+
+## 社区合作
+
+欢迎您为此项目贡献代码,提出建议或问题、修复 Bug 以及参与讨论对新功能的想法。 XML 符合标准: [part 1 of the 5th edition of the ECMA-376 Standard for Office Open XML](http://www.ecma-international.org/publications/standards/Ecma-376.htm)。
+
+## 开源许可
+
+本项目遵循 BSD 3-Clause 开源许可协议,访问 [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) 查看许可协议文件。
+
+Excel 徽标是 [Microsoft Corporation](https://aka.ms/trademarks-usage) 的商标,项目的图片是一种改编。
+
+gopher.{ai,svg,png} 由 [Takuya Ueda](https://twitter.com/tenntenn) 创作,遵循 [Creative Commons 3.0 Attributions license](http://creativecommons.org/licenses/by/3.0/) 创作共用授权条款。

+ 9 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/SECURITY.md

@@ -0,0 +1,9 @@
+# Security Policy
+
+## Supported Versions
+
+We will dive into any security-related issue as long as your Excelize version is still supported by us. When reporting an issue, include as much information as possible, but no need to fill fancy forms or answer tedious questions. Just tell us what you found, how to reproduce it, and any concerns you have about it. We will respond as soon as possible and follow up with any missing information.
+
+## Reporting a Vulnerability
+
+Please e-mail us directly at `xuri.me@gmail.com` or use the security issue template on GitHub. In general, public disclosure is made after the issue has been fully identified and a patch is ready to be released. A security issue gets the highest priority assigned and a reply regarding the vulnerability is given within a typical 24 hours. Thank you!

+ 336 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/adjust.go

@@ -0,0 +1,336 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"errors"
+	"strings"
+)
+
+type adjustDirection bool
+
+const (
+	columns adjustDirection = false
+	rows    adjustDirection = true
+)
+
+// adjustHelper provides a function to adjust rows and columns dimensions,
+// hyperlinks, merged cells and auto filter when inserting or deleting rows or
+// columns.
+//
+// sheet: Worksheet name that we're editing
+// column: Index number of the column we're inserting/deleting before
+// row: Index number of the row we're inserting/deleting before
+// offset: Number of rows/column to insert/delete negative values indicate deletion
+//
+// TODO: adjustPageBreaks, adjustComments, adjustDataValidations, adjustProtectedCells
+//
+func (f *File) adjustHelper(sheet string, dir adjustDirection, num, offset int) error {
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	if dir == rows {
+		f.adjustRowDimensions(xlsx, num, offset)
+	} else {
+		f.adjustColDimensions(xlsx, num, offset)
+	}
+	f.adjustHyperlinks(xlsx, sheet, dir, num, offset)
+	if err = f.adjustMergeCells(xlsx, dir, num, offset); err != nil {
+		return err
+	}
+	if err = f.adjustAutoFilter(xlsx, dir, num, offset); err != nil {
+		return err
+	}
+	if err = f.adjustCalcChain(dir, num, offset); err != nil {
+		return err
+	}
+	checkSheet(xlsx)
+	_ = checkRow(xlsx)
+
+	if xlsx.MergeCells != nil && len(xlsx.MergeCells.Cells) == 0 {
+		xlsx.MergeCells = nil
+	}
+
+	return nil
+}
+
+// adjustColDimensions provides a function to update column dimensions when
+// inserting or deleting rows or columns.
+func (f *File) adjustColDimensions(xlsx *xlsxWorksheet, col, offset int) {
+	for rowIdx := range xlsx.SheetData.Row {
+		for colIdx, v := range xlsx.SheetData.Row[rowIdx].C {
+			cellCol, cellRow, _ := CellNameToCoordinates(v.R)
+			if col <= cellCol {
+				if newCol := cellCol + offset; newCol > 0 {
+					xlsx.SheetData.Row[rowIdx].C[colIdx].R, _ = CoordinatesToCellName(newCol, cellRow)
+				}
+			}
+		}
+	}
+}
+
+// adjustRowDimensions provides a function to update row dimensions when
+// inserting or deleting rows or columns.
+func (f *File) adjustRowDimensions(xlsx *xlsxWorksheet, row, offset int) {
+	for i := range xlsx.SheetData.Row {
+		r := &xlsx.SheetData.Row[i]
+		if newRow := r.R + offset; r.R >= row && newRow > 0 {
+			f.ajustSingleRowDimensions(r, newRow)
+		}
+	}
+}
+
+// ajustSingleRowDimensions provides a function to ajust single row dimensions.
+func (f *File) ajustSingleRowDimensions(r *xlsxRow, num int) {
+	r.R = num
+	for i, col := range r.C {
+		colName, _, _ := SplitCellName(col.R)
+		r.C[i].R, _ = JoinCellName(colName, num)
+	}
+}
+
+// adjustHyperlinks provides a function to update hyperlinks when inserting or
+// deleting rows or columns.
+func (f *File) adjustHyperlinks(xlsx *xlsxWorksheet, sheet string, dir adjustDirection, num, offset int) {
+	// short path
+	if xlsx.Hyperlinks == nil || len(xlsx.Hyperlinks.Hyperlink) == 0 {
+		return
+	}
+
+	// order is important
+	if offset < 0 {
+		for rowIdx, linkData := range xlsx.Hyperlinks.Hyperlink {
+			colNum, rowNum, _ := CellNameToCoordinates(linkData.Ref)
+
+			if (dir == rows && num == rowNum) || (dir == columns && num == colNum) {
+				f.deleteSheetRelationships(sheet, linkData.RID)
+				if len(xlsx.Hyperlinks.Hyperlink) > 1 {
+					xlsx.Hyperlinks.Hyperlink = append(xlsx.Hyperlinks.Hyperlink[:rowIdx],
+						xlsx.Hyperlinks.Hyperlink[rowIdx+1:]...)
+				} else {
+					xlsx.Hyperlinks = nil
+				}
+			}
+		}
+	}
+
+	if xlsx.Hyperlinks == nil {
+		return
+	}
+
+	for i := range xlsx.Hyperlinks.Hyperlink {
+		link := &xlsx.Hyperlinks.Hyperlink[i] // get reference
+		colNum, rowNum, _ := CellNameToCoordinates(link.Ref)
+
+		if dir == rows {
+			if rowNum >= num {
+				link.Ref, _ = CoordinatesToCellName(colNum, rowNum+offset)
+			}
+		} else {
+			if colNum >= num {
+				link.Ref, _ = CoordinatesToCellName(colNum+offset, rowNum)
+			}
+		}
+	}
+}
+
+// adjustAutoFilter provides a function to update the auto filter when
+// inserting or deleting rows or columns.
+func (f *File) adjustAutoFilter(xlsx *xlsxWorksheet, dir adjustDirection, num, offset int) error {
+	if xlsx.AutoFilter == nil {
+		return nil
+	}
+
+	coordinates, err := f.areaRefToCoordinates(xlsx.AutoFilter.Ref)
+	if err != nil {
+		return err
+	}
+	x1, y1, x2, y2 := coordinates[0], coordinates[1], coordinates[2], coordinates[3]
+
+	if (dir == rows && y1 == num && offset < 0) || (dir == columns && x1 == num && x2 == num) {
+		xlsx.AutoFilter = nil
+		for rowIdx := range xlsx.SheetData.Row {
+			rowData := &xlsx.SheetData.Row[rowIdx]
+			if rowData.R > y1 && rowData.R <= y2 {
+				rowData.Hidden = false
+			}
+		}
+		return nil
+	}
+
+	coordinates = f.adjustAutoFilterHelper(dir, coordinates, num, offset)
+	x1, y1, x2, y2 = coordinates[0], coordinates[1], coordinates[2], coordinates[3]
+
+	if xlsx.AutoFilter.Ref, err = f.coordinatesToAreaRef([]int{x1, y1, x2, y2}); err != nil {
+		return err
+	}
+	return nil
+}
+
+// adjustAutoFilterHelper provides a function for adjusting auto filter to
+// compare and calculate cell axis by the given adjust direction, operation
+// axis and offset.
+func (f *File) adjustAutoFilterHelper(dir adjustDirection, coordinates []int, num, offset int) []int {
+	if dir == rows {
+		if coordinates[1] >= num {
+			coordinates[1] += offset
+		}
+		if coordinates[3] >= num {
+			coordinates[3] += offset
+		}
+	} else {
+		if coordinates[2] >= num {
+			coordinates[2] += offset
+		}
+	}
+	return coordinates
+}
+
+// areaRefToCoordinates provides a function to convert area reference to a
+// pair of coordinates.
+func (f *File) areaRefToCoordinates(ref string) ([]int, error) {
+	rng := strings.Split(ref, ":")
+	return areaRangeToCoordinates(rng[0], rng[1])
+}
+
+// areaRangeToCoordinates provides a function to convert cell range to a
+// pair of coordinates.
+func areaRangeToCoordinates(firstCell, lastCell string) ([]int, error) {
+	coordinates := make([]int, 4)
+	var err error
+	coordinates[0], coordinates[1], err = CellNameToCoordinates(firstCell)
+	if err != nil {
+		return coordinates, err
+	}
+	coordinates[2], coordinates[3], err = CellNameToCoordinates(lastCell)
+	return coordinates, err
+}
+
+// sortCoordinates provides a function to correct the coordinate area, such
+// correct C1:B3 to B1:C3.
+func sortCoordinates(coordinates []int) error {
+	if len(coordinates) != 4 {
+		return errors.New("coordinates length must be 4")
+	}
+	if coordinates[2] < coordinates[0] {
+		coordinates[2], coordinates[0] = coordinates[0], coordinates[2]
+	}
+	if coordinates[3] < coordinates[1] {
+		coordinates[3], coordinates[1] = coordinates[1], coordinates[3]
+	}
+	return nil
+}
+
+// coordinatesToAreaRef provides a function to convert a pair of coordinates
+// to area reference.
+func (f *File) coordinatesToAreaRef(coordinates []int) (string, error) {
+	if len(coordinates) != 4 {
+		return "", errors.New("coordinates length must be 4")
+	}
+	firstCell, err := CoordinatesToCellName(coordinates[0], coordinates[1])
+	if err != nil {
+		return "", err
+	}
+	lastCell, err := CoordinatesToCellName(coordinates[2], coordinates[3])
+	if err != nil {
+		return "", err
+	}
+	return firstCell + ":" + lastCell, err
+}
+
+// adjustMergeCells provides a function to update merged cells when inserting
+// or deleting rows or columns.
+func (f *File) adjustMergeCells(xlsx *xlsxWorksheet, dir adjustDirection, num, offset int) error {
+	if xlsx.MergeCells == nil {
+		return nil
+	}
+
+	for i := 0; i < len(xlsx.MergeCells.Cells); i++ {
+		areaData := xlsx.MergeCells.Cells[i]
+		coordinates, err := f.areaRefToCoordinates(areaData.Ref)
+		if err != nil {
+			return err
+		}
+		x1, y1, x2, y2 := coordinates[0], coordinates[1], coordinates[2], coordinates[3]
+		if dir == rows {
+			if y1 == num && y2 == num && offset < 0 {
+				f.deleteMergeCell(xlsx, i)
+				i--
+			}
+			y1 = f.adjustMergeCellsHelper(y1, num, offset)
+			y2 = f.adjustMergeCellsHelper(y2, num, offset)
+		} else {
+			if x1 == num && x2 == num && offset < 0 {
+				f.deleteMergeCell(xlsx, i)
+				i--
+			}
+			x1 = f.adjustMergeCellsHelper(x1, num, offset)
+			x2 = f.adjustMergeCellsHelper(x2, num, offset)
+		}
+		if x1 == x2 && y1 == y2 {
+			f.deleteMergeCell(xlsx, i)
+			i--
+		}
+		if areaData.Ref, err = f.coordinatesToAreaRef([]int{x1, y1, x2, y2}); err != nil {
+			return err
+		}
+	}
+	return nil
+}
+
+// adjustMergeCellsHelper provides a function for adjusting merge cells to
+// compare and calculate cell axis by the given pivot, operation axis and
+// offset.
+func (f *File) adjustMergeCellsHelper(pivot, num, offset int) int {
+	if pivot >= num {
+		pivot += offset
+		if pivot < 1 {
+			return 1
+		}
+		return pivot
+	}
+	return pivot
+}
+
+// deleteMergeCell provides a function to delete merged cell by given index.
+func (f *File) deleteMergeCell(sheet *xlsxWorksheet, idx int) {
+	if len(sheet.MergeCells.Cells) > idx {
+		sheet.MergeCells.Cells = append(sheet.MergeCells.Cells[:idx], sheet.MergeCells.Cells[idx+1:]...)
+		sheet.MergeCells.Count = len(sheet.MergeCells.Cells)
+	}
+}
+
+// adjustCalcChain provides a function to update the calculation chain when
+// inserting or deleting rows or columns.
+func (f *File) adjustCalcChain(dir adjustDirection, num, offset int) error {
+	if f.CalcChain == nil {
+		return nil
+	}
+	for index, c := range f.CalcChain.C {
+		colNum, rowNum, err := CellNameToCoordinates(c.R)
+		if err != nil {
+			return err
+		}
+		if dir == rows && num <= rowNum {
+			if newRow := rowNum + offset; newRow > 0 {
+				f.CalcChain.C[index].R, _ = CoordinatesToCellName(colNum, newRow)
+			}
+		}
+		if dir == columns && num <= colNum {
+			if newCol := colNum + offset; newCol > 0 {
+				f.CalcChain.C[index].R, _ = CoordinatesToCellName(newCol, rowNum)
+			}
+		}
+	}
+	return nil
+}

+ 3134 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/calc.go

@@ -0,0 +1,3134 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"bytes"
+	"container/list"
+	"errors"
+	"fmt"
+	"math"
+	"math/rand"
+	"reflect"
+	"regexp"
+	"sort"
+	"strconv"
+	"strings"
+	"time"
+
+	"github.com/xuri/efp"
+)
+
+// Excel formula errors
+const (
+	formulaErrorDIV         = "#DIV/0!"
+	formulaErrorNAME        = "#NAME?"
+	formulaErrorNA          = "#N/A"
+	formulaErrorNUM         = "#NUM!"
+	formulaErrorVALUE       = "#VALUE!"
+	formulaErrorREF         = "#REF!"
+	formulaErrorNULL        = "#NULL"
+	formulaErrorSPILL       = "#SPILL!"
+	formulaErrorCALC        = "#CALC!"
+	formulaErrorGETTINGDATA = "#GETTING_DATA"
+)
+
+// cellRef defines the structure of a cell reference.
+type cellRef struct {
+	Col   int
+	Row   int
+	Sheet string
+}
+
+// cellRef defines the structure of a cell range.
+type cellRange struct {
+	From cellRef
+	To   cellRef
+}
+
+// formula criteria condition enumeration.
+const (
+	_ byte = iota
+	criteriaEq
+	criteriaLe
+	criteriaGe
+	criteriaL
+	criteriaG
+	criteriaBeg
+	criteriaEnd
+)
+
+// formulaCriteria defined formula criteria parser result.
+type formulaCriteria struct {
+	Type      byte
+	Condition string
+}
+
+// ArgType is the type if formula argument type.
+type ArgType byte
+
+// Formula argument types enumeration.
+const (
+	ArgUnknown ArgType = iota
+	ArgString
+	ArgMatrix
+)
+
+// formulaArg is the argument of a formula or function.
+type formulaArg struct {
+	String string
+	Matrix [][]formulaArg
+	Type   ArgType
+}
+
+// formulaFuncs is the type of the formula functions.
+type formulaFuncs struct{}
+
+// CalcCellValue provides a function to get calculated cell value. This
+// feature is currently in working processing. Array formula, table formula
+// and some other formulas are not supported currently.
+func (f *File) CalcCellValue(sheet, cell string) (result string, err error) {
+	var (
+		formula string
+		token   efp.Token
+	)
+	if formula, err = f.GetCellFormula(sheet, cell); err != nil {
+		return
+	}
+	ps := efp.ExcelParser()
+	tokens := ps.Parse(formula)
+	if tokens == nil {
+		return
+	}
+	if token, err = f.evalInfixExp(sheet, tokens); err != nil {
+		return
+	}
+	result = token.TValue
+	return
+}
+
+// getPriority calculate arithmetic operator priority.
+func getPriority(token efp.Token) (pri int) {
+	var priority = map[string]int{
+		"*": 2,
+		"/": 2,
+		"+": 1,
+		"-": 1,
+	}
+	pri, _ = priority[token.TValue]
+	if token.TValue == "-" && token.TType == efp.TokenTypeOperatorPrefix {
+		pri = 3
+	}
+	if token.TSubType == efp.TokenSubTypeStart && token.TType == efp.TokenTypeSubexpression { // (
+		pri = 0
+	}
+	return
+}
+
+// evalInfixExp evaluate syntax analysis by given infix expression after
+// lexical analysis. Evaluate an infix expression containing formulas by
+// stacks:
+//
+//    opd  - Operand
+//    opt  - Operator
+//    opf  - Operation formula
+//    opfd - Operand of the operation formula
+//    opft - Operator of the operation formula
+//
+// Evaluate arguments of the operation formula by list:
+//
+//    args - Arguments of the operation formula
+//
+// TODO: handle subtypes: Nothing, Text, Logical, Error, Concatenation, Intersection, Union
+//
+func (f *File) evalInfixExp(sheet string, tokens []efp.Token) (efp.Token, error) {
+	var err error
+	opdStack, optStack, opfStack, opfdStack, opftStack := NewStack(), NewStack(), NewStack(), NewStack(), NewStack()
+	argsList := list.New()
+	for i := 0; i < len(tokens); i++ {
+		token := tokens[i]
+
+		// out of function stack
+		if opfStack.Len() == 0 {
+			if err = f.parseToken(sheet, token, opdStack, optStack); err != nil {
+				return efp.Token{}, err
+			}
+		}
+
+		// function start
+		if token.TType == efp.TokenTypeFunction && token.TSubType == efp.TokenSubTypeStart {
+			opfStack.Push(token)
+			continue
+		}
+
+		// in function stack, walk 2 token at once
+		if opfStack.Len() > 0 {
+			var nextToken efp.Token
+			if i+1 < len(tokens) {
+				nextToken = tokens[i+1]
+			}
+
+			// current token is args or range, skip next token, order required: parse reference first
+			if token.TSubType == efp.TokenSubTypeRange {
+				if !opftStack.Empty() {
+					// parse reference: must reference at here
+					result, err := f.parseReference(sheet, token.TValue)
+					if err != nil {
+						return efp.Token{TValue: formulaErrorNAME}, err
+					}
+					if result.Type != ArgString {
+						return efp.Token{}, errors.New(formulaErrorVALUE)
+					}
+					opfdStack.Push(efp.Token{
+						TType:    efp.TokenTypeOperand,
+						TSubType: efp.TokenSubTypeNumber,
+						TValue:   result.String,
+					})
+					continue
+				}
+				if nextToken.TType == efp.TokenTypeArgument || nextToken.TType == efp.TokenTypeFunction {
+					// parse reference: reference or range at here
+					result, err := f.parseReference(sheet, token.TValue)
+					if err != nil {
+						return efp.Token{TValue: formulaErrorNAME}, err
+					}
+					if result.Type == ArgUnknown {
+						return efp.Token{}, errors.New(formulaErrorVALUE)
+					}
+					argsList.PushBack(result)
+					continue
+				}
+			}
+
+			// check current token is opft
+			if err = f.parseToken(sheet, token, opfdStack, opftStack); err != nil {
+				return efp.Token{}, err
+			}
+
+			// current token is arg
+			if token.TType == efp.TokenTypeArgument {
+				for !opftStack.Empty() {
+					// calculate trigger
+					topOpt := opftStack.Peek().(efp.Token)
+					if err := calculate(opfdStack, topOpt); err != nil {
+						return efp.Token{}, err
+					}
+					opftStack.Pop()
+				}
+				if !opfdStack.Empty() {
+					argsList.PushBack(formulaArg{
+						String: opfdStack.Pop().(efp.Token).TValue,
+						Type:   ArgString,
+					})
+				}
+				continue
+			}
+
+			// current token is logical
+			if token.TType == efp.OperatorsInfix && token.TSubType == efp.TokenSubTypeLogical {
+			}
+
+			// current token is text
+			if token.TType == efp.TokenTypeOperand && token.TSubType == efp.TokenSubTypeText {
+				argsList.PushBack(formulaArg{
+					String: token.TValue,
+					Type:   ArgString,
+				})
+			}
+
+			// current token is function stop
+			if token.TType == efp.TokenTypeFunction && token.TSubType == efp.TokenSubTypeStop {
+				for !opftStack.Empty() {
+					// calculate trigger
+					topOpt := opftStack.Peek().(efp.Token)
+					if err := calculate(opfdStack, topOpt); err != nil {
+						return efp.Token{}, err
+					}
+					opftStack.Pop()
+				}
+
+				// push opfd to args
+				if opfdStack.Len() > 0 {
+					argsList.PushBack(formulaArg{
+						String: opfdStack.Pop().(efp.Token).TValue,
+						Type:   ArgString,
+					})
+				}
+				// call formula function to evaluate
+				result, err := callFuncByName(&formulaFuncs{}, strings.NewReplacer(
+					"_xlfn", "", ".", "").Replace(opfStack.Peek().(efp.Token).TValue),
+					[]reflect.Value{reflect.ValueOf(argsList)})
+				if err != nil {
+					return efp.Token{}, err
+				}
+				argsList.Init()
+				opfStack.Pop()
+				if opfStack.Len() > 0 { // still in function stack
+					opfdStack.Push(efp.Token{TValue: result, TType: efp.TokenTypeOperand, TSubType: efp.TokenSubTypeNumber})
+				} else {
+					opdStack.Push(efp.Token{TValue: result, TType: efp.TokenTypeOperand, TSubType: efp.TokenSubTypeNumber})
+				}
+			}
+		}
+	}
+	for optStack.Len() != 0 {
+		topOpt := optStack.Peek().(efp.Token)
+		if err = calculate(opdStack, topOpt); err != nil {
+			return efp.Token{}, err
+		}
+		optStack.Pop()
+	}
+	if opdStack.Len() == 0 {
+		return efp.Token{}, errors.New("formula not valid")
+	}
+	return opdStack.Peek().(efp.Token), err
+}
+
+// calcAdd evaluate addition arithmetic operations.
+func calcAdd(opdStack *Stack) error {
+	if opdStack.Len() < 2 {
+		return errors.New("formula not valid")
+	}
+	rOpd := opdStack.Pop().(efp.Token)
+	lOpd := opdStack.Pop().(efp.Token)
+	lOpdVal, err := strconv.ParseFloat(lOpd.TValue, 64)
+	if err != nil {
+		return err
+	}
+	rOpdVal, err := strconv.ParseFloat(rOpd.TValue, 64)
+	if err != nil {
+		return err
+	}
+	result := lOpdVal + rOpdVal
+	opdStack.Push(efp.Token{TValue: fmt.Sprintf("%g", result), TType: efp.TokenTypeOperand, TSubType: efp.TokenSubTypeNumber})
+	return nil
+}
+
+// calcSubtract evaluate subtraction arithmetic operations.
+func calcSubtract(opdStack *Stack) error {
+	if opdStack.Len() < 2 {
+		return errors.New("formula not valid")
+	}
+	rOpd := opdStack.Pop().(efp.Token)
+	lOpd := opdStack.Pop().(efp.Token)
+	lOpdVal, err := strconv.ParseFloat(lOpd.TValue, 64)
+	if err != nil {
+		return err
+	}
+	rOpdVal, err := strconv.ParseFloat(rOpd.TValue, 64)
+	if err != nil {
+		return err
+	}
+	result := lOpdVal - rOpdVal
+	opdStack.Push(efp.Token{TValue: fmt.Sprintf("%g", result), TType: efp.TokenTypeOperand, TSubType: efp.TokenSubTypeNumber})
+	return nil
+}
+
+// calcMultiply evaluate multiplication arithmetic operations.
+func calcMultiply(opdStack *Stack) error {
+	if opdStack.Len() < 2 {
+		return errors.New("formula not valid")
+	}
+	rOpd := opdStack.Pop().(efp.Token)
+	lOpd := opdStack.Pop().(efp.Token)
+	lOpdVal, err := strconv.ParseFloat(lOpd.TValue, 64)
+	if err != nil {
+		return err
+	}
+	rOpdVal, err := strconv.ParseFloat(rOpd.TValue, 64)
+	if err != nil {
+		return err
+	}
+	result := lOpdVal * rOpdVal
+	opdStack.Push(efp.Token{TValue: fmt.Sprintf("%g", result), TType: efp.TokenTypeOperand, TSubType: efp.TokenSubTypeNumber})
+	return nil
+}
+
+// calcDivide evaluate division arithmetic operations.
+func calcDivide(opdStack *Stack) error {
+	if opdStack.Len() < 2 {
+		return errors.New("formula not valid")
+	}
+	rOpd := opdStack.Pop().(efp.Token)
+	lOpd := opdStack.Pop().(efp.Token)
+	lOpdVal, err := strconv.ParseFloat(lOpd.TValue, 64)
+	if err != nil {
+		return err
+	}
+	rOpdVal, err := strconv.ParseFloat(rOpd.TValue, 64)
+	if err != nil {
+		return err
+	}
+	result := lOpdVal / rOpdVal
+	if rOpdVal == 0 {
+		return errors.New(formulaErrorDIV)
+	}
+	opdStack.Push(efp.Token{TValue: fmt.Sprintf("%g", result), TType: efp.TokenTypeOperand, TSubType: efp.TokenSubTypeNumber})
+	return nil
+}
+
+// calculate evaluate basic arithmetic operations.
+func calculate(opdStack *Stack, opt efp.Token) error {
+	if opt.TValue == "-" && opt.TType == efp.TokenTypeOperatorPrefix {
+		if opdStack.Len() < 1 {
+			return errors.New("formula not valid")
+		}
+		opd := opdStack.Pop().(efp.Token)
+		opdVal, err := strconv.ParseFloat(opd.TValue, 64)
+		if err != nil {
+			return err
+		}
+		result := 0 - opdVal
+		opdStack.Push(efp.Token{TValue: fmt.Sprintf("%g", result), TType: efp.TokenTypeOperand, TSubType: efp.TokenSubTypeNumber})
+	}
+
+	if opt.TValue == "+" {
+		if err := calcAdd(opdStack); err != nil {
+			return err
+		}
+	}
+	if opt.TValue == "-" && opt.TType == efp.TokenTypeOperatorInfix {
+		if err := calcSubtract(opdStack); err != nil {
+			return err
+		}
+	}
+	if opt.TValue == "*" {
+		if err := calcMultiply(opdStack); err != nil {
+			return err
+		}
+	}
+	if opt.TValue == "/" {
+		if err := calcDivide(opdStack); err != nil {
+			return err
+		}
+	}
+	return nil
+}
+
+// parseOperatorPrefixToken parse operator prefix token.
+func (f *File) parseOperatorPrefixToken(optStack, opdStack *Stack, token efp.Token) (err error) {
+	if optStack.Len() == 0 {
+		optStack.Push(token)
+	} else {
+		tokenPriority := getPriority(token)
+		topOpt := optStack.Peek().(efp.Token)
+		topOptPriority := getPriority(topOpt)
+		if tokenPriority > topOptPriority {
+			optStack.Push(token)
+		} else {
+			for tokenPriority <= topOptPriority {
+				optStack.Pop()
+				if err = calculate(opdStack, topOpt); err != nil {
+					return
+				}
+				if optStack.Len() > 0 {
+					topOpt = optStack.Peek().(efp.Token)
+					topOptPriority = getPriority(topOpt)
+					continue
+				}
+				break
+			}
+			optStack.Push(token)
+		}
+	}
+	return
+}
+
+// isOperatorPrefixToken determine if the token is parse operator prefix
+// token.
+func isOperatorPrefixToken(token efp.Token) bool {
+	if (token.TValue == "-" && token.TType == efp.TokenTypeOperatorPrefix) ||
+		token.TValue == "+" || token.TValue == "-" || token.TValue == "*" || token.TValue == "/" {
+		return true
+	}
+	return false
+}
+
+func (f *File) getDefinedNameRefTo(definedNameName string, currentSheet string) (refTo string) {
+	for _, definedName := range f.GetDefinedName() {
+		if definedName.Name == definedNameName {
+			refTo = definedName.RefersTo
+			// worksheet scope takes precedence over scope workbook when both definedNames exist
+			if definedName.Scope == currentSheet {
+				break
+			}
+		}
+	}
+	return refTo
+}
+
+// parseToken parse basic arithmetic operator priority and evaluate based on
+// operators and operands.
+func (f *File) parseToken(sheet string, token efp.Token, opdStack, optStack *Stack) error {
+	// parse reference: must reference at here
+	if token.TSubType == efp.TokenSubTypeRange {
+		refTo := f.getDefinedNameRefTo(token.TValue, sheet)
+		if refTo != "" {
+			token.TValue = refTo
+		}
+		result, err := f.parseReference(sheet, token.TValue)
+		if err != nil {
+			return errors.New(formulaErrorNAME)
+		}
+		if result.Type != ArgString {
+			return errors.New(formulaErrorVALUE)
+		}
+		token.TValue = result.String
+		token.TType = efp.TokenTypeOperand
+		token.TSubType = efp.TokenSubTypeNumber
+	}
+	if isOperatorPrefixToken(token) {
+		if err := f.parseOperatorPrefixToken(optStack, opdStack, token); err != nil {
+			return err
+		}
+	}
+	if token.TType == efp.TokenTypeSubexpression && token.TSubType == efp.TokenSubTypeStart { // (
+		optStack.Push(token)
+	}
+	if token.TType == efp.TokenTypeSubexpression && token.TSubType == efp.TokenSubTypeStop { // )
+		for optStack.Peek().(efp.Token).TSubType != efp.TokenSubTypeStart && optStack.Peek().(efp.Token).TType != efp.TokenTypeSubexpression { // != (
+			topOpt := optStack.Peek().(efp.Token)
+			if err := calculate(opdStack, topOpt); err != nil {
+				return err
+			}
+			optStack.Pop()
+		}
+		optStack.Pop()
+	}
+	// opd
+	if token.TType == efp.TokenTypeOperand && token.TSubType == efp.TokenSubTypeNumber {
+		opdStack.Push(token)
+	}
+	return nil
+}
+
+// parseReference parse reference and extract values by given reference
+// characters and default sheet name.
+func (f *File) parseReference(sheet, reference string) (arg formulaArg, err error) {
+	reference = strings.Replace(reference, "$", "", -1)
+	refs, cellRanges, cellRefs := list.New(), list.New(), list.New()
+	for _, ref := range strings.Split(reference, ":") {
+		tokens := strings.Split(ref, "!")
+		cr := cellRef{}
+		if len(tokens) == 2 { // have a worksheet name
+			cr.Sheet = tokens[0]
+			if cr.Col, cr.Row, err = CellNameToCoordinates(tokens[1]); err != nil {
+				return
+			}
+			if refs.Len() > 0 {
+				e := refs.Back()
+				cellRefs.PushBack(e.Value.(cellRef))
+				refs.Remove(e)
+			}
+			refs.PushBack(cr)
+			continue
+		}
+		if cr.Col, cr.Row, err = CellNameToCoordinates(tokens[0]); err != nil {
+			return
+		}
+		e := refs.Back()
+		if e == nil {
+			cr.Sheet = sheet
+			refs.PushBack(cr)
+			continue
+		}
+		cellRanges.PushBack(cellRange{
+			From: e.Value.(cellRef),
+			To:   cr,
+		})
+		refs.Remove(e)
+	}
+	if refs.Len() > 0 {
+		e := refs.Back()
+		cellRefs.PushBack(e.Value.(cellRef))
+		refs.Remove(e)
+	}
+	arg, err = f.rangeResolver(cellRefs, cellRanges)
+	return
+}
+
+// prepareValueRange prepare value range.
+func prepareValueRange(cr cellRange, valueRange []int) {
+	if cr.From.Row < valueRange[0] || valueRange[0] == 0 {
+		valueRange[0] = cr.From.Row
+	}
+	if cr.From.Col < valueRange[2] || valueRange[2] == 0 {
+		valueRange[2] = cr.From.Col
+	}
+	if cr.To.Row > valueRange[1] || valueRange[1] == 0 {
+		valueRange[1] = cr.To.Row
+	}
+	if cr.To.Col > valueRange[3] || valueRange[3] == 0 {
+		valueRange[3] = cr.To.Col
+	}
+}
+
+// prepareValueRef prepare value reference.
+func prepareValueRef(cr cellRef, valueRange []int) {
+	if cr.Row < valueRange[0] || valueRange[0] == 0 {
+		valueRange[0] = cr.Row
+	}
+	if cr.Col < valueRange[2] || valueRange[2] == 0 {
+		valueRange[2] = cr.Col
+	}
+	if cr.Row > valueRange[1] || valueRange[1] == 0 {
+		valueRange[1] = cr.Row
+	}
+	if cr.Col > valueRange[3] || valueRange[3] == 0 {
+		valueRange[3] = cr.Col
+	}
+}
+
+// rangeResolver extract value as string from given reference and range list.
+// This function will not ignore the empty cell. For example, A1:A2:A2:B3 will
+// be reference A1:B3.
+func (f *File) rangeResolver(cellRefs, cellRanges *list.List) (arg formulaArg, err error) {
+	// value range order: from row, to row, from column, to column
+	valueRange := []int{0, 0, 0, 0}
+	var sheet string
+	// prepare value range
+	for temp := cellRanges.Front(); temp != nil; temp = temp.Next() {
+		cr := temp.Value.(cellRange)
+		if cr.From.Sheet != cr.To.Sheet {
+			err = errors.New(formulaErrorVALUE)
+		}
+		rng := []int{cr.From.Col, cr.From.Row, cr.To.Col, cr.To.Row}
+		sortCoordinates(rng)
+		cr.From.Col, cr.From.Row, cr.To.Col, cr.To.Row = rng[0], rng[1], rng[2], rng[3]
+		prepareValueRange(cr, valueRange)
+		if cr.From.Sheet != "" {
+			sheet = cr.From.Sheet
+		}
+	}
+	for temp := cellRefs.Front(); temp != nil; temp = temp.Next() {
+		cr := temp.Value.(cellRef)
+		if cr.Sheet != "" {
+			sheet = cr.Sheet
+		}
+		prepareValueRef(cr, valueRange)
+	}
+	// extract value from ranges
+	if cellRanges.Len() > 0 {
+		arg.Type = ArgMatrix
+		for row := valueRange[0]; row <= valueRange[1]; row++ {
+			var matrixRow = []formulaArg{}
+			for col := valueRange[2]; col <= valueRange[3]; col++ {
+				var cell, value string
+				if cell, err = CoordinatesToCellName(col, row); err != nil {
+					return
+				}
+				if value, err = f.GetCellValue(sheet, cell); err != nil {
+					return
+				}
+				matrixRow = append(matrixRow, formulaArg{
+					String: value,
+					Type:   ArgString,
+				})
+			}
+			arg.Matrix = append(arg.Matrix, matrixRow)
+		}
+		return
+	}
+	// extract value from references
+	for temp := cellRefs.Front(); temp != nil; temp = temp.Next() {
+		cr := temp.Value.(cellRef)
+		var cell string
+		if cell, err = CoordinatesToCellName(cr.Col, cr.Row); err != nil {
+			return
+		}
+		if arg.String, err = f.GetCellValue(cr.Sheet, cell); err != nil {
+			return
+		}
+		arg.Type = ArgString
+	}
+	return
+}
+
+// callFuncByName calls the no error or only error return function with
+// reflect by given receiver, name and parameters.
+func callFuncByName(receiver interface{}, name string, params []reflect.Value) (result string, err error) {
+	function := reflect.ValueOf(receiver).MethodByName(name)
+	if function.IsValid() {
+		rt := function.Call(params)
+		if len(rt) == 0 {
+			return
+		}
+		if !rt[1].IsNil() {
+			err = rt[1].Interface().(error)
+			return
+		}
+		result = rt[0].Interface().(string)
+		return
+	}
+	err = fmt.Errorf("not support %s function", name)
+	return
+}
+
+// formulaCriteriaParser parse formula criteria.
+func formulaCriteriaParser(exp string) (fc *formulaCriteria) {
+	fc = &formulaCriteria{}
+	if exp == "" {
+		return
+	}
+	if match := regexp.MustCompile(`^([0-9]+)$`).FindStringSubmatch(exp); len(match) > 1 {
+		fc.Type, fc.Condition = criteriaEq, match[1]
+		return
+	}
+	if match := regexp.MustCompile(`^=(.*)$`).FindStringSubmatch(exp); len(match) > 1 {
+		fc.Type, fc.Condition = criteriaEq, match[1]
+		return
+	}
+	if match := regexp.MustCompile(`^<(.*)$`).FindStringSubmatch(exp); len(match) > 1 {
+		fc.Type, fc.Condition = criteriaLe, match[1]
+		return
+	}
+	if match := regexp.MustCompile(`^>(.*)$`).FindStringSubmatch(exp); len(match) > 1 {
+		fc.Type, fc.Condition = criteriaGe, match[1]
+		return
+	}
+	if match := regexp.MustCompile(`^<=(.*)$`).FindStringSubmatch(exp); len(match) > 1 {
+		fc.Type, fc.Condition = criteriaL, match[1]
+		return
+	}
+	if match := regexp.MustCompile(`^>=(.*)$`).FindStringSubmatch(exp); len(match) > 1 {
+		fc.Type, fc.Condition = criteriaG, match[1]
+		return
+	}
+	if strings.Contains(exp, "*") {
+		if strings.HasPrefix(exp, "*") {
+			fc.Type, fc.Condition = criteriaEnd, strings.TrimPrefix(exp, "*")
+		}
+		if strings.HasSuffix(exp, "*") {
+			fc.Type, fc.Condition = criteriaBeg, strings.TrimSuffix(exp, "*")
+		}
+		return
+	}
+	fc.Type, fc.Condition = criteriaEq, exp
+	return
+}
+
+// formulaCriteriaEval evaluate formula criteria expression.
+func formulaCriteriaEval(val string, criteria *formulaCriteria) (result bool, err error) {
+	var value, expected float64
+	var prepareValue = func(val, cond string) (value float64, expected float64, err error) {
+		value, _ = strconv.ParseFloat(val, 64)
+		if expected, err = strconv.ParseFloat(criteria.Condition, 64); err != nil {
+			return
+		}
+		return
+	}
+	switch criteria.Type {
+	case criteriaEq:
+		return val == criteria.Condition, err
+	case criteriaLe:
+		if value, expected, err = prepareValue(val, criteria.Condition); err != nil {
+			return
+		}
+		return value <= expected, err
+	case criteriaGe:
+		if value, expected, err = prepareValue(val, criteria.Condition); err != nil {
+			return
+		}
+		return value >= expected, err
+	case criteriaL:
+		if value, expected, err = prepareValue(val, criteria.Condition); err != nil {
+			return
+		}
+		return value < expected, err
+	case criteriaG:
+		if value, expected, err = prepareValue(val, criteria.Condition); err != nil {
+			return
+		}
+		return value > expected, err
+	case criteriaBeg:
+		return strings.HasPrefix(val, criteria.Condition), err
+	case criteriaEnd:
+		return strings.HasSuffix(val, criteria.Condition), err
+	}
+	return
+}
+
+// Math and Trigonometric functions
+
+// ABS function returns the absolute value of any supplied number. The syntax
+// of the function is:
+//
+//   ABS(number)
+//
+func (fn *formulaFuncs) ABS(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ABS requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Abs(val))
+	return
+}
+
+// ACOS function calculates the arccosine (i.e. the inverse cosine) of a given
+// number, and returns an angle, in radians, between 0 and π. The syntax of
+// the function is:
+//
+//   ACOS(number)
+//
+func (fn *formulaFuncs) ACOS(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ACOS requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Acos(val))
+	return
+}
+
+// ACOSH function calculates the inverse hyperbolic cosine of a supplied number.
+// of the function is:
+//
+//   ACOSH(number)
+//
+func (fn *formulaFuncs) ACOSH(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ACOSH requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Acosh(val))
+	return
+}
+
+// ACOT function calculates the arccotangent (i.e. the inverse cotangent) of a
+// given number, and returns an angle, in radians, between 0 and π. The syntax
+// of the function is:
+//
+//   ACOT(number)
+//
+func (fn *formulaFuncs) ACOT(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ACOT requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Pi/2-math.Atan(val))
+	return
+}
+
+// ACOTH function calculates the hyperbolic arccotangent (coth) of a supplied
+// value. The syntax of the function is:
+//
+//   ACOTH(number)
+//
+func (fn *formulaFuncs) ACOTH(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ACOTH requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Atanh(1/val))
+	return
+}
+
+// ARABIC function converts a Roman numeral into an Arabic numeral. The syntax
+// of the function is:
+//
+//   ARABIC(text)
+//
+func (fn *formulaFuncs) ARABIC(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ARABIC requires 1 numeric argument")
+		return
+	}
+	charMap := map[rune]float64{'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}
+	val, last, prefix := 0.0, 0.0, 1.0
+	for _, char := range argsList.Front().Value.(formulaArg).String {
+		digit := 0.0
+		if char == '-' {
+			prefix = -1
+			continue
+		}
+		digit, _ = charMap[char]
+		val += digit
+		switch {
+		case last == digit && (last == 5 || last == 50 || last == 500):
+			result = formulaErrorVALUE
+			return
+		case 2*last == digit:
+			result = formulaErrorVALUE
+			return
+		}
+		if last < digit {
+			val -= 2 * last
+		}
+		last = digit
+	}
+	result = fmt.Sprintf("%g", prefix*val)
+	return
+}
+
+// ASIN function calculates the arcsine (i.e. the inverse sine) of a given
+// number, and returns an angle, in radians, between -π/2 and π/2. The syntax
+// of the function is:
+//
+//   ASIN(number)
+//
+func (fn *formulaFuncs) ASIN(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ASIN requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Asin(val))
+	return
+}
+
+// ASINH function calculates the inverse hyperbolic sine of a supplied number.
+// The syntax of the function is:
+//
+//   ASINH(number)
+//
+func (fn *formulaFuncs) ASINH(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ASINH requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Asinh(val))
+	return
+}
+
+// ATAN function calculates the arctangent (i.e. the inverse tangent) of a
+// given number, and returns an angle, in radians, between -π/2 and +π/2. The
+// syntax of the function is:
+//
+//   ATAN(number)
+//
+func (fn *formulaFuncs) ATAN(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ATAN requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Atan(val))
+	return
+}
+
+// ATANH function calculates the inverse hyperbolic tangent of a supplied
+// number. The syntax of the function is:
+//
+//   ATANH(number)
+//
+func (fn *formulaFuncs) ATANH(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ATANH requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Atanh(val))
+	return
+}
+
+// ATAN2 function calculates the arctangent (i.e. the inverse tangent) of a
+// given set of x and y coordinates, and returns an angle, in radians, between
+// -π/2 and +π/2. The syntax of the function is:
+//
+//   ATAN2(x_num,y_num)
+//
+func (fn *formulaFuncs) ATAN2(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 2 {
+		err = errors.New("ATAN2 requires 2 numeric arguments")
+		return
+	}
+	var x, y float64
+	if x, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if y, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Atan2(x, y))
+	return
+}
+
+// BASE function converts a number into a supplied base (radix), and returns a
+// text representation of the calculated value. The syntax of the function is:
+//
+//   BASE(number,radix,[min_length])
+//
+func (fn *formulaFuncs) BASE(argsList *list.List) (result string, err error) {
+	if argsList.Len() < 2 {
+		err = errors.New("BASE requires at least 2 arguments")
+		return
+	}
+	if argsList.Len() > 3 {
+		err = errors.New("BASE allows at most 3 arguments")
+		return
+	}
+	var number float64
+	var radix, minLength int
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if radix, err = strconv.Atoi(argsList.Front().Next().Value.(formulaArg).String); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if radix < 2 || radix > 36 {
+		err = errors.New("radix must be an integer >= 2 and <= 36")
+		return
+	}
+	if argsList.Len() > 2 {
+		if minLength, err = strconv.Atoi(argsList.Back().Value.(formulaArg).String); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+	}
+	result = strconv.FormatInt(int64(number), radix)
+	if len(result) < minLength {
+		result = strings.Repeat("0", minLength-len(result)) + result
+	}
+	result = strings.ToUpper(result)
+	return
+}
+
+// CEILING function rounds a supplied number away from zero, to the nearest
+// multiple of a given number. The syntax of the function is:
+//
+//   CEILING(number,significance)
+//
+func (fn *formulaFuncs) CEILING(argsList *list.List) (result string, err error) {
+	if argsList.Len() == 0 {
+		err = errors.New("CEILING requires at least 1 argument")
+		return
+	}
+	if argsList.Len() > 2 {
+		err = errors.New("CEILING allows at most 2 arguments")
+		return
+	}
+	number, significance, res := 0.0, 1.0, 0.0
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if number < 0 {
+		significance = -1
+	}
+	if argsList.Len() > 1 {
+		if significance, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+	}
+	if significance < 0 && number > 0 {
+		err = errors.New("negative sig to CEILING invalid")
+		return
+	}
+	if argsList.Len() == 1 {
+		result = fmt.Sprintf("%g", math.Ceil(number))
+		return
+	}
+	number, res = math.Modf(number / significance)
+	if res > 0 {
+		number++
+	}
+	result = fmt.Sprintf("%g", number*significance)
+	return
+}
+
+// CEILINGMATH function rounds a supplied number up to a supplied multiple of
+// significance. The syntax of the function is:
+//
+//   CEILING.MATH(number,[significance],[mode])
+//
+func (fn *formulaFuncs) CEILINGMATH(argsList *list.List) (result string, err error) {
+	if argsList.Len() == 0 {
+		err = errors.New("CEILING.MATH requires at least 1 argument")
+		return
+	}
+	if argsList.Len() > 3 {
+		err = errors.New("CEILING.MATH allows at most 3 arguments")
+		return
+	}
+	number, significance, mode := 0.0, 1.0, 1.0
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if number < 0 {
+		significance = -1
+	}
+	if argsList.Len() > 1 {
+		if significance, err = strconv.ParseFloat(argsList.Front().Next().Value.(formulaArg).String, 64); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+	}
+	if argsList.Len() == 1 {
+		result = fmt.Sprintf("%g", math.Ceil(number))
+		return
+	}
+	if argsList.Len() > 2 {
+		if mode, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+	}
+	val, res := math.Modf(number / significance)
+	if res != 0 {
+		if number > 0 {
+			val++
+		} else if mode < 0 {
+			val--
+		}
+	}
+	result = fmt.Sprintf("%g", val*significance)
+	return
+}
+
+// CEILINGPRECISE function rounds a supplied number up (regardless of the
+// number's sign), to the nearest multiple of a given number. The syntax of
+// the function is:
+//
+//   CEILING.PRECISE(number,[significance])
+//
+func (fn *formulaFuncs) CEILINGPRECISE(argsList *list.List) (result string, err error) {
+	if argsList.Len() == 0 {
+		err = errors.New("CEILING.PRECISE requires at least 1 argument")
+		return
+	}
+	if argsList.Len() > 2 {
+		err = errors.New("CEILING.PRECISE allows at most 2 arguments")
+		return
+	}
+	number, significance := 0.0, 1.0
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if number < 0 {
+		significance = -1
+	}
+	if argsList.Len() == 1 {
+		result = fmt.Sprintf("%g", math.Ceil(number))
+		return
+	}
+	if argsList.Len() > 1 {
+		if significance, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+		significance = math.Abs(significance)
+		if significance == 0 {
+			result = "0"
+			return
+		}
+	}
+	val, res := math.Modf(number / significance)
+	if res != 0 {
+		if number > 0 {
+			val++
+		}
+	}
+	result = fmt.Sprintf("%g", val*significance)
+	return
+}
+
+// COMBIN function calculates the number of combinations (in any order) of a
+// given number objects from a set. The syntax of the function is:
+//
+//   COMBIN(number,number_chosen)
+//
+func (fn *formulaFuncs) COMBIN(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 2 {
+		err = errors.New("COMBIN requires 2 argument")
+		return
+	}
+	number, chosen, val := 0.0, 0.0, 1.0
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if chosen, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	number, chosen = math.Trunc(number), math.Trunc(chosen)
+	if chosen > number {
+		err = errors.New("COMBIN requires number >= number_chosen")
+		return
+	}
+	if chosen == number || chosen == 0 {
+		result = "1"
+		return
+	}
+	for c := float64(1); c <= chosen; c++ {
+		val *= (number + 1 - c) / c
+	}
+	result = fmt.Sprintf("%g", math.Ceil(val))
+	return
+}
+
+// COMBINA function calculates the number of combinations, with repetitions,
+// of a given number objects from a set. The syntax of the function is:
+//
+//   COMBINA(number,number_chosen)
+//
+func (fn *formulaFuncs) COMBINA(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 2 {
+		err = errors.New("COMBINA requires 2 argument")
+		return
+	}
+	var number, chosen float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if chosen, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	number, chosen = math.Trunc(number), math.Trunc(chosen)
+	if number < chosen {
+		err = errors.New("COMBINA requires number > number_chosen")
+		return
+	}
+	if number == 0 {
+		result = "0"
+		return
+	}
+	args := list.New()
+	args.PushBack(formulaArg{
+		String: fmt.Sprintf("%g", number+chosen-1),
+		Type:   ArgString,
+	})
+	args.PushBack(formulaArg{
+		String: fmt.Sprintf("%g", number-1),
+		Type:   ArgString,
+	})
+	return fn.COMBIN(args)
+}
+
+// COS function calculates the cosine of a given angle. The syntax of the
+// function is:
+//
+//   COS(number)
+//
+func (fn *formulaFuncs) COS(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("COS requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Cos(val))
+	return
+}
+
+// COSH function calculates the hyperbolic cosine (cosh) of a supplied number.
+// The syntax of the function is:
+//
+//   COSH(number)
+//
+func (fn *formulaFuncs) COSH(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("COSH requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Cosh(val))
+	return
+}
+
+// COT function calculates the cotangent of a given angle. The syntax of the
+// function is:
+//
+//   COT(number)
+//
+func (fn *formulaFuncs) COT(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("COT requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if val == 0 {
+		err = errors.New(formulaErrorDIV)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Tan(val))
+	return
+}
+
+// COTH function calculates the hyperbolic cotangent (coth) of a supplied
+// angle. The syntax of the function is:
+//
+//   COTH(number)
+//
+func (fn *formulaFuncs) COTH(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("COTH requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if val == 0 {
+		err = errors.New(formulaErrorDIV)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Tanh(val))
+	return
+}
+
+// CSC function calculates the cosecant of a given angle. The syntax of the
+// function is:
+//
+//   CSC(number)
+//
+func (fn *formulaFuncs) CSC(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("CSC requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if val == 0 {
+		err = errors.New(formulaErrorDIV)
+		return
+	}
+	result = fmt.Sprintf("%g", 1/math.Sin(val))
+	return
+}
+
+// CSCH function calculates the hyperbolic cosecant (csch) of a supplied
+// angle. The syntax of the function is:
+//
+//   CSCH(number)
+//
+func (fn *formulaFuncs) CSCH(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("CSCH requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if val == 0 {
+		err = errors.New(formulaErrorDIV)
+		return
+	}
+	result = fmt.Sprintf("%g", 1/math.Sinh(val))
+	return
+}
+
+// DECIMAL function converts a text representation of a number in a specified
+// base, into a decimal value. The syntax of the function is:
+//
+//   DECIMAL(text,radix)
+//
+func (fn *formulaFuncs) DECIMAL(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 2 {
+		err = errors.New("DECIMAL requires 2 numeric arguments")
+		return
+	}
+	var text = argsList.Front().Value.(formulaArg).String
+	var radix int
+	if radix, err = strconv.Atoi(argsList.Back().Value.(formulaArg).String); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if len(text) > 2 && (strings.HasPrefix(text, "0x") || strings.HasPrefix(text, "0X")) {
+		text = text[2:]
+	}
+	val, err := strconv.ParseInt(text, radix, 64)
+	if err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", float64(val))
+	return
+}
+
+// DEGREES function converts radians into degrees. The syntax of the function
+// is:
+//
+//   DEGREES(angle)
+//
+func (fn *formulaFuncs) DEGREES(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("DEGREES requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if val == 0 {
+		err = errors.New(formulaErrorDIV)
+		return
+	}
+	result = fmt.Sprintf("%g", 180.0/math.Pi*val)
+	return
+}
+
+// EVEN function rounds a supplied number away from zero (i.e. rounds a
+// positive number up and a negative number down), to the next even number.
+// The syntax of the function is:
+//
+//   EVEN(number)
+//
+func (fn *formulaFuncs) EVEN(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("EVEN requires 1 numeric argument")
+		return
+	}
+	var number float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	sign := math.Signbit(number)
+	m, frac := math.Modf(number / 2)
+	val := m * 2
+	if frac != 0 {
+		if !sign {
+			val += 2
+		} else {
+			val -= 2
+		}
+	}
+	result = fmt.Sprintf("%g", val)
+	return
+}
+
+// EXP function calculates the value of the mathematical constant e, raised to
+// the power of a given number. The syntax of the function is:
+//
+//   EXP(number)
+//
+func (fn *formulaFuncs) EXP(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("EXP requires 1 numeric argument")
+		return
+	}
+	var number float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = strings.ToUpper(fmt.Sprintf("%g", math.Exp(number)))
+	return
+}
+
+// fact returns the factorial of a supplied number.
+func fact(number float64) float64 {
+	val := float64(1)
+	for i := float64(2); i <= number; i++ {
+		val *= i
+	}
+	return val
+}
+
+// FACT function returns the factorial of a supplied number. The syntax of the
+// function is:
+//
+//   FACT(number)
+//
+func (fn *formulaFuncs) FACT(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("FACT requires 1 numeric argument")
+		return
+	}
+	var number float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if number < 0 {
+		err = errors.New(formulaErrorNUM)
+	}
+	result = strings.ToUpper(fmt.Sprintf("%g", fact(number)))
+	return
+}
+
+// FACTDOUBLE function returns the double factorial of a supplied number. The
+// syntax of the function is:
+//
+//   FACTDOUBLE(number)
+//
+func (fn *formulaFuncs) FACTDOUBLE(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("FACTDOUBLE requires 1 numeric argument")
+		return
+	}
+	number, val := 0.0, 1.0
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if number < 0 {
+		err = errors.New(formulaErrorNUM)
+		return
+	}
+	for i := math.Trunc(number); i > 1; i -= 2 {
+		val *= i
+	}
+	result = strings.ToUpper(fmt.Sprintf("%g", val))
+	return
+}
+
+// FLOOR function rounds a supplied number towards zero to the nearest
+// multiple of a specified significance. The syntax of the function is:
+//
+//   FLOOR(number,significance)
+//
+func (fn *formulaFuncs) FLOOR(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 2 {
+		err = errors.New("FLOOR requires 2 numeric arguments")
+		return
+	}
+	var number, significance float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if significance, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if significance < 0 && number >= 0 {
+		err = errors.New(formulaErrorNUM)
+		return
+	}
+	val := number
+	val, res := math.Modf(val / significance)
+	if res != 0 {
+		if number < 0 && res < 0 {
+			val--
+		}
+	}
+	result = strings.ToUpper(fmt.Sprintf("%g", val*significance))
+	return
+}
+
+// FLOORMATH function rounds a supplied number down to a supplied multiple of
+// significance. The syntax of the function is:
+//
+//   FLOOR.MATH(number,[significance],[mode])
+//
+func (fn *formulaFuncs) FLOORMATH(argsList *list.List) (result string, err error) {
+	if argsList.Len() == 0 {
+		err = errors.New("FLOOR.MATH requires at least 1 argument")
+		return
+	}
+	if argsList.Len() > 3 {
+		err = errors.New("FLOOR.MATH allows at most 3 arguments")
+		return
+	}
+	number, significance, mode := 0.0, 1.0, 1.0
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if number < 0 {
+		significance = -1
+	}
+	if argsList.Len() > 1 {
+		if significance, err = strconv.ParseFloat(argsList.Front().Next().Value.(formulaArg).String, 64); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+	}
+	if argsList.Len() == 1 {
+		result = fmt.Sprintf("%g", math.Floor(number))
+		return
+	}
+	if argsList.Len() > 2 {
+		if mode, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+	}
+	val, res := math.Modf(number / significance)
+	if res != 0 && number < 0 && mode > 0 {
+		val--
+	}
+	result = fmt.Sprintf("%g", val*significance)
+	return
+}
+
+// FLOORPRECISE function rounds a supplied number down to a supplied multiple
+// of significance. The syntax of the function is:
+//
+//   FLOOR.PRECISE(number,[significance])
+//
+func (fn *formulaFuncs) FLOORPRECISE(argsList *list.List) (result string, err error) {
+	if argsList.Len() == 0 {
+		err = errors.New("FLOOR.PRECISE requires at least 1 argument")
+		return
+	}
+	if argsList.Len() > 2 {
+		err = errors.New("FLOOR.PRECISE allows at most 2 arguments")
+		return
+	}
+	var number, significance float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if number < 0 {
+		significance = -1
+	}
+	if argsList.Len() == 1 {
+		result = fmt.Sprintf("%g", math.Floor(number))
+		return
+	}
+	if argsList.Len() > 1 {
+		if significance, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+		significance = math.Abs(significance)
+		if significance == 0 {
+			result = "0"
+			return
+		}
+	}
+	val, res := math.Modf(number / significance)
+	if res != 0 {
+		if number < 0 {
+			val--
+		}
+	}
+	result = fmt.Sprintf("%g", val*significance)
+	return
+}
+
+// gcd returns the greatest common divisor of two supplied integers.
+func gcd(x, y float64) float64 {
+	x, y = math.Trunc(x), math.Trunc(y)
+	if x == 0 {
+		return y
+	}
+	if y == 0 {
+		return x
+	}
+	for x != y {
+		if x > y {
+			x = x - y
+		} else {
+			y = y - x
+		}
+	}
+	return x
+}
+
+// GCD function returns the greatest common divisor of two or more supplied
+// integers. The syntax of the function is:
+//
+//   GCD(number1,[number2],...)
+//
+func (fn *formulaFuncs) GCD(argsList *list.List) (result string, err error) {
+	if argsList.Len() == 0 {
+		err = errors.New("GCD requires at least 1 argument")
+		return
+	}
+	var (
+		val  float64
+		nums = []float64{}
+	)
+	for arg := argsList.Front(); arg != nil; arg = arg.Next() {
+		token := arg.Value.(formulaArg).String
+		if token == "" {
+			continue
+		}
+		if val, err = strconv.ParseFloat(token, 64); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+		nums = append(nums, val)
+	}
+	if nums[0] < 0 {
+		err = errors.New("GCD only accepts positive arguments")
+		return
+	}
+	if len(nums) == 1 {
+		result = fmt.Sprintf("%g", nums[0])
+		return
+	}
+	cd := nums[0]
+	for i := 1; i < len(nums); i++ {
+		if nums[i] < 0 {
+			err = errors.New("GCD only accepts positive arguments")
+			return
+		}
+		cd = gcd(cd, nums[i])
+	}
+	result = fmt.Sprintf("%g", cd)
+	return
+}
+
+// INT function truncates a supplied number down to the closest integer. The
+// syntax of the function is:
+//
+//   INT(number)
+//
+func (fn *formulaFuncs) INT(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("INT requires 1 numeric argument")
+		return
+	}
+	var number float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	val, frac := math.Modf(number)
+	if frac < 0 {
+		val--
+	}
+	result = fmt.Sprintf("%g", val)
+	return
+}
+
+// ISOCEILING function rounds a supplied number up (regardless of the number's
+// sign), to the nearest multiple of a supplied significance. The syntax of
+// the function is:
+//
+//   ISO.CEILING(number,[significance])
+//
+func (fn *formulaFuncs) ISOCEILING(argsList *list.List) (result string, err error) {
+	if argsList.Len() == 0 {
+		err = errors.New("ISO.CEILING requires at least 1 argument")
+		return
+	}
+	if argsList.Len() > 2 {
+		err = errors.New("ISO.CEILING allows at most 2 arguments")
+		return
+	}
+	var number, significance float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if number < 0 {
+		significance = -1
+	}
+	if argsList.Len() == 1 {
+		result = fmt.Sprintf("%g", math.Ceil(number))
+		return
+	}
+	if argsList.Len() > 1 {
+		if significance, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+		significance = math.Abs(significance)
+		if significance == 0 {
+			result = "0"
+			return
+		}
+	}
+	val, res := math.Modf(number / significance)
+	if res != 0 {
+		if number > 0 {
+			val++
+		}
+	}
+	result = fmt.Sprintf("%g", val*significance)
+	return
+}
+
+// lcm returns the least common multiple of two supplied integers.
+func lcm(a, b float64) float64 {
+	a = math.Trunc(a)
+	b = math.Trunc(b)
+	if a == 0 && b == 0 {
+		return 0
+	}
+	return a * b / gcd(a, b)
+}
+
+// LCM function returns the least common multiple of two or more supplied
+// integers. The syntax of the function is:
+//
+//   LCM(number1,[number2],...)
+//
+func (fn *formulaFuncs) LCM(argsList *list.List) (result string, err error) {
+	if argsList.Len() == 0 {
+		err = errors.New("LCM requires at least 1 argument")
+		return
+	}
+	var (
+		val  float64
+		nums = []float64{}
+	)
+	for arg := argsList.Front(); arg != nil; arg = arg.Next() {
+		token := arg.Value.(formulaArg).String
+		if token == "" {
+			continue
+		}
+		if val, err = strconv.ParseFloat(token, 64); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+		nums = append(nums, val)
+	}
+	if nums[0] < 0 {
+		err = errors.New("LCM only accepts positive arguments")
+		return
+	}
+	if len(nums) == 1 {
+		result = fmt.Sprintf("%g", nums[0])
+		return
+	}
+	cm := nums[0]
+	for i := 1; i < len(nums); i++ {
+		if nums[i] < 0 {
+			err = errors.New("LCM only accepts positive arguments")
+			return
+		}
+		cm = lcm(cm, nums[i])
+	}
+	result = fmt.Sprintf("%g", cm)
+	return
+}
+
+// LN function calculates the natural logarithm of a given number. The syntax
+// of the function is:
+//
+//   LN(number)
+//
+func (fn *formulaFuncs) LN(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("LN requires 1 numeric argument")
+		return
+	}
+	var number float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Log(number))
+	return
+}
+
+// LOG function calculates the logarithm of a given number, to a supplied
+// base. The syntax of the function is:
+//
+//   LOG(number,[base])
+//
+func (fn *formulaFuncs) LOG(argsList *list.List) (result string, err error) {
+	if argsList.Len() == 0 {
+		err = errors.New("LOG requires at least 1 argument")
+		return
+	}
+	if argsList.Len() > 2 {
+		err = errors.New("LOG allows at most 2 arguments")
+		return
+	}
+	number, base := 0.0, 10.0
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if argsList.Len() > 1 {
+		if base, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+	}
+	if number == 0 {
+		err = errors.New(formulaErrorNUM)
+		return
+	}
+	if base == 0 {
+		err = errors.New(formulaErrorNUM)
+		return
+	}
+	if base == 1 {
+		err = errors.New(formulaErrorDIV)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Log(number)/math.Log(base))
+	return
+}
+
+// LOG10 function calculates the base 10 logarithm of a given number. The
+// syntax of the function is:
+//
+//   LOG10(number)
+//
+func (fn *formulaFuncs) LOG10(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("LOG10 requires 1 numeric argument")
+		return
+	}
+	var number float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Log10(number))
+	return
+}
+
+func minor(sqMtx [][]float64, idx int) [][]float64 {
+	ret := [][]float64{}
+	for i := range sqMtx {
+		if i == 0 {
+			continue
+		}
+		row := []float64{}
+		for j := range sqMtx {
+			if j == idx {
+				continue
+			}
+			row = append(row, sqMtx[i][j])
+		}
+		ret = append(ret, row)
+	}
+	return ret
+}
+
+// det determinant of the 2x2 matrix.
+func det(sqMtx [][]float64) float64 {
+	if len(sqMtx) == 2 {
+		m00 := sqMtx[0][0]
+		m01 := sqMtx[0][1]
+		m10 := sqMtx[1][0]
+		m11 := sqMtx[1][1]
+		return m00*m11 - m10*m01
+	}
+	var res, sgn float64 = 0, 1
+	for j := range sqMtx {
+		res += sgn * sqMtx[0][j] * det(minor(sqMtx, j))
+		sgn *= -1
+	}
+	return res
+}
+
+// MDETERM calculates the determinant of a square matrix. The
+// syntax of the function is:
+//
+//   MDETERM(array)
+//
+func (fn *formulaFuncs) MDETERM(argsList *list.List) (result string, err error) {
+	var num float64
+	var numMtx = [][]float64{}
+	var strMtx = argsList.Front().Value.(formulaArg).Matrix
+	if argsList.Len() < 1 {
+		return
+	}
+	var rows = len(strMtx)
+	for _, row := range argsList.Front().Value.(formulaArg).Matrix {
+		if len(row) != rows {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+		numRow := []float64{}
+		for _, ele := range row {
+			if num, err = strconv.ParseFloat(ele.String, 64); err != nil {
+				return
+			}
+			numRow = append(numRow, num)
+		}
+		numMtx = append(numMtx, numRow)
+	}
+	result = fmt.Sprintf("%g", det(numMtx))
+	return
+}
+
+// MOD function returns the remainder of a division between two supplied
+// numbers. The syntax of the function is:
+//
+//   MOD(number,divisor)
+//
+func (fn *formulaFuncs) MOD(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 2 {
+		err = errors.New("MOD requires 2 numeric arguments")
+		return
+	}
+	var number, divisor float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if divisor, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if divisor == 0 {
+		err = errors.New(formulaErrorDIV)
+		return
+	}
+	trunc, rem := math.Modf(number / divisor)
+	if rem < 0 {
+		trunc--
+	}
+	result = fmt.Sprintf("%g", number-divisor*trunc)
+	return
+}
+
+// MROUND function rounds a supplied number up or down to the nearest multiple
+// of a given number. The syntax of the function is:
+//
+//   MOD(number,multiple)
+//
+func (fn *formulaFuncs) MROUND(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 2 {
+		err = errors.New("MROUND requires 2 numeric arguments")
+		return
+	}
+	var number, multiple float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if multiple, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if multiple == 0 {
+		err = errors.New(formulaErrorNUM)
+		return
+	}
+	if multiple < 0 && number > 0 ||
+		multiple > 0 && number < 0 {
+		err = errors.New(formulaErrorNUM)
+		return
+	}
+	number, res := math.Modf(number / multiple)
+	if math.Trunc(res+0.5) > 0 {
+		number++
+	}
+	result = fmt.Sprintf("%g", number*multiple)
+	return
+}
+
+// MULTINOMIAL function calculates the ratio of the factorial of a sum of
+// supplied values to the product of factorials of those values. The syntax of
+// the function is:
+//
+//    MULTINOMIAL(number1,[number2],...)
+//
+func (fn *formulaFuncs) MULTINOMIAL(argsList *list.List) (result string, err error) {
+	val, num, denom := 0.0, 0.0, 1.0
+	for arg := argsList.Front(); arg != nil; arg = arg.Next() {
+		token := arg.Value.(formulaArg)
+		if token.String == "" {
+			continue
+		}
+		if val, err = strconv.ParseFloat(token.String, 64); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+		num += val
+		denom *= fact(val)
+	}
+	result = fmt.Sprintf("%g", fact(num)/denom)
+	return
+}
+
+// MUNIT function returns the unit matrix for a specified dimension. The
+// syntax of the function is:
+//
+//   MUNIT(dimension)
+//
+func (fn *formulaFuncs) MUNIT(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("MUNIT requires 1 numeric argument")
+		return
+	}
+	var dimension int
+	if dimension, err = strconv.Atoi(argsList.Front().Value.(formulaArg).String); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	matrix := make([][]float64, 0, dimension)
+	for i := 0; i < dimension; i++ {
+		row := make([]float64, dimension)
+		for j := 0; j < dimension; j++ {
+			if i == j {
+				row[j] = float64(1.0)
+			} else {
+				row[j] = float64(0.0)
+			}
+		}
+		matrix = append(matrix, row)
+	}
+	return
+}
+
+// ODD function ounds a supplied number away from zero (i.e. rounds a positive
+// number up and a negative number down), to the next odd number. The syntax
+// of the function is:
+//
+//   ODD(number)
+//
+func (fn *formulaFuncs) ODD(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ODD requires 1 numeric argument")
+		return
+	}
+	var number float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if number == 0 {
+		result = "1"
+		return
+	}
+	sign := math.Signbit(number)
+	m, frac := math.Modf((number - 1) / 2)
+	val := m*2 + 1
+	if frac != 0 {
+		if !sign {
+			val += 2
+		} else {
+			val -= 2
+		}
+	}
+	result = fmt.Sprintf("%g", val)
+	return
+}
+
+// PI function returns the value of the mathematical constant π (pi), accurate
+// to 15 digits (14 decimal places). The syntax of the function is:
+//
+//   PI()
+//
+func (fn *formulaFuncs) PI(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 0 {
+		err = errors.New("PI accepts no arguments")
+		return
+	}
+	result = fmt.Sprintf("%g", math.Pi)
+	return
+}
+
+// POWER function calculates a given number, raised to a supplied power.
+// The syntax of the function is:
+//
+//    POWER(number,power)
+//
+func (fn *formulaFuncs) POWER(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 2 {
+		err = errors.New("POWER requires 2 numeric arguments")
+		return
+	}
+	var x, y float64
+	if x, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if y, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if x == 0 && y == 0 {
+		err = errors.New(formulaErrorNUM)
+		return
+	}
+	if x == 0 && y < 0 {
+		err = errors.New(formulaErrorDIV)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Pow(x, y))
+	return
+}
+
+// PRODUCT function returns the product (multiplication) of a supplied set of
+// numerical values. The syntax of the function is:
+//
+//    PRODUCT(number1,[number2],...)
+//
+func (fn *formulaFuncs) PRODUCT(argsList *list.List) (result string, err error) {
+	val, product := 0.0, 1.0
+	for arg := argsList.Front(); arg != nil; arg = arg.Next() {
+		token := arg.Value.(formulaArg)
+		switch token.Type {
+		case ArgUnknown:
+			continue
+		case ArgString:
+			if token.String == "" {
+				continue
+			}
+			if val, err = strconv.ParseFloat(token.String, 64); err != nil {
+				err = errors.New(formulaErrorVALUE)
+				return
+			}
+			product = product * val
+		case ArgMatrix:
+			for _, row := range token.Matrix {
+				for _, value := range row {
+					if value.String == "" {
+						continue
+					}
+					if val, err = strconv.ParseFloat(value.String, 64); err != nil {
+						err = errors.New(formulaErrorVALUE)
+						return
+					}
+					product = product * val
+				}
+			}
+		}
+	}
+	result = fmt.Sprintf("%g", product)
+	return
+}
+
+// QUOTIENT function returns the integer portion of a division between two
+// supplied numbers. The syntax of the function is:
+//
+//   QUOTIENT(numerator,denominator)
+//
+func (fn *formulaFuncs) QUOTIENT(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 2 {
+		err = errors.New("QUOTIENT requires 2 numeric arguments")
+		return
+	}
+	var x, y float64
+	if x, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if y, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if y == 0 {
+		err = errors.New(formulaErrorDIV)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Trunc(x/y))
+	return
+}
+
+// RADIANS function converts radians into degrees. The syntax of the function is:
+//
+//   RADIANS(angle)
+//
+func (fn *formulaFuncs) RADIANS(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("RADIANS requires 1 numeric argument")
+		return
+	}
+	var angle float64
+	if angle, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Pi/180.0*angle)
+	return
+}
+
+// RAND function generates a random real number between 0 and 1. The syntax of
+// the function is:
+//
+//   RAND()
+//
+func (fn *formulaFuncs) RAND(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 0 {
+		err = errors.New("RAND accepts no arguments")
+		return
+	}
+	result = fmt.Sprintf("%g", rand.New(rand.NewSource(time.Now().UnixNano())).Float64())
+	return
+}
+
+// RANDBETWEEN function generates a random integer between two supplied
+// integers. The syntax of the function is:
+//
+//   RANDBETWEEN(bottom,top)
+//
+func (fn *formulaFuncs) RANDBETWEEN(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 2 {
+		err = errors.New("RANDBETWEEN requires 2 numeric arguments")
+		return
+	}
+	var bottom, top int64
+	if bottom, err = strconv.ParseInt(argsList.Front().Value.(formulaArg).String, 10, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if top, err = strconv.ParseInt(argsList.Back().Value.(formulaArg).String, 10, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if top < bottom {
+		err = errors.New(formulaErrorNUM)
+		return
+	}
+	result = fmt.Sprintf("%g", float64(rand.New(rand.NewSource(time.Now().UnixNano())).Int63n(top-bottom+1)+bottom))
+	return
+}
+
+// romanNumerals defined a numeral system that originated in ancient Rome and
+// remained the usual way of writing numbers throughout Europe well into the
+// Late Middle Ages.
+type romanNumerals struct {
+	n float64
+	s string
+}
+
+var romanTable = [][]romanNumerals{{{1000, "M"}, {900, "CM"}, {500, "D"}, {400, "CD"}, {100, "C"}, {90, "XC"}, {50, "L"}, {40, "XL"}, {10, "X"}, {9, "IX"}, {5, "V"}, {4, "IV"}, {1, "I"}},
+	{{1000, "M"}, {950, "LM"}, {900, "CM"}, {500, "D"}, {450, "LD"}, {400, "CD"}, {100, "C"}, {95, "VC"}, {90, "XC"}, {50, "L"}, {45, "VL"}, {40, "XL"}, {10, "X"}, {9, "IX"}, {5, "V"}, {4, "IV"}, {1, "I"}},
+	{{1000, "M"}, {990, "XM"}, {950, "LM"}, {900, "CM"}, {500, "D"}, {490, "XD"}, {450, "LD"}, {400, "CD"}, {100, "C"}, {99, "IC"}, {90, "XC"}, {50, "L"}, {45, "VL"}, {40, "XL"}, {10, "X"}, {9, "IX"}, {5, "V"}, {4, "IV"}, {1, "I"}},
+	{{1000, "M"}, {995, "VM"}, {990, "XM"}, {950, "LM"}, {900, "CM"}, {500, "D"}, {495, "VD"}, {490, "XD"}, {450, "LD"}, {400, "CD"}, {100, "C"}, {99, "IC"}, {90, "XC"}, {50, "L"}, {45, "VL"}, {40, "XL"}, {10, "X"}, {9, "IX"}, {5, "V"}, {4, "IV"}, {1, "I"}},
+	{{1000, "M"}, {999, "IM"}, {995, "VM"}, {990, "XM"}, {950, "LM"}, {900, "CM"}, {500, "D"}, {499, "ID"}, {495, "VD"}, {490, "XD"}, {450, "LD"}, {400, "CD"}, {100, "C"}, {99, "IC"}, {90, "XC"}, {50, "L"}, {45, "VL"}, {40, "XL"}, {10, "X"}, {9, "IX"}, {5, "V"}, {4, "IV"}, {1, "I"}}}
+
+// ROMAN function converts an arabic number to Roman. I.e. for a supplied
+// integer, the function returns a text string depicting the roman numeral
+// form of the number. The syntax of the function is:
+//
+//   ROMAN(number,[form])
+//
+func (fn *formulaFuncs) ROMAN(argsList *list.List) (result string, err error) {
+	if argsList.Len() == 0 {
+		err = errors.New("ROMAN requires at least 1 argument")
+		return
+	}
+	if argsList.Len() > 2 {
+		err = errors.New("ROMAN allows at most 2 arguments")
+		return
+	}
+	var number float64
+	var form int
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if argsList.Len() > 1 {
+		if form, err = strconv.Atoi(argsList.Back().Value.(formulaArg).String); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+		if form < 0 {
+			form = 0
+		} else if form > 4 {
+			form = 4
+		}
+	}
+	decimalTable := romanTable[0]
+	switch form {
+	case 1:
+		decimalTable = romanTable[1]
+	case 2:
+		decimalTable = romanTable[2]
+	case 3:
+		decimalTable = romanTable[3]
+	case 4:
+		decimalTable = romanTable[4]
+	}
+	val := math.Trunc(number)
+	buf := bytes.Buffer{}
+	for _, r := range decimalTable {
+		for val >= r.n {
+			buf.WriteString(r.s)
+			val -= r.n
+		}
+	}
+	result = buf.String()
+	return
+}
+
+type roundMode byte
+
+const (
+	closest roundMode = iota
+	down
+	up
+)
+
+// round rounds a supplied number up or down.
+func (fn *formulaFuncs) round(number, digits float64, mode roundMode) float64 {
+	var significance float64
+	if digits > 0 {
+		significance = math.Pow(1/10.0, digits)
+	} else {
+		significance = math.Pow(10.0, -digits)
+	}
+	val, res := math.Modf(number / significance)
+	switch mode {
+	case closest:
+		const eps = 0.499999999
+		if res >= eps {
+			val++
+		} else if res <= -eps {
+			val--
+		}
+	case down:
+	case up:
+		if res > 0 {
+			val++
+		} else if res < 0 {
+			val--
+		}
+	}
+	return val * significance
+}
+
+// ROUND function rounds a supplied number up or down, to a specified number
+// of decimal places. The syntax of the function is:
+//
+//   ROUND(number,num_digits)
+//
+func (fn *formulaFuncs) ROUND(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 2 {
+		err = errors.New("ROUND requires 2 numeric arguments")
+		return
+	}
+	var number, digits float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if digits, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", fn.round(number, digits, closest))
+	return
+}
+
+// ROUNDDOWN function rounds a supplied number down towards zero, to a
+// specified number of decimal places. The syntax of the function is:
+//
+//   ROUNDDOWN(number,num_digits)
+//
+func (fn *formulaFuncs) ROUNDDOWN(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 2 {
+		err = errors.New("ROUNDDOWN requires 2 numeric arguments")
+		return
+	}
+	var number, digits float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if digits, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", fn.round(number, digits, down))
+	return
+}
+
+// ROUNDUP function rounds a supplied number up, away from zero, to a
+// specified number of decimal places. The syntax of the function is:
+//
+//   ROUNDUP(number,num_digits)
+//
+func (fn *formulaFuncs) ROUNDUP(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 2 {
+		err = errors.New("ROUNDUP requires 2 numeric arguments")
+		return
+	}
+	var number, digits float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if digits, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", fn.round(number, digits, up))
+	return
+}
+
+// SEC function calculates the secant of a given angle. The syntax of the
+// function is:
+//
+//    SEC(number)
+//
+func (fn *formulaFuncs) SEC(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("SEC requires 1 numeric argument")
+		return
+	}
+	var number float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Cos(number))
+	return
+}
+
+// SECH function calculates the hyperbolic secant (sech) of a supplied angle.
+// The syntax of the function is:
+//
+//    SECH(number)
+//
+func (fn *formulaFuncs) SECH(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("SECH requires 1 numeric argument")
+		return
+	}
+	var number float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", 1/math.Cosh(number))
+	return
+}
+
+// SIGN function returns the arithmetic sign (+1, -1 or 0) of a supplied
+// number. I.e. if the number is positive, the Sign function returns +1, if
+// the number is negative, the function returns -1 and if the number is 0
+// (zero), the function returns 0. The syntax of the function is:
+//
+//   SIGN(number)
+//
+func (fn *formulaFuncs) SIGN(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("SIGN requires 1 numeric argument")
+		return
+	}
+	var val float64
+	if val, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if val < 0 {
+		result = "-1"
+		return
+	}
+	if val > 0 {
+		result = "1"
+		return
+	}
+	result = "0"
+	return
+}
+
+// SIN function calculates the sine of a given angle. The syntax of the
+// function is:
+//
+//    SIN(number)
+//
+func (fn *formulaFuncs) SIN(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("SIN requires 1 numeric argument")
+		return
+	}
+	var number float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Sin(number))
+	return
+}
+
+// SINH function calculates the hyperbolic sine (sinh) of a supplied number.
+// The syntax of the function is:
+//
+//    SINH(number)
+//
+func (fn *formulaFuncs) SINH(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("SINH requires 1 numeric argument")
+		return
+	}
+	var number float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Sinh(number))
+	return
+}
+
+// SQRT function calculates the positive square root of a supplied number. The
+// syntax of the function is:
+//
+//    SQRT(number)
+//
+func (fn *formulaFuncs) SQRT(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("SQRT requires 1 numeric argument")
+		return
+	}
+	var res float64
+	var value = argsList.Front().Value.(formulaArg).String
+	if value == "" {
+		result = "0"
+		return
+	}
+	if res, err = strconv.ParseFloat(value, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if res < 0 {
+		err = errors.New(formulaErrorNUM)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Sqrt(res))
+	return
+}
+
+// SQRTPI function returns the square root of a supplied number multiplied by
+// the mathematical constant, π. The syntax of the function is:
+//
+//    SQRTPI(number)
+//
+func (fn *formulaFuncs) SQRTPI(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("SQRTPI requires 1 numeric argument")
+		return
+	}
+	var number float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Sqrt(number*math.Pi))
+	return
+}
+
+// SUM function adds together a supplied set of numbers and returns the sum of
+// these values. The syntax of the function is:
+//
+//    SUM(number1,[number2],...)
+//
+func (fn *formulaFuncs) SUM(argsList *list.List) (result string, err error) {
+	var val, sum float64
+	for arg := argsList.Front(); arg != nil; arg = arg.Next() {
+		token := arg.Value.(formulaArg)
+		switch token.Type {
+		case ArgUnknown:
+			continue
+		case ArgString:
+			if token.String == "" {
+				continue
+			}
+			if val, err = strconv.ParseFloat(token.String, 64); err != nil {
+				err = errors.New(formulaErrorVALUE)
+				return
+			}
+			sum += val
+		case ArgMatrix:
+			for _, row := range token.Matrix {
+				for _, value := range row {
+					if value.String == "" {
+						continue
+					}
+					if val, err = strconv.ParseFloat(value.String, 64); err != nil {
+						err = errors.New(formulaErrorVALUE)
+						return
+					}
+					sum += val
+				}
+			}
+		}
+	}
+	result = fmt.Sprintf("%g", sum)
+	return
+}
+
+// SUMIF function finds the values in a supplied array, that satisfy a given
+// criteria, and returns the sum of the corresponding values in a second
+// supplied array. The syntax of the function is:
+//
+//    SUMIF(range,criteria,[sum_range])
+//
+func (fn *formulaFuncs) SUMIF(argsList *list.List) (result string, err error) {
+	if argsList.Len() < 2 {
+		err = errors.New("SUMIF requires at least 2 argument")
+		return
+	}
+	var criteria = formulaCriteriaParser(argsList.Front().Next().Value.(formulaArg).String)
+	var rangeMtx = argsList.Front().Value.(formulaArg).Matrix
+	var sumRange [][]formulaArg
+	if argsList.Len() == 3 {
+		sumRange = argsList.Back().Value.(formulaArg).Matrix
+	}
+	var sum, val float64
+	for rowIdx, row := range rangeMtx {
+		for colIdx, col := range row {
+			var ok bool
+			fromVal := col.String
+			if col.String == "" {
+				continue
+			}
+			if ok, err = formulaCriteriaEval(fromVal, criteria); err != nil {
+				return
+			}
+			if ok {
+				if argsList.Len() == 3 {
+					if len(sumRange) <= rowIdx || len(sumRange[rowIdx]) <= colIdx {
+						continue
+					}
+					fromVal = sumRange[rowIdx][colIdx].String
+				}
+				if val, err = strconv.ParseFloat(fromVal, 64); err != nil {
+					err = errors.New(formulaErrorVALUE)
+					return
+				}
+				sum += val
+			}
+		}
+	}
+	result = fmt.Sprintf("%g", sum)
+	return
+}
+
+// SUMSQ function returns the sum of squares of a supplied set of values. The
+// syntax of the function is:
+//
+//   SUMSQ(number1,[number2],...)
+//
+func (fn *formulaFuncs) SUMSQ(argsList *list.List) (result string, err error) {
+	var val, sq float64
+	for arg := argsList.Front(); arg != nil; arg = arg.Next() {
+		token := arg.Value.(formulaArg)
+		switch token.Type {
+		case ArgString:
+			if token.String == "" {
+				continue
+			}
+			if val, err = strconv.ParseFloat(token.String, 64); err != nil {
+				err = errors.New(formulaErrorVALUE)
+				return
+			}
+			sq += val * val
+		case ArgMatrix:
+			for _, row := range token.Matrix {
+				for _, value := range row {
+					if value.String == "" {
+						continue
+					}
+					if val, err = strconv.ParseFloat(value.String, 64); err != nil {
+						err = errors.New(formulaErrorVALUE)
+						return
+					}
+					sq += val * val
+				}
+			}
+		}
+	}
+	result = fmt.Sprintf("%g", sq)
+	return
+}
+
+// TAN function calculates the tangent of a given angle. The syntax of the
+// function is:
+//
+//    TAN(number)
+//
+func (fn *formulaFuncs) TAN(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("TAN requires 1 numeric argument")
+		return
+	}
+	var number float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Tan(number))
+	return
+}
+
+// TANH function calculates the hyperbolic tangent (tanh) of a supplied
+// number. The syntax of the function is:
+//
+//    TANH(number)
+//
+func (fn *formulaFuncs) TANH(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("TANH requires 1 numeric argument")
+		return
+	}
+	var number float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	result = fmt.Sprintf("%g", math.Tanh(number))
+	return
+}
+
+// TRUNC function truncates a supplied number to a specified number of decimal
+// places. The syntax of the function is:
+//
+//   TRUNC(number,[number_digits])
+//
+func (fn *formulaFuncs) TRUNC(argsList *list.List) (result string, err error) {
+	if argsList.Len() == 0 {
+		err = errors.New("TRUNC requires at least 1 argument")
+		return
+	}
+	var number, digits, adjust, rtrim float64
+	if number, err = strconv.ParseFloat(argsList.Front().Value.(formulaArg).String, 64); err != nil {
+		err = errors.New(formulaErrorVALUE)
+		return
+	}
+	if argsList.Len() > 1 {
+		if digits, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+		digits = math.Floor(digits)
+	}
+	adjust = math.Pow(10, digits)
+	x := int((math.Abs(number) - math.Abs(float64(int(number)))) * adjust)
+	if x != 0 {
+		if rtrim, err = strconv.ParseFloat(strings.TrimRight(strconv.Itoa(x), "0"), 64); err != nil {
+			return
+		}
+	}
+	if (digits > 0) && (rtrim < adjust/10) {
+		result = fmt.Sprintf("%g", number)
+		return
+	}
+	result = fmt.Sprintf("%g", float64(int(number*adjust))/adjust)
+	return
+}
+
+// Statistical functions
+
+// COUNTA function returns the number of non-blanks within a supplied set of
+// cells or values. The syntax of the function is:
+//
+//   COUNTA(value1,[value2],...)
+//
+func (fn *formulaFuncs) COUNTA(argsList *list.List) (result string, err error) {
+	var count int
+	for token := argsList.Front(); token != nil; token = token.Next() {
+		arg := token.Value.(formulaArg)
+		switch arg.Type {
+		case ArgString:
+			if arg.String != "" {
+				count++
+			}
+		case ArgMatrix:
+			for _, row := range arg.Matrix {
+				for _, value := range row {
+					if value.String != "" {
+						count++
+					}
+				}
+			}
+		}
+	}
+	result = fmt.Sprintf("%d", count)
+	return
+}
+
+// MEDIAN function returns the statistical median (the middle value) of a list
+// of supplied numbers. The syntax of the function is:
+//
+//   MEDIAN(number1,[number2],...)
+//
+func (fn *formulaFuncs) MEDIAN(argsList *list.List) (result string, err error) {
+	if argsList.Len() == 0 {
+		err = errors.New("MEDIAN requires at least 1 argument")
+		return
+	}
+	values := []float64{}
+	var median, digits float64
+	for token := argsList.Front(); token != nil; token = token.Next() {
+		arg := token.Value.(formulaArg)
+		switch arg.Type {
+		case ArgString:
+			if digits, err = strconv.ParseFloat(argsList.Back().Value.(formulaArg).String, 64); err != nil {
+				err = errors.New(formulaErrorVALUE)
+				return
+			}
+			values = append(values, digits)
+		case ArgMatrix:
+			for _, row := range arg.Matrix {
+				for _, value := range row {
+					if value.String == "" {
+						continue
+					}
+					if digits, err = strconv.ParseFloat(value.String, 64); err != nil {
+						err = errors.New(formulaErrorVALUE)
+						return
+					}
+					values = append(values, digits)
+				}
+			}
+		}
+	}
+	sort.Float64s(values)
+	if len(values)%2 == 0 {
+		median = (values[len(values)/2-1] + values[len(values)/2]) / 2
+	} else {
+		median = values[len(values)/2]
+	}
+	result = fmt.Sprintf("%g", median)
+	return
+}
+
+// Information functions
+
+// ISBLANK function tests if a specified cell is blank (empty) and if so,
+// returns TRUE; Otherwise the function returns FALSE. The syntax of the
+// function is:
+//
+//   ISBLANK(value)
+//
+func (fn *formulaFuncs) ISBLANK(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ISBLANK requires 1 argument")
+		return
+	}
+	token := argsList.Front().Value.(formulaArg)
+	result = "FALSE"
+	switch token.Type {
+	case ArgUnknown:
+		result = "TRUE"
+	case ArgString:
+		if token.String == "" {
+			result = "TRUE"
+		}
+	}
+	return
+}
+
+// ISERR function tests if an initial supplied expression (or value) returns
+// any Excel Error, except the #N/A error. If so, the function returns the
+// logical value TRUE; If the supplied value is not an error or is the #N/A
+// error, the ISERR function returns FALSE. The syntax of the function is:
+//
+//   ISERR(value)
+//
+func (fn *formulaFuncs) ISERR(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ISERR requires 1 argument")
+		return
+	}
+	token := argsList.Front().Value.(formulaArg)
+	result = "FALSE"
+	if token.Type == ArgString {
+		for _, errType := range []string{formulaErrorDIV, formulaErrorNAME, formulaErrorNUM, formulaErrorVALUE, formulaErrorREF, formulaErrorNULL, formulaErrorSPILL, formulaErrorCALC, formulaErrorGETTINGDATA} {
+			if errType == token.String {
+				result = "TRUE"
+			}
+		}
+	}
+	return
+}
+
+// ISERROR function tests if an initial supplied expression (or value) returns
+// an Excel Error, and if so, returns the logical value TRUE; Otherwise the
+// function returns FALSE. The syntax of the function is:
+//
+//   ISERROR(value)
+//
+func (fn *formulaFuncs) ISERROR(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ISERROR requires 1 argument")
+		return
+	}
+	token := argsList.Front().Value.(formulaArg)
+	result = "FALSE"
+	if token.Type == ArgString {
+		for _, errType := range []string{formulaErrorDIV, formulaErrorNAME, formulaErrorNA, formulaErrorNUM, formulaErrorVALUE, formulaErrorREF, formulaErrorNULL, formulaErrorSPILL, formulaErrorCALC, formulaErrorGETTINGDATA} {
+			if errType == token.String {
+				result = "TRUE"
+			}
+		}
+	}
+	return
+}
+
+// ISEVEN function tests if a supplied number (or numeric expression)
+// evaluates to an even number, and if so, returns TRUE; Otherwise, the
+// function returns FALSE. The syntax of the function is:
+//
+//   ISEVEN(value)
+//
+func (fn *formulaFuncs) ISEVEN(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ISEVEN requires 1 argument")
+		return
+	}
+	token := argsList.Front().Value.(formulaArg)
+	result = "FALSE"
+	var numeric int
+	if token.Type == ArgString {
+		if numeric, err = strconv.Atoi(token.String); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+		if numeric == numeric/2*2 {
+			result = "TRUE"
+			return
+		}
+	}
+	return
+}
+
+// ISNA function tests if an initial supplied expression (or value) returns
+// the Excel #N/A Error, and if so, returns TRUE; Otherwise the function
+// returns FALSE. The syntax of the function is:
+//
+//   ISNA(value)
+//
+func (fn *formulaFuncs) ISNA(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ISNA requires 1 argument")
+		return
+	}
+	token := argsList.Front().Value.(formulaArg)
+	result = "FALSE"
+	if token.Type == ArgString && token.String == formulaErrorNA {
+		result = "TRUE"
+	}
+	return
+}
+
+// ISNONTEXT function function tests if a supplied value is text. If not, the
+// function returns TRUE; If the supplied value is text, the function returns
+// FALSE. The syntax of the function is:
+//
+//   ISNONTEXT(value)
+//
+func (fn *formulaFuncs) ISNONTEXT(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ISNONTEXT requires 1 argument")
+		return
+	}
+	token := argsList.Front().Value.(formulaArg)
+	result = "TRUE"
+	if token.Type == ArgString && token.String != "" {
+		result = "FALSE"
+	}
+	return
+}
+
+// ISNUMBER function function tests if a supplied value is a number. If so,
+// the function returns TRUE; Otherwise it returns FALSE. The syntax of the
+// function is:
+//
+//   ISNUMBER(value)
+//
+func (fn *formulaFuncs) ISNUMBER(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ISNUMBER requires 1 argument")
+		return
+	}
+	token := argsList.Front().Value.(formulaArg)
+	result = "FALSE"
+	if token.Type == ArgString && token.String != "" {
+		if _, err = strconv.Atoi(token.String); err == nil {
+			result = "TRUE"
+		}
+		err = nil
+	}
+	return
+}
+
+// ISODD function tests if a supplied number (or numeric expression) evaluates
+// to an odd number, and if so, returns TRUE; Otherwise, the function returns
+// FALSE. The syntax of the function is:
+//
+//   ISODD(value)
+//
+func (fn *formulaFuncs) ISODD(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 1 {
+		err = errors.New("ISODD requires 1 argument")
+		return
+	}
+	token := argsList.Front().Value.(formulaArg)
+	result = "FALSE"
+	var numeric int
+	if token.Type == ArgString {
+		if numeric, err = strconv.Atoi(token.String); err != nil {
+			err = errors.New(formulaErrorVALUE)
+			return
+		}
+		if numeric != numeric/2*2 {
+			result = "TRUE"
+			return
+		}
+	}
+	return
+}
+
+// NA function returns the Excel #N/A error. This error message has the
+// meaning 'value not available' and is produced when an Excel Formula is
+// unable to find a value that it needs. The syntax of the function is:
+//
+//   NA()
+//
+func (fn *formulaFuncs) NA(argsList *list.List) (result string, err error) {
+	if argsList.Len() != 0 {
+		err = errors.New("NA accepts no arguments")
+		return
+	}
+	result = formulaErrorNA
+	return
+}

+ 78 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/calcchain.go

@@ -0,0 +1,78 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"bytes"
+	"encoding/xml"
+	"io"
+	"log"
+)
+
+// calcChainReader provides a function to get the pointer to the structure
+// after deserialization of xl/calcChain.xml.
+func (f *File) calcChainReader() *xlsxCalcChain {
+	var err error
+
+	if f.CalcChain == nil {
+		f.CalcChain = new(xlsxCalcChain)
+		if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML("xl/calcChain.xml")))).
+			Decode(f.CalcChain); err != nil && err != io.EOF {
+			log.Printf("xml decode error: %s", err)
+		}
+	}
+
+	return f.CalcChain
+}
+
+// calcChainWriter provides a function to save xl/calcChain.xml after
+// serialize structure.
+func (f *File) calcChainWriter() {
+	if f.CalcChain != nil && f.CalcChain.C != nil {
+		output, _ := xml.Marshal(f.CalcChain)
+		f.saveFileList("xl/calcChain.xml", output)
+	}
+}
+
+// deleteCalcChain provides a function to remove cell reference on the
+// calculation chain.
+func (f *File) deleteCalcChain(index int, axis string) {
+	calc := f.calcChainReader()
+	if calc != nil {
+		calc.C = xlsxCalcChainCollection(calc.C).Filter(func(c xlsxCalcChainC) bool {
+			return !((c.I == index && c.R == axis) || (c.I == index && axis == ""))
+		})
+	}
+	if len(calc.C) == 0 {
+		f.CalcChain = nil
+		delete(f.XLSX, "xl/calcChain.xml")
+		content := f.contentTypesReader()
+		for k, v := range content.Overrides {
+			if v.PartName == "/xl/calcChain.xml" {
+				content.Overrides = append(content.Overrides[:k], content.Overrides[k+1:]...)
+			}
+		}
+	}
+}
+
+type xlsxCalcChainCollection []xlsxCalcChainC
+
+// Filter provides a function to filter calculation chain.
+func (c xlsxCalcChainCollection) Filter(fn func(v xlsxCalcChainC) bool) []xlsxCalcChainC {
+	var results []xlsxCalcChainC
+	for _, v := range c {
+		if fn(v) {
+			results = append(results, v)
+		}
+	}
+	return results
+}

+ 864 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/cell.go

@@ -0,0 +1,864 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"encoding/xml"
+	"errors"
+	"fmt"
+	"reflect"
+	"strconv"
+	"strings"
+	"sync"
+	"time"
+)
+
+const (
+	// STCellFormulaTypeArray defined the formula is an array formula.
+	STCellFormulaTypeArray = "array"
+	// STCellFormulaTypeDataTable defined the formula is a data table formula.
+	STCellFormulaTypeDataTable = "dataTable"
+	// STCellFormulaTypeNormal defined the formula is a regular cell formula.
+	STCellFormulaTypeNormal = "normal"
+	// STCellFormulaTypeShared defined the formula is part of a shared formula.
+	STCellFormulaTypeShared = "shared"
+)
+
+var rwMutex sync.RWMutex
+
+// GetCellValue provides a function to get formatted value from cell by given
+// worksheet name and axis in XLSX file. If it is possible to apply a format
+// to the cell value, it will do so, if not then an error will be returned,
+// along with the raw value of the cell.
+func (f *File) GetCellValue(sheet, axis string) (string, error) {
+	return f.getCellStringFunc(sheet, axis, func(x *xlsxWorksheet, c *xlsxC) (string, bool, error) {
+		val, err := c.getValueFrom(f, f.sharedStringsReader())
+		return val, true, err
+	})
+}
+
+// SetCellValue provides a function to set value of a cell. The specified
+// coordinates should not be in the first row of the table. The following
+// shows the supported data types:
+//
+//    int
+//    int8
+//    int16
+//    int32
+//    int64
+//    uint
+//    uint8
+//    uint16
+//    uint32
+//    uint64
+//    float32
+//    float64
+//    string
+//    []byte
+//    time.Duration
+//    time.Time
+//    bool
+//    nil
+//
+// Note that default date format is m/d/yy h:mm of time.Time type value. You can
+// set numbers format by SetCellStyle() method.
+func (f *File) SetCellValue(sheet, axis string, value interface{}) error {
+	var err error
+	switch v := value.(type) {
+	case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:
+		err = f.setCellIntFunc(sheet, axis, v)
+	case float32:
+		err = f.SetCellFloat(sheet, axis, float64(v), -1, 32)
+	case float64:
+		err = f.SetCellFloat(sheet, axis, v, -1, 64)
+	case string:
+		err = f.SetCellStr(sheet, axis, v)
+	case []byte:
+		err = f.SetCellStr(sheet, axis, string(v))
+	case time.Duration:
+		_, d := setCellDuration(v)
+		err = f.SetCellDefault(sheet, axis, d)
+		if err != nil {
+			return err
+		}
+		err = f.setDefaultTimeStyle(sheet, axis, 21)
+	case time.Time:
+		err = f.setCellTimeFunc(sheet, axis, v)
+	case bool:
+		err = f.SetCellBool(sheet, axis, v)
+	case nil:
+		err = f.SetCellStr(sheet, axis, "")
+	default:
+		err = f.SetCellStr(sheet, axis, fmt.Sprint(value))
+	}
+	return err
+}
+
+// setCellIntFunc is a wrapper of SetCellInt.
+func (f *File) setCellIntFunc(sheet, axis string, value interface{}) error {
+	var err error
+	switch v := value.(type) {
+	case int:
+		err = f.SetCellInt(sheet, axis, v)
+	case int8:
+		err = f.SetCellInt(sheet, axis, int(v))
+	case int16:
+		err = f.SetCellInt(sheet, axis, int(v))
+	case int32:
+		err = f.SetCellInt(sheet, axis, int(v))
+	case int64:
+		err = f.SetCellInt(sheet, axis, int(v))
+	case uint:
+		err = f.SetCellInt(sheet, axis, int(v))
+	case uint8:
+		err = f.SetCellInt(sheet, axis, int(v))
+	case uint16:
+		err = f.SetCellInt(sheet, axis, int(v))
+	case uint32:
+		err = f.SetCellInt(sheet, axis, int(v))
+	case uint64:
+		err = f.SetCellInt(sheet, axis, int(v))
+	}
+	return err
+}
+
+// setCellTimeFunc provides a method to process time type of value for
+// SetCellValue.
+func (f *File) setCellTimeFunc(sheet, axis string, value time.Time) error {
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	cellData, col, _, err := f.prepareCell(xlsx, sheet, axis)
+	if err != nil {
+		return err
+	}
+	cellData.S = f.prepareCellStyle(xlsx, col, cellData.S)
+
+	var isNum bool
+	cellData.T, cellData.V, isNum, err = setCellTime(value)
+	if err != nil {
+		return err
+	}
+	if isNum {
+		err = f.setDefaultTimeStyle(sheet, axis, 22)
+		if err != nil {
+			return err
+		}
+	}
+	return err
+}
+
+func setCellTime(value time.Time) (t string, b string, isNum bool, err error) {
+	var excelTime float64
+	excelTime, err = timeToExcelTime(value)
+	if err != nil {
+		return
+	}
+	isNum = excelTime > 0
+	if isNum {
+		t, b = setCellDefault(strconv.FormatFloat(excelTime, 'f', -1, 64))
+	} else {
+		t, b = setCellDefault(value.Format(time.RFC3339Nano))
+	}
+	return
+}
+
+func setCellDuration(value time.Duration) (t string, v string) {
+	v = strconv.FormatFloat(value.Seconds()/86400.0, 'f', -1, 32)
+	return
+}
+
+// SetCellInt provides a function to set int type value of a cell by given
+// worksheet name, cell coordinates and cell value.
+func (f *File) SetCellInt(sheet, axis string, value int) error {
+	rwMutex.Lock()
+	defer rwMutex.Unlock()
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	cellData, col, _, err := f.prepareCell(xlsx, sheet, axis)
+	if err != nil {
+		return err
+	}
+	cellData.S = f.prepareCellStyle(xlsx, col, cellData.S)
+	cellData.T, cellData.V = setCellInt(value)
+	return err
+}
+
+func setCellInt(value int) (t string, v string) {
+	v = strconv.Itoa(value)
+	return
+}
+
+// SetCellBool provides a function to set bool type value of a cell by given
+// worksheet name, cell name and cell value.
+func (f *File) SetCellBool(sheet, axis string, value bool) error {
+	rwMutex.Lock()
+	defer rwMutex.Unlock()
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	cellData, col, _, err := f.prepareCell(xlsx, sheet, axis)
+	if err != nil {
+		return err
+	}
+	cellData.S = f.prepareCellStyle(xlsx, col, cellData.S)
+	cellData.T, cellData.V = setCellBool(value)
+	return err
+}
+
+func setCellBool(value bool) (t string, v string) {
+	t = "b"
+	if value {
+		v = "1"
+	} else {
+		v = "0"
+	}
+	return
+}
+
+// SetCellFloat sets a floating point value into a cell. The prec parameter
+// specifies how many places after the decimal will be shown while -1 is a
+// special value that will use as many decimal places as necessary to
+// represent the number. bitSize is 32 or 64 depending on if a float32 or
+// float64 was originally used for the value. For Example:
+//
+//    var x float32 = 1.325
+//    f.SetCellFloat("Sheet1", "A1", float64(x), 2, 32)
+//
+func (f *File) SetCellFloat(sheet, axis string, value float64, prec, bitSize int) error {
+	rwMutex.Lock()
+	defer rwMutex.Unlock()
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	cellData, col, _, err := f.prepareCell(xlsx, sheet, axis)
+	if err != nil {
+		return err
+	}
+	cellData.S = f.prepareCellStyle(xlsx, col, cellData.S)
+	cellData.T, cellData.V = setCellFloat(value, prec, bitSize)
+	return err
+}
+
+func setCellFloat(value float64, prec, bitSize int) (t string, v string) {
+	v = strconv.FormatFloat(value, 'f', prec, bitSize)
+	return
+}
+
+// SetCellStr provides a function to set string type value of a cell. Total
+// number of characters that a cell can contain 32767 characters.
+func (f *File) SetCellStr(sheet, axis, value string) error {
+	rwMutex.Lock()
+	defer rwMutex.Unlock()
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	cellData, col, _, err := f.prepareCell(xlsx, sheet, axis)
+	if err != nil {
+		return err
+	}
+	cellData.S = f.prepareCellStyle(xlsx, col, cellData.S)
+	cellData.T, cellData.V = f.setCellString(value)
+	return err
+}
+
+// setCellString provides a function to set string type to shared string
+// table.
+func (f *File) setCellString(value string) (t string, v string) {
+	if len(value) > TotalCellChars {
+		value = value[0:TotalCellChars]
+	}
+	t = "s"
+	v = strconv.Itoa(f.setSharedString(value))
+	return
+}
+
+// setSharedString provides a function to add string to the share string table.
+func (f *File) setSharedString(val string) int {
+	sst := f.sharedStringsReader()
+	if i, ok := f.sharedStringsMap[val]; ok {
+		return i
+	}
+	sst.Count++
+	sst.UniqueCount++
+	t := xlsxT{Val: val}
+	// Leading and ending space(s) character detection.
+	if len(val) > 0 && (val[0] == 32 || val[len(val)-1] == 32) {
+		ns := xml.Attr{
+			Name:  xml.Name{Space: NameSpaceXML, Local: "space"},
+			Value: "preserve",
+		}
+		t.Space = ns
+	}
+	sst.SI = append(sst.SI, xlsxSI{T: &t})
+	f.sharedStringsMap[val] = sst.UniqueCount - 1
+	return sst.UniqueCount - 1
+}
+
+// setCellStr provides a function to set string type to cell.
+func setCellStr(value string) (t string, v string, ns xml.Attr) {
+	if len(value) > TotalCellChars {
+		value = value[0:TotalCellChars]
+	}
+	// Leading and ending space(s) character detection.
+	if len(value) > 0 && (value[0] == 32 || value[len(value)-1] == 32) {
+		ns = xml.Attr{
+			Name:  xml.Name{Space: NameSpaceXML, Local: "space"},
+			Value: "preserve",
+		}
+	}
+	t = "str"
+	v = value
+	return
+}
+
+// SetCellDefault provides a function to set string type value of a cell as
+// default format without escaping the cell.
+func (f *File) SetCellDefault(sheet, axis, value string) error {
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	cellData, col, _, err := f.prepareCell(xlsx, sheet, axis)
+	if err != nil {
+		return err
+	}
+	cellData.S = f.prepareCellStyle(xlsx, col, cellData.S)
+	cellData.T, cellData.V = setCellDefault(value)
+	return err
+}
+
+func setCellDefault(value string) (t string, v string) {
+	v = value
+	return
+}
+
+// GetCellFormula provides a function to get formula from cell by given
+// worksheet name and axis in XLSX file.
+func (f *File) GetCellFormula(sheet, axis string) (string, error) {
+	return f.getCellStringFunc(sheet, axis, func(x *xlsxWorksheet, c *xlsxC) (string, bool, error) {
+		if c.F == nil {
+			return "", false, nil
+		}
+		if c.F.T == STCellFormulaTypeShared {
+			return getSharedForumula(x, c.F.Si), true, nil
+		}
+		return c.F.Content, true, nil
+	})
+}
+
+// FormulaOpts can be passed to SetCellFormula to use other formula types.
+type FormulaOpts struct {
+	Type *string // Formula type
+	Ref  *string // Shared formula ref
+}
+
+// SetCellFormula provides a function to set cell formula by given string and
+// worksheet name.
+func (f *File) SetCellFormula(sheet, axis, formula string, opts ...FormulaOpts) error {
+	rwMutex.Lock()
+	defer rwMutex.Unlock()
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	cellData, _, _, err := f.prepareCell(xlsx, sheet, axis)
+	if err != nil {
+		return err
+	}
+	if formula == "" {
+		cellData.F = nil
+		f.deleteCalcChain(f.getSheetID(sheet), axis)
+		return err
+	}
+
+	if cellData.F != nil {
+		cellData.F.Content = formula
+	} else {
+		cellData.F = &xlsxF{Content: formula}
+	}
+
+	for _, o := range opts {
+		if o.Type != nil {
+			cellData.F.T = *o.Type
+		}
+
+		if o.Ref != nil {
+			cellData.F.Ref = *o.Ref
+		}
+	}
+
+	return err
+}
+
+// GetCellHyperLink provides a function to get cell hyperlink by given
+// worksheet name and axis. Boolean type value link will be ture if the cell
+// has a hyperlink and the target is the address of the hyperlink. Otherwise,
+// the value of link will be false and the value of the target will be a blank
+// string. For example get hyperlink of Sheet1!H6:
+//
+//    link, target, err := f.GetCellHyperLink("Sheet1", "H6")
+//
+func (f *File) GetCellHyperLink(sheet, axis string) (bool, string, error) {
+	// Check for correct cell name
+	if _, _, err := SplitCellName(axis); err != nil {
+		return false, "", err
+	}
+
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return false, "", err
+	}
+	axis, err = f.mergeCellsParser(xlsx, axis)
+	if err != nil {
+		return false, "", err
+	}
+	if xlsx.Hyperlinks != nil {
+		for _, link := range xlsx.Hyperlinks.Hyperlink {
+			if link.Ref == axis {
+				if link.RID != "" {
+					return true, f.getSheetRelationshipsTargetByID(sheet, link.RID), err
+				}
+				return true, link.Location, err
+			}
+		}
+	}
+	return false, "", err
+}
+
+// SetCellHyperLink provides a function to set cell hyperlink by given
+// worksheet name and link URL address. LinkType defines two types of
+// hyperlink "External" for web site or "Location" for moving to one of cell
+// in this workbook. Maximum limit hyperlinks in a worksheet is 65530. The
+// below is example for external link.
+//
+//    err := f.SetCellHyperLink("Sheet1", "A3", "https://github.com/360EntSecGroup-Skylar/excelize", "External")
+//    // Set underline and font color style for the cell.
+//    style, err := f.NewStyle(`{"font":{"color":"#1265BE","underline":"single"}}`)
+//    err = f.SetCellStyle("Sheet1", "A3", "A3", style)
+//
+// A this is another example for "Location":
+//
+//    err := f.SetCellHyperLink("Sheet1", "A3", "Sheet1!A40", "Location")
+//
+func (f *File) SetCellHyperLink(sheet, axis, link, linkType string) error {
+	// Check for correct cell name
+	if _, _, err := SplitCellName(axis); err != nil {
+		return err
+	}
+
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	axis, err = f.mergeCellsParser(xlsx, axis)
+	if err != nil {
+		return err
+	}
+
+	var linkData xlsxHyperlink
+
+	if xlsx.Hyperlinks == nil {
+		xlsx.Hyperlinks = new(xlsxHyperlinks)
+	}
+
+	if len(xlsx.Hyperlinks.Hyperlink) > TotalSheetHyperlinks {
+		return errors.New("over maximum limit hyperlinks in a worksheet")
+	}
+
+	switch linkType {
+	case "External":
+		linkData = xlsxHyperlink{
+			Ref: axis,
+		}
+		sheetPath := f.sheetMap[trimSheetName(sheet)]
+		sheetRels := "xl/worksheets/_rels/" + strings.TrimPrefix(sheetPath, "xl/worksheets/") + ".rels"
+		rID := f.addRels(sheetRels, SourceRelationshipHyperLink, link, linkType)
+		linkData.RID = "rId" + strconv.Itoa(rID)
+		f.addSheetNameSpace(sheet, SourceRelationship)
+	case "Location":
+		linkData = xlsxHyperlink{
+			Ref:      axis,
+			Location: link,
+		}
+	default:
+		return fmt.Errorf("invalid link type %q", linkType)
+	}
+
+	xlsx.Hyperlinks.Hyperlink = append(xlsx.Hyperlinks.Hyperlink, linkData)
+	return nil
+}
+
+// SetCellRichText provides a function to set cell with rich text by given
+// worksheet. For example, set rich text on the A1 cell of the worksheet named
+// Sheet1:
+//
+//    package main
+//
+//    import (
+//        "fmt"
+//
+//        "github.com/360EntSecGroup-Skylar/excelize"
+//    )
+//
+//    func main() {
+//        f := excelize.NewFile()
+//        if err := f.SetRowHeight("Sheet1", 1, 35); err != nil {
+//            fmt.Println(err)
+//            return
+//        }
+//        if err := f.SetColWidth("Sheet1", "A", "A", 44); err != nil {
+//            fmt.Println(err)
+//            return
+//        }
+//        if err := f.SetCellRichText("Sheet1", "A1", []excelize.RichTextRun{
+//            {
+//                Text: "blod",
+//                Font: &excelize.Font{
+//                    Bold:   true,
+//                    Color:  "2354e8",
+//                    Family: "Times New Roman",
+//                },
+//            },
+//            {
+//                Text: " and ",
+//                Font: &excelize.Font{
+//                    Family: "Times New Roman",
+//                },
+//            },
+//            {
+//                Text: " italic",
+//                Font: &excelize.Font{
+//                    Bold:   true,
+//                    Color:  "e83723",
+//                    Italic: true,
+//                    Family: "Times New Roman",
+//                },
+//            },
+//            {
+//                Text: "text with color and font-family,",
+//                Font: &excelize.Font{
+//                    Bold:   true,
+//                    Color:  "2354e8",
+//                    Family: "Times New Roman",
+//                },
+//            },
+//            {
+//                Text: "\r\nlarge text with ",
+//                Font: &excelize.Font{
+//                    Size:  14,
+//                    Color: "ad23e8",
+//                },
+//            },
+//            {
+//                Text: "strike",
+//                Font: &excelize.Font{
+//                    Color:  "e89923",
+//                    Strike: true,
+//                },
+//            },
+//            {
+//                Text: " and ",
+//                Font: &excelize.Font{
+//                    Size:  14,
+//                    Color: "ad23e8",
+//                },
+//            },
+//            {
+//                Text: "underline.",
+//                Font: &excelize.Font{
+//                    Color:     "23e833",
+//                    Underline: "single",
+//                },
+//            },
+//        }); err != nil {
+//            fmt.Println(err)
+//            return
+//        }
+//        style, err := f.NewStyle(&excelize.Style{
+//            Alignment: &excelize.Alignment{
+//                WrapText: true,
+//            },
+//        })
+//        if err != nil {
+//            fmt.Println(err)
+//            return
+//        }
+//        if err := f.SetCellStyle("Sheet1", "A1", "A1", style); err != nil {
+//            fmt.Println(err)
+//            return
+//        }
+//        if err := f.SaveAs("Book1.xlsx"); err != nil {
+//            fmt.Println(err)
+//        }
+//    }
+//
+func (f *File) SetCellRichText(sheet, cell string, runs []RichTextRun) error {
+	ws, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	cellData, col, _, err := f.prepareCell(ws, sheet, cell)
+	if err != nil {
+		return err
+	}
+	cellData.S = f.prepareCellStyle(ws, col, cellData.S)
+	si := xlsxSI{}
+	sst := f.sharedStringsReader()
+	textRuns := []xlsxR{}
+	for _, textRun := range runs {
+		run := xlsxR{T: &xlsxT{Val: textRun.Text}}
+		if strings.ContainsAny(textRun.Text, "\r\n ") {
+			run.T.Space = xml.Attr{Name: xml.Name{Space: NameSpaceXML, Local: "space"}, Value: "preserve"}
+		}
+		fnt := textRun.Font
+		if fnt != nil {
+			rpr := xlsxRPr{}
+			if fnt.Bold {
+				rpr.B = " "
+			}
+			if fnt.Italic {
+				rpr.I = " "
+			}
+			if fnt.Strike {
+				rpr.Strike = " "
+			}
+			if fnt.Underline != "" {
+				rpr.U = &attrValString{Val: &fnt.Underline}
+			}
+			if fnt.Family != "" {
+				rpr.RFont = &attrValString{Val: &fnt.Family}
+			}
+			if fnt.Size > 0.0 {
+				rpr.Sz = &attrValFloat{Val: &fnt.Size}
+			}
+			if fnt.Color != "" {
+				rpr.Color = &xlsxColor{RGB: getPaletteColor(fnt.Color)}
+			}
+			run.RPr = &rpr
+		}
+		textRuns = append(textRuns, run)
+	}
+	si.R = textRuns
+	sst.SI = append(sst.SI, si)
+	sst.Count++
+	sst.UniqueCount++
+	cellData.T, cellData.V = "s", strconv.Itoa(len(sst.SI)-1)
+	return err
+}
+
+// SetSheetRow writes an array to row by given worksheet name, starting
+// coordinate and a pointer to array type 'slice'. For example, writes an
+// array to row 6 start with the cell B6 on Sheet1:
+//
+//     err := f.SetSheetRow("Sheet1", "B6", &[]interface{}{"1", nil, 2})
+//
+func (f *File) SetSheetRow(sheet, axis string, slice interface{}) error {
+	col, row, err := CellNameToCoordinates(axis)
+	if err != nil {
+		return err
+	}
+
+	// Make sure 'slice' is a Ptr to Slice
+	v := reflect.ValueOf(slice)
+	if v.Kind() != reflect.Ptr || v.Elem().Kind() != reflect.Slice {
+		return errors.New("pointer to slice expected")
+	}
+	v = v.Elem()
+
+	for i := 0; i < v.Len(); i++ {
+		cell, err := CoordinatesToCellName(col+i, row)
+		// Error should never happens here. But keep checking to early detect regresions
+		// if it will be introduced in future.
+		if err != nil {
+			return err
+		}
+		if err := f.SetCellValue(sheet, cell, v.Index(i).Interface()); err != nil {
+			return err
+		}
+	}
+	return err
+}
+
+// getCellInfo does common preparation for all SetCell* methods.
+func (f *File) prepareCell(xlsx *xlsxWorksheet, sheet, cell string) (*xlsxC, int, int, error) {
+	var err error
+	cell, err = f.mergeCellsParser(xlsx, cell)
+	if err != nil {
+		return nil, 0, 0, err
+	}
+	col, row, err := CellNameToCoordinates(cell)
+	if err != nil {
+		return nil, 0, 0, err
+	}
+
+	prepareSheetXML(xlsx, col, row)
+
+	return &xlsx.SheetData.Row[row-1].C[col-1], col, row, err
+}
+
+// getCellStringFunc does common value extraction workflow for all GetCell*
+// methods. Passed function implements specific part of required logic.
+func (f *File) getCellStringFunc(sheet, axis string, fn func(x *xlsxWorksheet, c *xlsxC) (string, bool, error)) (string, error) {
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return "", err
+	}
+	axis, err = f.mergeCellsParser(xlsx, axis)
+	if err != nil {
+		return "", err
+	}
+	_, row, err := CellNameToCoordinates(axis)
+	if err != nil {
+		return "", err
+	}
+
+	lastRowNum := 0
+	if l := len(xlsx.SheetData.Row); l > 0 {
+		lastRowNum = xlsx.SheetData.Row[l-1].R
+	}
+
+	// keep in mind: row starts from 1
+	if row > lastRowNum {
+		return "", nil
+	}
+
+	for rowIdx := range xlsx.SheetData.Row {
+		rowData := &xlsx.SheetData.Row[rowIdx]
+		if rowData.R != row {
+			continue
+		}
+		for colIdx := range rowData.C {
+			colData := &rowData.C[colIdx]
+			if axis != colData.R {
+				continue
+			}
+			val, ok, err := fn(xlsx, colData)
+			if err != nil {
+				return "", err
+			}
+			if ok {
+				return val, nil
+			}
+		}
+	}
+	return "", nil
+}
+
+// formattedValue provides a function to returns a value after formatted. If
+// it is possible to apply a format to the cell value, it will do so, if not
+// then an error will be returned, along with the raw value of the cell.
+func (f *File) formattedValue(s int, v string) string {
+	if s == 0 {
+		return v
+	}
+	styleSheet := f.stylesReader()
+	ok := builtInNumFmtFunc[*styleSheet.CellXfs.Xf[s].NumFmtID]
+	if ok != nil {
+		return ok(*styleSheet.CellXfs.Xf[s].NumFmtID, v)
+	}
+	return v
+}
+
+// prepareCellStyle provides a function to prepare style index of cell in
+// worksheet by given column index and style index.
+func (f *File) prepareCellStyle(xlsx *xlsxWorksheet, col, style int) int {
+	if xlsx.Cols != nil && style == 0 {
+		for _, c := range xlsx.Cols.Col {
+			if c.Min <= col && col <= c.Max {
+				style = c.Style
+			}
+		}
+	}
+	return style
+}
+
+// mergeCellsParser provides a function to check merged cells in worksheet by
+// given axis.
+func (f *File) mergeCellsParser(xlsx *xlsxWorksheet, axis string) (string, error) {
+	axis = strings.ToUpper(axis)
+	if xlsx.MergeCells != nil {
+		for i := 0; i < len(xlsx.MergeCells.Cells); i++ {
+			ok, err := f.checkCellInArea(axis, xlsx.MergeCells.Cells[i].Ref)
+			if err != nil {
+				return axis, err
+			}
+			if ok {
+				axis = strings.Split(xlsx.MergeCells.Cells[i].Ref, ":")[0]
+			}
+		}
+	}
+	return axis, nil
+}
+
+// checkCellInArea provides a function to determine if a given coordinate is
+// within an area.
+func (f *File) checkCellInArea(cell, area string) (bool, error) {
+	col, row, err := CellNameToCoordinates(cell)
+	if err != nil {
+		return false, err
+	}
+
+	rng := strings.Split(area, ":")
+	if len(rng) != 2 {
+		return false, err
+	}
+	coordinates, err := f.areaRefToCoordinates(area)
+	if err != nil {
+		return false, err
+	}
+
+	return cellInRef([]int{col, row}, coordinates), err
+}
+
+// cellInRef provides a function to determine if a given range is within an
+// range.
+func cellInRef(cell, ref []int) bool {
+	return cell[0] >= ref[0] && cell[0] <= ref[2] && cell[1] >= ref[1] && cell[1] <= ref[3]
+}
+
+// isOverlap find if the given two rectangles overlap or not.
+func isOverlap(rect1, rect2 []int) bool {
+	return cellInRef([]int{rect1[0], rect1[1]}, rect2) ||
+		cellInRef([]int{rect1[2], rect1[1]}, rect2) ||
+		cellInRef([]int{rect1[0], rect1[3]}, rect2) ||
+		cellInRef([]int{rect1[2], rect1[3]}, rect2) ||
+		cellInRef([]int{rect2[0], rect2[1]}, rect1) ||
+		cellInRef([]int{rect2[2], rect2[1]}, rect1) ||
+		cellInRef([]int{rect2[0], rect2[3]}, rect1) ||
+		cellInRef([]int{rect2[2], rect2[3]}, rect1)
+}
+
+// getSharedForumula find a cell contains the same formula as another cell,
+// the "shared" value can be used for the t attribute and the si attribute can
+// be used to refer to the cell containing the formula. Two formulas are
+// considered to be the same when their respective representations in
+// R1C1-reference notation, are the same.
+//
+// Note that this function not validate ref tag to check the cell if or not in
+// allow area, and always return origin shared formula.
+func getSharedForumula(xlsx *xlsxWorksheet, si string) string {
+	for _, r := range xlsx.SheetData.Row {
+		for _, c := range r.C {
+			if c.F != nil && c.F.Ref != "" && c.F.T == STCellFormulaTypeShared && c.F.Si == si {
+				return c.F.Content
+			}
+		}
+	}
+	return ""
+}

+ 877 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/chart.go

@@ -0,0 +1,877 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"encoding/json"
+	"encoding/xml"
+	"errors"
+	"fmt"
+	"strconv"
+	"strings"
+)
+
+// This section defines the currently supported chart types.
+const (
+	Area                        = "area"
+	AreaStacked                 = "areaStacked"
+	AreaPercentStacked          = "areaPercentStacked"
+	Area3D                      = "area3D"
+	Area3DStacked               = "area3DStacked"
+	Area3DPercentStacked        = "area3DPercentStacked"
+	Bar                         = "bar"
+	BarStacked                  = "barStacked"
+	BarPercentStacked           = "barPercentStacked"
+	Bar3DClustered              = "bar3DClustered"
+	Bar3DStacked                = "bar3DStacked"
+	Bar3DPercentStacked         = "bar3DPercentStacked"
+	Bar3DConeClustered          = "bar3DConeClustered"
+	Bar3DConeStacked            = "bar3DConeStacked"
+	Bar3DConePercentStacked     = "bar3DConePercentStacked"
+	Bar3DPyramidClustered       = "bar3DPyramidClustered"
+	Bar3DPyramidStacked         = "bar3DPyramidStacked"
+	Bar3DPyramidPercentStacked  = "bar3DPyramidPercentStacked"
+	Bar3DCylinderClustered      = "bar3DCylinderClustered"
+	Bar3DCylinderStacked        = "bar3DCylinderStacked"
+	Bar3DCylinderPercentStacked = "bar3DCylinderPercentStacked"
+	Col                         = "col"
+	ColStacked                  = "colStacked"
+	ColPercentStacked           = "colPercentStacked"
+	Col3D                       = "col3D"
+	Col3DClustered              = "col3DClustered"
+	Col3DStacked                = "col3DStacked"
+	Col3DPercentStacked         = "col3DPercentStacked"
+	Col3DCone                   = "col3DCone"
+	Col3DConeClustered          = "col3DConeClustered"
+	Col3DConeStacked            = "col3DConeStacked"
+	Col3DConePercentStacked     = "col3DConePercentStacked"
+	Col3DPyramid                = "col3DPyramid"
+	Col3DPyramidClustered       = "col3DPyramidClustered"
+	Col3DPyramidStacked         = "col3DPyramidStacked"
+	Col3DPyramidPercentStacked  = "col3DPyramidPercentStacked"
+	Col3DCylinder               = "col3DCylinder"
+	Col3DCylinderClustered      = "col3DCylinderClustered"
+	Col3DCylinderStacked        = "col3DCylinderStacked"
+	Col3DCylinderPercentStacked = "col3DCylinderPercentStacked"
+	Doughnut                    = "doughnut"
+	Line                        = "line"
+	Pie                         = "pie"
+	Pie3D                       = "pie3D"
+	PieOfPieChart               = "pieOfPie"
+	BarOfPieChart               = "barOfPie"
+	Radar                       = "radar"
+	Scatter                     = "scatter"
+	Surface3D                   = "surface3D"
+	WireframeSurface3D          = "wireframeSurface3D"
+	Contour                     = "contour"
+	WireframeContour            = "wireframeContour"
+	Bubble                      = "bubble"
+	Bubble3D                    = "bubble3D"
+)
+
+// This section defines the default value of chart properties.
+var (
+	chartView3DRotX = map[string]int{
+		Area:                        0,
+		AreaStacked:                 0,
+		AreaPercentStacked:          0,
+		Area3D:                      15,
+		Area3DStacked:               15,
+		Area3DPercentStacked:        15,
+		Bar:                         0,
+		BarStacked:                  0,
+		BarPercentStacked:           0,
+		Bar3DClustered:              15,
+		Bar3DStacked:                15,
+		Bar3DPercentStacked:         15,
+		Bar3DConeClustered:          15,
+		Bar3DConeStacked:            15,
+		Bar3DConePercentStacked:     15,
+		Bar3DPyramidClustered:       15,
+		Bar3DPyramidStacked:         15,
+		Bar3DPyramidPercentStacked:  15,
+		Bar3DCylinderClustered:      15,
+		Bar3DCylinderStacked:        15,
+		Bar3DCylinderPercentStacked: 15,
+		Col:                         0,
+		ColStacked:                  0,
+		ColPercentStacked:           0,
+		Col3D:                       15,
+		Col3DClustered:              15,
+		Col3DStacked:                15,
+		Col3DPercentStacked:         15,
+		Col3DCone:                   15,
+		Col3DConeClustered:          15,
+		Col3DConeStacked:            15,
+		Col3DConePercentStacked:     15,
+		Col3DPyramid:                15,
+		Col3DPyramidClustered:       15,
+		Col3DPyramidStacked:         15,
+		Col3DPyramidPercentStacked:  15,
+		Col3DCylinder:               15,
+		Col3DCylinderClustered:      15,
+		Col3DCylinderStacked:        15,
+		Col3DCylinderPercentStacked: 15,
+		Doughnut:                    0,
+		Line:                        0,
+		Pie:                         0,
+		Pie3D:                       30,
+		PieOfPieChart:               0,
+		BarOfPieChart:               0,
+		Radar:                       0,
+		Scatter:                     0,
+		Surface3D:                   15,
+		WireframeSurface3D:          15,
+		Contour:                     90,
+		WireframeContour:            90,
+	}
+	chartView3DRotY = map[string]int{
+		Area:                        0,
+		AreaStacked:                 0,
+		AreaPercentStacked:          0,
+		Area3D:                      20,
+		Area3DStacked:               20,
+		Area3DPercentStacked:        20,
+		Bar:                         0,
+		BarStacked:                  0,
+		BarPercentStacked:           0,
+		Bar3DClustered:              20,
+		Bar3DStacked:                20,
+		Bar3DPercentStacked:         20,
+		Bar3DConeClustered:          20,
+		Bar3DConeStacked:            20,
+		Bar3DConePercentStacked:     20,
+		Bar3DPyramidClustered:       20,
+		Bar3DPyramidStacked:         20,
+		Bar3DPyramidPercentStacked:  20,
+		Bar3DCylinderClustered:      20,
+		Bar3DCylinderStacked:        20,
+		Bar3DCylinderPercentStacked: 20,
+		Col:                         0,
+		ColStacked:                  0,
+		ColPercentStacked:           0,
+		Col3D:                       20,
+		Col3DClustered:              20,
+		Col3DStacked:                20,
+		Col3DPercentStacked:         20,
+		Col3DCone:                   20,
+		Col3DConeClustered:          20,
+		Col3DConeStacked:            20,
+		Col3DConePercentStacked:     20,
+		Col3DPyramid:                20,
+		Col3DPyramidClustered:       20,
+		Col3DPyramidStacked:         20,
+		Col3DPyramidPercentStacked:  20,
+		Col3DCylinder:               20,
+		Col3DCylinderClustered:      20,
+		Col3DCylinderStacked:        20,
+		Col3DCylinderPercentStacked: 20,
+		Doughnut:                    0,
+		Line:                        0,
+		Pie:                         0,
+		Pie3D:                       0,
+		PieOfPieChart:               0,
+		BarOfPieChart:               0,
+		Radar:                       0,
+		Scatter:                     0,
+		Surface3D:                   20,
+		WireframeSurface3D:          20,
+		Contour:                     0,
+		WireframeContour:            0,
+	}
+	plotAreaChartOverlap = map[string]int{
+		BarStacked:        100,
+		BarPercentStacked: 100,
+		ColStacked:        100,
+		ColPercentStacked: 100,
+	}
+	chartView3DPerspective = map[string]int{
+		Contour:          0,
+		WireframeContour: 0,
+	}
+	chartView3DRAngAx = map[string]int{
+		Area:                        0,
+		AreaStacked:                 0,
+		AreaPercentStacked:          0,
+		Area3D:                      1,
+		Area3DStacked:               1,
+		Area3DPercentStacked:        1,
+		Bar:                         0,
+		BarStacked:                  0,
+		BarPercentStacked:           0,
+		Bar3DClustered:              1,
+		Bar3DStacked:                1,
+		Bar3DPercentStacked:         1,
+		Bar3DConeClustered:          1,
+		Bar3DConeStacked:            1,
+		Bar3DConePercentStacked:     1,
+		Bar3DPyramidClustered:       1,
+		Bar3DPyramidStacked:         1,
+		Bar3DPyramidPercentStacked:  1,
+		Bar3DCylinderClustered:      1,
+		Bar3DCylinderStacked:        1,
+		Bar3DCylinderPercentStacked: 1,
+		Col:                         0,
+		ColStacked:                  0,
+		ColPercentStacked:           0,
+		Col3D:                       1,
+		Col3DClustered:              1,
+		Col3DStacked:                1,
+		Col3DPercentStacked:         1,
+		Col3DCone:                   1,
+		Col3DConeClustered:          1,
+		Col3DConeStacked:            1,
+		Col3DConePercentStacked:     1,
+		Col3DPyramid:                1,
+		Col3DPyramidClustered:       1,
+		Col3DPyramidStacked:         1,
+		Col3DPyramidPercentStacked:  1,
+		Col3DCylinder:               1,
+		Col3DCylinderClustered:      1,
+		Col3DCylinderStacked:        1,
+		Col3DCylinderPercentStacked: 1,
+		Doughnut:                    0,
+		Line:                        0,
+		Pie:                         0,
+		Pie3D:                       0,
+		PieOfPieChart:               0,
+		BarOfPieChart:               0,
+		Radar:                       0,
+		Scatter:                     0,
+		Surface3D:                   0,
+		WireframeSurface3D:          0,
+		Contour:                     0,
+		Bubble:                      0,
+		Bubble3D:                    0,
+	}
+	chartLegendPosition = map[string]string{
+		"bottom":    "b",
+		"left":      "l",
+		"right":     "r",
+		"top":       "t",
+		"top_right": "tr",
+	}
+	chartValAxNumFmtFormatCode = map[string]string{
+		Area:                        "General",
+		AreaStacked:                 "General",
+		AreaPercentStacked:          "0%",
+		Area3D:                      "General",
+		Area3DStacked:               "General",
+		Area3DPercentStacked:        "0%",
+		Bar:                         "General",
+		BarStacked:                  "General",
+		BarPercentStacked:           "0%",
+		Bar3DClustered:              "General",
+		Bar3DStacked:                "General",
+		Bar3DPercentStacked:         "0%",
+		Bar3DConeClustered:          "General",
+		Bar3DConeStacked:            "General",
+		Bar3DConePercentStacked:     "0%",
+		Bar3DPyramidClustered:       "General",
+		Bar3DPyramidStacked:         "General",
+		Bar3DPyramidPercentStacked:  "0%",
+		Bar3DCylinderClustered:      "General",
+		Bar3DCylinderStacked:        "General",
+		Bar3DCylinderPercentStacked: "0%",
+		Col:                         "General",
+		ColStacked:                  "General",
+		ColPercentStacked:           "0%",
+		Col3D:                       "General",
+		Col3DClustered:              "General",
+		Col3DStacked:                "General",
+		Col3DPercentStacked:         "0%",
+		Col3DCone:                   "General",
+		Col3DConeClustered:          "General",
+		Col3DConeStacked:            "General",
+		Col3DConePercentStacked:     "0%",
+		Col3DPyramid:                "General",
+		Col3DPyramidClustered:       "General",
+		Col3DPyramidStacked:         "General",
+		Col3DPyramidPercentStacked:  "0%",
+		Col3DCylinder:               "General",
+		Col3DCylinderClustered:      "General",
+		Col3DCylinderStacked:        "General",
+		Col3DCylinderPercentStacked: "0%",
+		Doughnut:                    "General",
+		Line:                        "General",
+		Pie:                         "General",
+		Pie3D:                       "General",
+		PieOfPieChart:               "General",
+		BarOfPieChart:               "General",
+		Radar:                       "General",
+		Scatter:                     "General",
+		Surface3D:                   "General",
+		WireframeSurface3D:          "General",
+		Contour:                     "General",
+		WireframeContour:            "General",
+		Bubble:                      "General",
+		Bubble3D:                    "General",
+	}
+	chartValAxCrossBetween = map[string]string{
+		Area:                        "midCat",
+		AreaStacked:                 "midCat",
+		AreaPercentStacked:          "midCat",
+		Area3D:                      "midCat",
+		Area3DStacked:               "midCat",
+		Area3DPercentStacked:        "midCat",
+		Bar:                         "between",
+		BarStacked:                  "between",
+		BarPercentStacked:           "between",
+		Bar3DClustered:              "between",
+		Bar3DStacked:                "between",
+		Bar3DPercentStacked:         "between",
+		Bar3DConeClustered:          "between",
+		Bar3DConeStacked:            "between",
+		Bar3DConePercentStacked:     "between",
+		Bar3DPyramidClustered:       "between",
+		Bar3DPyramidStacked:         "between",
+		Bar3DPyramidPercentStacked:  "between",
+		Bar3DCylinderClustered:      "between",
+		Bar3DCylinderStacked:        "between",
+		Bar3DCylinderPercentStacked: "between",
+		Col:                         "between",
+		ColStacked:                  "between",
+		ColPercentStacked:           "between",
+		Col3D:                       "between",
+		Col3DClustered:              "between",
+		Col3DStacked:                "between",
+		Col3DPercentStacked:         "between",
+		Col3DCone:                   "between",
+		Col3DConeClustered:          "between",
+		Col3DConeStacked:            "between",
+		Col3DConePercentStacked:     "between",
+		Col3DPyramid:                "between",
+		Col3DPyramidClustered:       "between",
+		Col3DPyramidStacked:         "between",
+		Col3DPyramidPercentStacked:  "between",
+		Col3DCylinder:               "between",
+		Col3DCylinderClustered:      "between",
+		Col3DCylinderStacked:        "between",
+		Col3DCylinderPercentStacked: "between",
+		Doughnut:                    "between",
+		Line:                        "between",
+		Pie:                         "between",
+		Pie3D:                       "between",
+		PieOfPieChart:               "between",
+		BarOfPieChart:               "between",
+		Radar:                       "between",
+		Scatter:                     "between",
+		Surface3D:                   "midCat",
+		WireframeSurface3D:          "midCat",
+		Contour:                     "midCat",
+		WireframeContour:            "midCat",
+		Bubble:                      "midCat",
+		Bubble3D:                    "midCat",
+	}
+	plotAreaChartGrouping = map[string]string{
+		Area:                        "standard",
+		AreaStacked:                 "stacked",
+		AreaPercentStacked:          "percentStacked",
+		Area3D:                      "standard",
+		Area3DStacked:               "stacked",
+		Area3DPercentStacked:        "percentStacked",
+		Bar:                         "clustered",
+		BarStacked:                  "stacked",
+		BarPercentStacked:           "percentStacked",
+		Bar3DClustered:              "clustered",
+		Bar3DStacked:                "stacked",
+		Bar3DPercentStacked:         "percentStacked",
+		Bar3DConeClustered:          "clustered",
+		Bar3DConeStacked:            "stacked",
+		Bar3DConePercentStacked:     "percentStacked",
+		Bar3DPyramidClustered:       "clustered",
+		Bar3DPyramidStacked:         "stacked",
+		Bar3DPyramidPercentStacked:  "percentStacked",
+		Bar3DCylinderClustered:      "clustered",
+		Bar3DCylinderStacked:        "stacked",
+		Bar3DCylinderPercentStacked: "percentStacked",
+		Col:                         "clustered",
+		ColStacked:                  "stacked",
+		ColPercentStacked:           "percentStacked",
+		Col3D:                       "standard",
+		Col3DClustered:              "clustered",
+		Col3DStacked:                "stacked",
+		Col3DPercentStacked:         "percentStacked",
+		Col3DCone:                   "standard",
+		Col3DConeClustered:          "clustered",
+		Col3DConeStacked:            "stacked",
+		Col3DConePercentStacked:     "percentStacked",
+		Col3DPyramid:                "standard",
+		Col3DPyramidClustered:       "clustered",
+		Col3DPyramidStacked:         "stacked",
+		Col3DPyramidPercentStacked:  "percentStacked",
+		Col3DCylinder:               "standard",
+		Col3DCylinderClustered:      "clustered",
+		Col3DCylinderStacked:        "stacked",
+		Col3DCylinderPercentStacked: "percentStacked",
+		Line:                        "standard",
+	}
+	plotAreaChartBarDir = map[string]string{
+		Bar:                         "bar",
+		BarStacked:                  "bar",
+		BarPercentStacked:           "bar",
+		Bar3DClustered:              "bar",
+		Bar3DStacked:                "bar",
+		Bar3DPercentStacked:         "bar",
+		Bar3DConeClustered:          "bar",
+		Bar3DConeStacked:            "bar",
+		Bar3DConePercentStacked:     "bar",
+		Bar3DPyramidClustered:       "bar",
+		Bar3DPyramidStacked:         "bar",
+		Bar3DPyramidPercentStacked:  "bar",
+		Bar3DCylinderClustered:      "bar",
+		Bar3DCylinderStacked:        "bar",
+		Bar3DCylinderPercentStacked: "bar",
+		Col:                         "col",
+		ColStacked:                  "col",
+		ColPercentStacked:           "col",
+		Col3D:                       "col",
+		Col3DClustered:              "col",
+		Col3DStacked:                "col",
+		Col3DPercentStacked:         "col",
+		Col3DCone:                   "col",
+		Col3DConeStacked:            "col",
+		Col3DConeClustered:          "col",
+		Col3DConePercentStacked:     "col",
+		Col3DPyramid:                "col",
+		Col3DPyramidClustered:       "col",
+		Col3DPyramidStacked:         "col",
+		Col3DPyramidPercentStacked:  "col",
+		Col3DCylinder:               "col",
+		Col3DCylinderClustered:      "col",
+		Col3DCylinderStacked:        "col",
+		Col3DCylinderPercentStacked: "col",
+		Line:                        "standard",
+	}
+	orientation = map[bool]string{
+		true:  "maxMin",
+		false: "minMax",
+	}
+	catAxPos = map[bool]string{
+		true:  "t",
+		false: "b",
+	}
+	valAxPos = map[bool]string{
+		true:  "r",
+		false: "l",
+	}
+	valTickLblPos = map[string]string{
+		Contour:          "none",
+		WireframeContour: "none",
+	}
+)
+
+// parseFormatChartSet provides a function to parse the format settings of the
+// chart with default value.
+func parseFormatChartSet(formatSet string) (*formatChart, error) {
+	format := formatChart{
+		Dimension: formatChartDimension{
+			Width:  480,
+			Height: 290,
+		},
+		Format: formatPicture{
+			FPrintsWithSheet: true,
+			FLocksWithSheet:  false,
+			NoChangeAspect:   false,
+			OffsetX:          0,
+			OffsetY:          0,
+			XScale:           1.0,
+			YScale:           1.0,
+		},
+		Legend: formatChartLegend{
+			Position:      "bottom",
+			ShowLegendKey: false,
+		},
+		Title: formatChartTitle{
+			Name: " ",
+		},
+		ShowBlanksAs: "gap",
+	}
+	err := json.Unmarshal([]byte(formatSet), &format)
+	return &format, err
+}
+
+// AddChart provides the method to add chart in a sheet by given chart format
+// set (such as offset, scale, aspect ratio setting and print settings) and
+// properties set. For example, create 3D clustered column chart with data
+// Sheet1!$E$1:$L$15:
+//
+//    package main
+//
+//    import (
+//        "fmt"
+//
+//        "github.com/360EntSecGroup-Skylar/excelize"
+//    )
+//
+//    func main() {
+//        categories := map[string]string{"A2": "Small", "A3": "Normal", "A4": "Large", "B1": "Apple", "C1": "Orange", "D1": "Pear"}
+//        values := map[string]int{"B2": 2, "C2": 3, "D2": 3, "B3": 5, "C3": 2, "D3": 4, "B4": 6, "C4": 7, "D4": 8}
+//        f := excelize.NewFile()
+//        for k, v := range categories {
+//            f.SetCellValue("Sheet1", k, v)
+//        }
+//        for k, v := range values {
+//            f.SetCellValue("Sheet1", k, v)
+//        }
+//        if err := f.AddChart("Sheet1", "E1", `{"type":"col3DClustered","series":[{"name":"Sheet1!$A$2","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"},{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4"}],"title":{"name":"Fruit 3D Clustered Column Chart"},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true},"show_blanks_as":"zero","x_axis":{"reverse_order":true},"y_axis":{"maximum":7.5,"minimum":0.5}}`); err != nil {
+//            fmt.Println(err)
+//            return
+//        }
+//        // Save xlsx file by the given path.
+//        if err := f.SaveAs("Book1.xlsx"); err != nil {
+//            fmt.Println(err)
+//        }
+//    }
+//
+// The following shows the type of chart supported by excelize:
+//
+//     Type                        | Chart
+//    -----------------------------+------------------------------
+//     area                        | 2D area chart
+//     areaStacked                 | 2D stacked area chart
+//     areaPercentStacked          | 2D 100% stacked area chart
+//     area3D                      | 3D area chart
+//     area3DStacked               | 3D stacked area chart
+//     area3DPercentStacked        | 3D 100% stacked area chart
+//     bar                         | 2D clustered bar chart
+//     barStacked                  | 2D stacked bar chart
+//     barPercentStacked           | 2D 100% stacked bar chart
+//     bar3DClustered              | 3D clustered bar chart
+//     bar3DStacked                | 3D stacked bar chart
+//     bar3DPercentStacked         | 3D 100% stacked bar chart
+//     bar3DConeClustered          | 3D cone clustered bar chart
+//     bar3DConeStacked            | 3D cone stacked bar chart
+//     bar3DConePercentStacked     | 3D cone percent bar chart
+//     bar3DPyramidClustered       | 3D pyramid clustered bar chart
+//     bar3DPyramidStacked         | 3D pyramid stacked bar chart
+//     bar3DPyramidPercentStacked  | 3D pyramid percent stacked bar chart
+//     bar3DCylinderClustered      | 3D cylinder clustered bar chart
+//     bar3DCylinderStacked        | 3D cylinder stacked bar chart
+//     bar3DCylinderPercentStacked | 3D cylinder percent stacked bar chart
+//     col                         | 2D clustered column chart
+//     colStacked                  | 2D stacked column chart
+//     colPercentStacked           | 2D 100% stacked column chart
+//     col3DClustered              | 3D clustered column chart
+//     col3D                       | 3D column chart
+//     col3DStacked                | 3D stacked column chart
+//     col3DPercentStacked         | 3D 100% stacked column chart
+//     col3DCone                   | 3D cone column chart
+//     col3DConeClustered          | 3D cone clustered column chart
+//     col3DConeStacked            | 3D cone stacked column chart
+//     col3DConePercentStacked     | 3D cone percent stacked column chart
+//     col3DPyramid                | 3D pyramid column chart
+//     col3DPyramidClustered       | 3D pyramid clustered column chart
+//     col3DPyramidStacked         | 3D pyramid stacked column chart
+//     col3DPyramidPercentStacked  | 3D pyramid percent stacked column chart
+//     col3DCylinder               | 3D cylinder column chart
+//     col3DCylinderClustered      | 3D cylinder clustered column chart
+//     col3DCylinderStacked        | 3D cylinder stacked column chart
+//     col3DCylinderPercentStacked | 3D cylinder percent stacked column chart
+//     doughnut                    | doughnut chart
+//     line                        | line chart
+//     pie                         | pie chart
+//     pie3D                       | 3D pie chart
+//     pieOfPie                    | pie of pie chart
+//     barOfPie                    | bar of pie chart
+//     radar                       | radar chart
+//     scatter                     | scatter chart
+//     surface3D                   | 3D surface chart
+//     wireframeSurface3D          | 3D wireframe surface chart
+//     contour                     | contour chart
+//     wireframeContour            | wireframe contour chart
+//     bubble                      | bubble chart
+//     bubble3D                    | 3D bubble chart
+//
+// In Excel a chart series is a collection of information that defines which data is plotted such as values, axis labels and formatting.
+//
+// The series options that can be set are:
+//
+//    name
+//    categories
+//    values
+//    line
+//
+// name: Set the name for the series. The name is displayed in the chart legend and in the formula bar. The name property is optional and if it isn't supplied it will default to Series 1..n. The name can also be a formula such as Sheet1!$A$1
+//
+// categories: This sets the chart category labels. The category is more or less the same as the X axis. In most chart types the categories property is optional and the chart will just assume a sequential series from 1..n.
+//
+// values: This is the most important property of a series and is the only mandatory option for every chart object. This option links the chart with the worksheet data that it displays.
+//
+// line: This sets the line format of the line chart. The line property is optional and if it isn't supplied it will default style. The options that can be set is width. The range of width is 0.25pt - 999pt. If the value of width is outside the range, the default width of the line is 2pt.
+//
+// Set properties of the chart legend. The options that can be set are:
+//
+//    position
+//    show_legend_key
+//
+// position: Set the position of the chart legend. The default legend position is right. The available positions are:
+//
+//    top
+//    bottom
+//    left
+//    right
+//    top_right
+//
+// show_legend_key: Set the legend keys shall be shown in data labels. The default value is false.
+//
+// Set properties of the chart title. The properties that can be set are:
+//
+//    title
+//
+// name: Set the name (title) for the chart. The name is displayed above the chart. The name can also be a formula such as Sheet1!$A$1 or a list with a sheetname. The name property is optional. The default is to have no chart title.
+//
+// Specifies how blank cells are plotted on the chart by show_blanks_as. The default value is gap. The options that can be set are:
+//
+//    gap
+//    span
+//    zero
+//
+// gap: Specifies that blank values shall be left as a gap.
+//
+// sapn: Specifies that blank values shall be spanned with a line.
+//
+// zero: Specifies that blank values shall be treated as zero.
+//
+// Set chart offset, scale, aspect ratio setting and print settings by format, same as function AddPicture.
+//
+// Set the position of the chart plot area by plotarea. The properties that can be set are:
+//
+//    show_bubble_size
+//    show_cat_name
+//    show_leader_lines
+//    show_percent
+//    show_series_name
+//    show_val
+//
+// show_bubble_size: Specifies the bubble size shall be shown in a data label. The show_bubble_size property is optional. The default value is false.
+//
+// show_cat_name: Specifies that the category name shall be shown in the data label. The show_cat_name property is optional. The default value is true.
+//
+// show_leader_lines: Specifies leader lines shall be shown for data labels. The show_leader_lines property is optional. The default value is false.
+//
+// show_percent: Specifies that the percentage shall be shown in a data label. The show_percent property is optional. The default value is false.
+//
+// show_series_name: Specifies that the series name shall be shown in a data label. The show_series_name property is optional. The default value is false.
+//
+// show_val: Specifies that the value shall be shown in a data label. The show_val property is optional. The default value is false.
+//
+// Set the primary horizontal and vertical axis options by x_axis and y_axis. The properties of x_axis that can be set are:
+//
+//    major_grid_lines
+//    minor_grid_lines
+//    tick_label_skip
+//    reverse_order
+//    maximum
+//    minimum
+//
+// The properties of y_axis that can be set are:
+//
+//    major_grid_lines
+//    minor_grid_lines
+//    major_unit
+//    reverse_order
+//    maximum
+//    minimum
+//
+// major_grid_lines: Specifies major gridlines.
+//
+// minor_grid_lines: Specifies minor gridlines.
+//
+// major_unit: Specifies the distance between major ticks. Shall contain a positive floating-point number. The major_unit property is optional. The default value is auto.
+//
+// tick_label_skip: Specifies how many tick labels to skip between label that is drawn. The tick_label_skip property is optional. The default value is auto.
+//
+// reverse_order: Specifies that the categories or values on reverse order (orientation of the chart). The reverse_order property is optional. The default value is false.
+//
+// maximum: Specifies that the fixed maximum, 0 is auto. The maximum property is optional. The default value is auto.
+//
+// minimum: Specifies that the fixed minimum, 0 is auto. The minimum property is optional. The default value is auto.
+//
+// Set chart size by dimension property. The dimension property is optional. The default width is 480, and height is 290.
+//
+// combo: Specifies the create a chart that combines two or more chart types
+// in a single chart. For example, create a clustered column - line chart with
+// data Sheet1!$E$1:$L$15:
+//
+//    package main
+//
+//    import (
+//        "fmt"
+//
+//        "github.com/360EntSecGroup-Skylar/excelize"
+//    )
+//
+//    func main() {
+//        categories := map[string]string{"A2": "Small", "A3": "Normal", "A4": "Large", "B1": "Apple", "C1": "Orange", "D1": "Pear"}
+//        values := map[string]int{"B2": 2, "C2": 3, "D2": 3, "B3": 5, "C3": 2, "D3": 4, "B4": 6, "C4": 7, "D4": 8}
+//        f := excelize.NewFile()
+//        for k, v := range categories {
+//            f.SetCellValue("Sheet1", k, v)
+//        }
+//        for k, v := range values {
+//            f.SetCellValue("Sheet1", k, v)
+//        }
+//        if err := f.AddChart("Sheet1", "E1", `{"type":"col","series":[{"name":"Sheet1!$A$2","categories":"","values":"Sheet1!$B$2:$D$2"},{"name":"Sheet1!$A$3","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$3:$D$3"}],"format":{"x_scale":1.0,"y_scale":1.0,"x_offset":15,"y_offset":10,"print_obj":true,"lock_aspect_ratio":false,"locked":false},"legend":{"position":"left","show_legend_key":false},"title":{"name":"Clustered Column - Line Chart"},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true}}`, `{"type":"line","series":[{"name":"Sheet1!$A$4","categories":"Sheet1!$B$1:$D$1","values":"Sheet1!$B$4:$D$4"}],"format":{"x_scale":1.0,"y_scale":1.0,"x_offset":15,"y_offset":10,"print_obj":true,"lock_aspect_ratio":false,"locked":false},"legend":{"position":"left","show_legend_key":false},"plotarea":{"show_bubble_size":true,"show_cat_name":false,"show_leader_lines":false,"show_percent":true,"show_series_name":true,"show_val":true}}`); err != nil {
+//            fmt.Println(err)
+//            return
+//        }
+//        // Save xlsx file by the given path.
+//        if err := f.SaveAs("Book1.xlsx"); err != nil {
+//            fmt.Println(err)
+//        }
+//    }
+//
+func (f *File) AddChart(sheet, cell, format string, combo ...string) error {
+	// Read sheet data.
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	formatSet, comboCharts, err := f.getFormatChart(format, combo)
+	if err != nil {
+		return err
+	}
+	// Add first picture for given sheet, create xl/drawings/ and xl/drawings/_rels/ folder.
+	drawingID := f.countDrawings() + 1
+	chartID := f.countCharts() + 1
+	drawingXML := "xl/drawings/drawing" + strconv.Itoa(drawingID) + ".xml"
+	drawingID, drawingXML = f.prepareDrawing(xlsx, drawingID, sheet, drawingXML)
+	drawingRels := "xl/drawings/_rels/drawing" + strconv.Itoa(drawingID) + ".xml.rels"
+	drawingRID := f.addRels(drawingRels, SourceRelationshipChart, "../charts/chart"+strconv.Itoa(chartID)+".xml", "")
+	err = f.addDrawingChart(sheet, drawingXML, cell, formatSet.Dimension.Width, formatSet.Dimension.Height, drawingRID, &formatSet.Format)
+	if err != nil {
+		return err
+	}
+	f.addChart(formatSet, comboCharts)
+	f.addContentTypePart(chartID, "chart")
+	f.addContentTypePart(drawingID, "drawings")
+	f.addSheetNameSpace(sheet, SourceRelationship)
+	return err
+}
+
+// AddChartSheet provides the method to create a chartsheet by given chart
+// format set (such as offset, scale, aspect ratio setting and print settings)
+// and properties set. In Excel a chartsheet is a worksheet that only contains
+// a chart.
+func (f *File) AddChartSheet(sheet, format string, combo ...string) error {
+	// Check if the worksheet already exists
+	if f.GetSheetIndex(sheet) != -1 {
+		return errors.New("the same name worksheet already exists")
+	}
+	formatSet, comboCharts, err := f.getFormatChart(format, combo)
+	if err != nil {
+		return err
+	}
+	cs := xlsxChartsheet{
+		SheetViews: []*xlsxChartsheetViews{{
+			SheetView: []*xlsxChartsheetView{{ZoomScaleAttr: 100, ZoomToFitAttr: true}}},
+		},
+	}
+	f.SheetCount++
+	wb := f.workbookReader()
+	sheetID := 0
+	for _, v := range wb.Sheets.Sheet {
+		if v.SheetID > sheetID {
+			sheetID = v.SheetID
+		}
+	}
+	sheetID++
+	path := "xl/chartsheets/sheet" + strconv.Itoa(sheetID) + ".xml"
+	f.sheetMap[trimSheetName(sheet)] = path
+	f.Sheet[path] = nil
+	drawingID := f.countDrawings() + 1
+	chartID := f.countCharts() + 1
+	drawingXML := "xl/drawings/drawing" + strconv.Itoa(drawingID) + ".xml"
+	f.prepareChartSheetDrawing(&cs, drawingID, sheet)
+	drawingRels := "xl/drawings/_rels/drawing" + strconv.Itoa(drawingID) + ".xml.rels"
+	drawingRID := f.addRels(drawingRels, SourceRelationshipChart, "../charts/chart"+strconv.Itoa(chartID)+".xml", "")
+	f.addSheetDrawingChart(drawingXML, drawingRID, &formatSet.Format)
+	f.addChart(formatSet, comboCharts)
+	f.addContentTypePart(chartID, "chart")
+	f.addContentTypePart(sheetID, "chartsheet")
+	f.addContentTypePart(drawingID, "drawings")
+	// Update xl/_rels/workbook.xml.rels
+	rID := f.addRels("xl/_rels/workbook.xml.rels", SourceRelationshipChartsheet, fmt.Sprintf("chartsheets/sheet%d.xml", sheetID), "")
+	// Update xl/workbook.xml
+	f.setWorkbook(sheet, sheetID, rID)
+	chartsheet, _ := xml.Marshal(cs)
+	f.addSheetNameSpace(sheet, NameSpaceSpreadSheet)
+	f.saveFileList(path, replaceRelationshipsBytes(f.replaceNameSpaceBytes(path, chartsheet)))
+	return err
+}
+
+// getFormatChart provides a function to check format set of the chart and
+// create chart format.
+func (f *File) getFormatChart(format string, combo []string) (*formatChart, []*formatChart, error) {
+	comboCharts := []*formatChart{}
+	formatSet, err := parseFormatChartSet(format)
+	if err != nil {
+		return formatSet, comboCharts, err
+	}
+	for _, comboFormat := range combo {
+		comboChart, err := parseFormatChartSet(comboFormat)
+		if err != nil {
+			return formatSet, comboCharts, err
+		}
+		if _, ok := chartValAxNumFmtFormatCode[comboChart.Type]; !ok {
+			return formatSet, comboCharts, errors.New("unsupported chart type " + comboChart.Type)
+		}
+		comboCharts = append(comboCharts, comboChart)
+	}
+	if _, ok := chartValAxNumFmtFormatCode[formatSet.Type]; !ok {
+		return formatSet, comboCharts, errors.New("unsupported chart type " + formatSet.Type)
+	}
+	return formatSet, comboCharts, err
+}
+
+// DeleteChart provides a function to delete chart in XLSX by given worksheet
+// and cell name.
+func (f *File) DeleteChart(sheet, cell string) (err error) {
+	col, row, err := CellNameToCoordinates(cell)
+	if err != nil {
+		return
+	}
+	col--
+	row--
+	ws, err := f.workSheetReader(sheet)
+	if err != nil {
+		return
+	}
+	if ws.Drawing == nil {
+		return
+	}
+	drawingXML := strings.Replace(f.getSheetRelationshipsTargetByID(sheet, ws.Drawing.RID), "..", "xl", -1)
+	return f.deleteDrawing(col, row, drawingXML, "Chart")
+}
+
+// countCharts provides a function to get chart files count storage in the
+// folder xl/charts.
+func (f *File) countCharts() int {
+	count := 0
+	for k := range f.XLSX {
+		if strings.Contains(k, "xl/charts/chart") {
+			count++
+		}
+	}
+	return count
+}
+
+// ptToEMUs provides a function to convert pt to EMUs, 1 pt = 12700 EMUs. The
+// range of pt is 0.25pt - 999pt. If the value of pt is outside the range, the
+// default EMUs will be returned.
+func (f *File) ptToEMUs(pt float64) int {
+	if 0.25 > pt || pt > 999 {
+		return 25400
+	}
+	return int(12700 * pt)
+}

+ 722 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/col.go

@@ -0,0 +1,722 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"bytes"
+	"encoding/xml"
+	"errors"
+	"math"
+	"strconv"
+	"strings"
+
+	"github.com/mohae/deepcopy"
+)
+
+// Define the default cell size and EMU unit of measurement.
+const (
+	defaultColWidthPixels  float64 = 64
+	defaultRowHeightPixels float64 = 20
+	EMU                    int     = 9525
+)
+
+// Cols defines an iterator to a sheet
+type Cols struct {
+	err                                  error
+	curCol, totalCol, stashCol, totalRow int
+	sheet                                string
+	cols                                 []xlsxCols
+	f                                    *File
+	sheetXML                             []byte
+}
+
+// GetCols return all the columns in a sheet by given worksheet name (case
+// sensitive). For example:
+//
+//    cols, err := f.GetCols("Sheet1")
+//    if err != nil {
+//        fmt.Println(err)
+//        return
+//    }
+//    for _, col := range cols {
+//        for _, rowCell := range col {
+//            fmt.Print(rowCell, "\t")
+//        }
+//        fmt.Println()
+//    }
+//
+func (f *File) GetCols(sheet string) ([][]string, error) {
+	cols, err := f.Cols(sheet)
+	if err != nil {
+		return nil, err
+	}
+	results := make([][]string, 0, 64)
+	for cols.Next() {
+		col, _ := cols.Rows()
+		results = append(results, col)
+	}
+	return results, nil
+}
+
+// Next will return true if the next column is found.
+func (cols *Cols) Next() bool {
+	cols.curCol++
+	return cols.curCol <= cols.totalCol
+}
+
+// Error will return an error when the error occurs.
+func (cols *Cols) Error() error {
+	return cols.err
+}
+
+// Rows return the current column's row values.
+func (cols *Cols) Rows() ([]string, error) {
+	var (
+		err              error
+		inElement        string
+		cellCol, cellRow int
+		rows             []string
+	)
+	if cols.stashCol >= cols.curCol {
+		return rows, err
+	}
+	d := cols.f.sharedStringsReader()
+	decoder := cols.f.xmlNewDecoder(bytes.NewReader(cols.sheetXML))
+	for {
+		token, _ := decoder.Token()
+		if token == nil {
+			break
+		}
+		switch startElement := token.(type) {
+		case xml.StartElement:
+			inElement = startElement.Name.Local
+			if inElement == "row" {
+				cellCol = 0
+				cellRow++
+				for _, attr := range startElement.Attr {
+					if attr.Name.Local == "r" {
+						cellRow, _ = strconv.Atoi(attr.Value)
+					}
+				}
+			}
+			if inElement == "c" {
+				cellCol++
+				for _, attr := range startElement.Attr {
+					if attr.Name.Local == "r" {
+						if cellCol, cellRow, err = CellNameToCoordinates(attr.Value); err != nil {
+							return rows, err
+						}
+					}
+				}
+				blank := cellRow - len(rows)
+				for i := 1; i < blank; i++ {
+					rows = append(rows, "")
+				}
+				if cellCol == cols.curCol {
+					colCell := xlsxC{}
+					_ = decoder.DecodeElement(&colCell, &startElement)
+					val, _ := colCell.getValueFrom(cols.f, d)
+					rows = append(rows, val)
+				}
+			}
+		}
+	}
+	return rows, nil
+}
+
+// Cols returns a columns iterator, used for streaming reading data for a
+// worksheet with a large data. For example:
+//
+//    cols, err := f.Cols("Sheet1")
+//    if err != nil {
+//        fmt.Println(err)
+//        return
+//    }
+//    for cols.Next() {
+//        col, err := cols.Rows()
+//        if err != nil {
+//            fmt.Println(err)
+//        }
+//        for _, rowCell := range col {
+//            fmt.Print(rowCell, "\t")
+//        }
+//        fmt.Println()
+//    }
+//
+func (f *File) Cols(sheet string) (*Cols, error) {
+	name, ok := f.sheetMap[trimSheetName(sheet)]
+	if !ok {
+		return nil, ErrSheetNotExist{sheet}
+	}
+	if f.Sheet[name] != nil {
+		output, _ := xml.Marshal(f.Sheet[name])
+		f.saveFileList(name, f.replaceNameSpaceBytes(name, output))
+	}
+	var (
+		inElement            string
+		cols                 Cols
+		cellCol, curRow, row int
+		err                  error
+	)
+	cols.sheetXML = f.readXML(name)
+	decoder := f.xmlNewDecoder(bytes.NewReader(cols.sheetXML))
+	for {
+		token, _ := decoder.Token()
+		if token == nil {
+			break
+		}
+		switch startElement := token.(type) {
+		case xml.StartElement:
+			inElement = startElement.Name.Local
+			if inElement == "row" {
+				row++
+				for _, attr := range startElement.Attr {
+					if attr.Name.Local == "r" {
+						if curRow, err = strconv.Atoi(attr.Value); err != nil {
+							return &cols, err
+						}
+						row = curRow
+					}
+				}
+				cols.totalRow = row
+				cellCol = 0
+			}
+			if inElement == "c" {
+				cellCol++
+				for _, attr := range startElement.Attr {
+					if attr.Name.Local == "r" {
+						if cellCol, _, err = CellNameToCoordinates(attr.Value); err != nil {
+							return &cols, err
+						}
+					}
+				}
+				if cellCol > cols.totalCol {
+					cols.totalCol = cellCol
+				}
+			}
+		}
+	}
+	cols.f = f
+	cols.sheet = trimSheetName(sheet)
+	return &cols, nil
+}
+
+// GetColVisible provides a function to get visible of a single column by given
+// worksheet name and column name. For example, get visible state of column D
+// in Sheet1:
+//
+//    visible, err := f.GetColVisible("Sheet1", "D")
+//
+func (f *File) GetColVisible(sheet, col string) (bool, error) {
+	visible := true
+	colNum, err := ColumnNameToNumber(col)
+	if err != nil {
+		return visible, err
+	}
+
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return false, err
+	}
+	if xlsx.Cols == nil {
+		return visible, err
+	}
+
+	for c := range xlsx.Cols.Col {
+		colData := &xlsx.Cols.Col[c]
+		if colData.Min <= colNum && colNum <= colData.Max {
+			visible = !colData.Hidden
+		}
+	}
+	return visible, err
+}
+
+// SetColVisible provides a function to set visible columns by given worksheet
+// name, columns range and visibility.
+//
+// For example hide column D on Sheet1:
+//
+//    err := f.SetColVisible("Sheet1", "D", false)
+//
+// Hide the columns from D to F (included):
+//
+//    err := f.SetColVisible("Sheet1", "D:F", false)
+//
+func (f *File) SetColVisible(sheet, columns string, visible bool) error {
+	var max int
+
+	colsTab := strings.Split(columns, ":")
+	min, err := ColumnNameToNumber(colsTab[0])
+	if err != nil {
+		return err
+	}
+	if len(colsTab) == 2 {
+		max, err = ColumnNameToNumber(colsTab[1])
+		if err != nil {
+			return err
+		}
+	} else {
+		max = min
+	}
+	if max < min {
+		min, max = max, min
+	}
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	colData := xlsxCol{
+		Min:         min,
+		Max:         max,
+		Width:       9, // default width
+		Hidden:      !visible,
+		CustomWidth: true,
+	}
+	if xlsx.Cols == nil {
+		cols := xlsxCols{}
+		cols.Col = append(cols.Col, colData)
+		xlsx.Cols = &cols
+		return nil
+	}
+	xlsx.Cols.Col = flatCols(colData, xlsx.Cols.Col, func(fc, c xlsxCol) xlsxCol {
+		fc.BestFit = c.BestFit
+		fc.Collapsed = c.Collapsed
+		fc.CustomWidth = c.CustomWidth
+		fc.OutlineLevel = c.OutlineLevel
+		fc.Phonetic = c.Phonetic
+		fc.Style = c.Style
+		fc.Width = c.Width
+		return fc
+	})
+	return nil
+}
+
+// GetColOutlineLevel provides a function to get outline level of a single
+// column by given worksheet name and column name. For example, get outline
+// level of column D in Sheet1:
+//
+//    level, err := f.GetColOutlineLevel("Sheet1", "D")
+//
+func (f *File) GetColOutlineLevel(sheet, col string) (uint8, error) {
+	level := uint8(0)
+	colNum, err := ColumnNameToNumber(col)
+	if err != nil {
+		return level, err
+	}
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return 0, err
+	}
+	if xlsx.Cols == nil {
+		return level, err
+	}
+	for c := range xlsx.Cols.Col {
+		colData := &xlsx.Cols.Col[c]
+		if colData.Min <= colNum && colNum <= colData.Max {
+			level = colData.OutlineLevel
+		}
+	}
+	return level, err
+}
+
+// SetColOutlineLevel provides a function to set outline level of a single
+// column by given worksheet name and column name. The value of parameter
+// 'level' is 1-7. For example, set outline level of column D in Sheet1 to 2:
+//
+//    err := f.SetColOutlineLevel("Sheet1", "D", 2)
+//
+func (f *File) SetColOutlineLevel(sheet, col string, level uint8) error {
+	if level > 7 || level < 1 {
+		return errors.New("invalid outline level")
+	}
+	colNum, err := ColumnNameToNumber(col)
+	if err != nil {
+		return err
+	}
+	colData := xlsxCol{
+		Min:          colNum,
+		Max:          colNum,
+		OutlineLevel: level,
+		CustomWidth:  true,
+	}
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	if xlsx.Cols == nil {
+		cols := xlsxCols{}
+		cols.Col = append(cols.Col, colData)
+		xlsx.Cols = &cols
+		return err
+	}
+	xlsx.Cols.Col = flatCols(colData, xlsx.Cols.Col, func(fc, c xlsxCol) xlsxCol {
+		fc.BestFit = c.BestFit
+		fc.Collapsed = c.Collapsed
+		fc.CustomWidth = c.CustomWidth
+		fc.Hidden = c.Hidden
+		fc.Phonetic = c.Phonetic
+		fc.Style = c.Style
+		fc.Width = c.Width
+		return fc
+	})
+	return err
+}
+
+// SetColStyle provides a function to set style of columns by given worksheet
+// name, columns range and style ID.
+//
+// For example set style of column H on Sheet1:
+//
+//    err = f.SetColStyle("Sheet1", "H", style)
+//
+// Set style of columns C:F on Sheet1:
+//
+//    err = f.SetColStyle("Sheet1", "C:F", style)
+//
+func (f *File) SetColStyle(sheet, columns string, styleID int) error {
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	var c1, c2 string
+	var min, max int
+	cols := strings.Split(columns, ":")
+	c1 = cols[0]
+	min, err = ColumnNameToNumber(c1)
+	if err != nil {
+		return err
+	}
+	if len(cols) == 2 {
+		c2 = cols[1]
+		max, err = ColumnNameToNumber(c2)
+		if err != nil {
+			return err
+		}
+	} else {
+		max = min
+	}
+	if max < min {
+		min, max = max, min
+	}
+	if xlsx.Cols == nil {
+		xlsx.Cols = &xlsxCols{}
+	}
+	xlsx.Cols.Col = flatCols(xlsxCol{
+		Min:   min,
+		Max:   max,
+		Width: 9,
+		Style: styleID,
+	}, xlsx.Cols.Col, func(fc, c xlsxCol) xlsxCol {
+		fc.BestFit = c.BestFit
+		fc.Collapsed = c.Collapsed
+		fc.CustomWidth = c.CustomWidth
+		fc.Hidden = c.Hidden
+		fc.OutlineLevel = c.OutlineLevel
+		fc.Phonetic = c.Phonetic
+		fc.Width = c.Width
+		return fc
+	})
+	return nil
+}
+
+// SetColWidth provides a function to set the width of a single column or
+// multiple columns. For example:
+//
+//    f := excelize.NewFile()
+//    err := f.SetColWidth("Sheet1", "A", "H", 20)
+//
+func (f *File) SetColWidth(sheet, startcol, endcol string, width float64) error {
+	min, err := ColumnNameToNumber(startcol)
+	if err != nil {
+		return err
+	}
+	max, err := ColumnNameToNumber(endcol)
+	if err != nil {
+		return err
+	}
+	if min > max {
+		min, max = max, min
+	}
+
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	col := xlsxCol{
+		Min:         min,
+		Max:         max,
+		Width:       width,
+		CustomWidth: true,
+	}
+	if xlsx.Cols == nil {
+		cols := xlsxCols{}
+		cols.Col = append(cols.Col, col)
+		xlsx.Cols = &cols
+		return err
+	}
+	xlsx.Cols.Col = flatCols(col, xlsx.Cols.Col, func(fc, c xlsxCol) xlsxCol {
+		fc.BestFit = c.BestFit
+		fc.Collapsed = c.Collapsed
+		fc.Hidden = c.Hidden
+		fc.OutlineLevel = c.OutlineLevel
+		fc.Phonetic = c.Phonetic
+		fc.Style = c.Style
+		return fc
+	})
+	return err
+}
+
+// flatCols provides a method for the column's operation functions to flatten
+// and check the worksheet columns.
+func flatCols(col xlsxCol, cols []xlsxCol, replacer func(fc, c xlsxCol) xlsxCol) []xlsxCol {
+	fc := []xlsxCol{}
+	for i := col.Min; i <= col.Max; i++ {
+		c := deepcopy.Copy(col).(xlsxCol)
+		c.Min, c.Max = i, i
+		fc = append(fc, c)
+	}
+	inFlat := func(colID int, cols []xlsxCol) (int, bool) {
+		for idx, c := range cols {
+			if c.Max == colID && c.Min == colID {
+				return idx, true
+			}
+		}
+		return -1, false
+	}
+	for _, column := range cols {
+		for i := column.Min; i <= column.Max; i++ {
+			if idx, ok := inFlat(i, fc); ok {
+				fc[idx] = replacer(fc[idx], column)
+				continue
+			}
+			c := deepcopy.Copy(column).(xlsxCol)
+			c.Min, c.Max = i, i
+			fc = append(fc, c)
+		}
+	}
+	return fc
+}
+
+// positionObjectPixels calculate the vertices that define the position of a
+// graphical object within the worksheet in pixels.
+//
+//          +------------+------------+
+//          |     A      |      B     |
+//    +-----+------------+------------+
+//    |     |(x1,y1)     |            |
+//    |  1  |(A1)._______|______      |
+//    |     |    |              |     |
+//    |     |    |              |     |
+//    +-----+----|    OBJECT    |-----+
+//    |     |    |              |     |
+//    |  2  |    |______________.     |
+//    |     |            |        (B2)|
+//    |     |            |     (x2,y2)|
+//    +-----+------------+------------+
+//
+// Example of an object that covers some of the area from cell A1 to B2.
+//
+// Based on the width and height of the object we need to calculate 8 vars:
+//
+//    colStart, rowStart, colEnd, rowEnd, x1, y1, x2, y2.
+//
+// We also calculate the absolute x and y position of the top left vertex of
+// the object. This is required for images.
+//
+// The width and height of the cells that the object occupies can be
+// variable and have to be taken into account.
+//
+// The values of col_start and row_start are passed in from the calling
+// function. The values of col_end and row_end are calculated by
+// subtracting the width and height of the object from the width and
+// height of the underlying cells.
+//
+//    colStart        # Col containing upper left corner of object.
+//    x1              # Distance to left side of object.
+//
+//    rowStart        # Row containing top left corner of object.
+//    y1              # Distance to top of object.
+//
+//    colEnd          # Col containing lower right corner of object.
+//    x2              # Distance to right side of object.
+//
+//    rowEnd          # Row containing bottom right corner of object.
+//    y2              # Distance to bottom of object.
+//
+//    width           # Width of object frame.
+//    height          # Height of object frame.
+//
+//    xAbs            # Absolute distance to left side of object.
+//    yAbs            # Absolute distance to top side of object.
+//
+func (f *File) positionObjectPixels(sheet string, col, row, x1, y1, width, height int) (int, int, int, int, int, int, int, int) {
+	xAbs := 0
+	yAbs := 0
+
+	// Calculate the absolute x offset of the top-left vertex.
+	for colID := 1; colID <= col; colID++ {
+		xAbs += f.getColWidth(sheet, colID)
+	}
+	xAbs += x1
+
+	// Calculate the absolute y offset of the top-left vertex.
+	// Store the column change to allow optimisations.
+	for rowID := 1; rowID <= row; rowID++ {
+		yAbs += f.getRowHeight(sheet, rowID)
+	}
+	yAbs += y1
+
+	// Adjust start column for offsets that are greater than the col width.
+	for x1 >= f.getColWidth(sheet, col) {
+		x1 -= f.getColWidth(sheet, col)
+		col++
+	}
+
+	// Adjust start row for offsets that are greater than the row height.
+	for y1 >= f.getRowHeight(sheet, row) {
+		y1 -= f.getRowHeight(sheet, row)
+		row++
+	}
+
+	// Initialise end cell to the same as the start cell.
+	colEnd := col
+	rowEnd := row
+
+	width += x1
+	height += y1
+
+	// Subtract the underlying cell widths to find end cell of the object.
+	for width >= f.getColWidth(sheet, colEnd+1) {
+		colEnd++
+		width -= f.getColWidth(sheet, colEnd)
+	}
+
+	// Subtract the underlying cell heights to find end cell of the object.
+	for height >= f.getRowHeight(sheet, rowEnd) {
+		height -= f.getRowHeight(sheet, rowEnd)
+		rowEnd++
+	}
+
+	// The end vertices are whatever is left from the width and height.
+	x2 := width
+	y2 := height
+	return col, row, xAbs, yAbs, colEnd, rowEnd, x2, y2
+}
+
+// getColWidth provides a function to get column width in pixels by given
+// sheet name and column index.
+func (f *File) getColWidth(sheet string, col int) int {
+	xlsx, _ := f.workSheetReader(sheet)
+	if xlsx.Cols != nil {
+		var width float64
+		for _, v := range xlsx.Cols.Col {
+			if v.Min <= col && col <= v.Max {
+				width = v.Width
+			}
+		}
+		if width != 0 {
+			return int(convertColWidthToPixels(width))
+		}
+	}
+	// Optimisation for when the column widths haven't changed.
+	return int(defaultColWidthPixels)
+}
+
+// GetColWidth provides a function to get column width by given worksheet name
+// and column index.
+func (f *File) GetColWidth(sheet, col string) (float64, error) {
+	colNum, err := ColumnNameToNumber(col)
+	if err != nil {
+		return defaultColWidthPixels, err
+	}
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return defaultColWidthPixels, err
+	}
+	if xlsx.Cols != nil {
+		var width float64
+		for _, v := range xlsx.Cols.Col {
+			if v.Min <= colNum && colNum <= v.Max {
+				width = v.Width
+			}
+		}
+		if width != 0 {
+			return width, err
+		}
+	}
+	// Optimisation for when the column widths haven't changed.
+	return defaultColWidthPixels, err
+}
+
+// InsertCol provides a function to insert a new column before given column
+// index. For example, create a new column before column C in Sheet1:
+//
+//    err := f.InsertCol("Sheet1", "C")
+//
+func (f *File) InsertCol(sheet, col string) error {
+	num, err := ColumnNameToNumber(col)
+	if err != nil {
+		return err
+	}
+	return f.adjustHelper(sheet, columns, num, 1)
+}
+
+// RemoveCol provides a function to remove single column by given worksheet
+// name and column index. For example, remove column C in Sheet1:
+//
+//    err := f.RemoveCol("Sheet1", "C")
+//
+// Use this method with caution, which will affect changes in references such
+// as formulas, charts, and so on. If there is any referenced value of the
+// worksheet, it will cause a file error when you open it. The excelize only
+// partially updates these references currently.
+func (f *File) RemoveCol(sheet, col string) error {
+	num, err := ColumnNameToNumber(col)
+	if err != nil {
+		return err
+	}
+
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	for rowIdx := range xlsx.SheetData.Row {
+		rowData := &xlsx.SheetData.Row[rowIdx]
+		for colIdx := range rowData.C {
+			colName, _, _ := SplitCellName(rowData.C[colIdx].R)
+			if colName == col {
+				rowData.C = append(rowData.C[:colIdx], rowData.C[colIdx+1:]...)[:len(rowData.C)-1]
+				break
+			}
+		}
+	}
+	return f.adjustHelper(sheet, columns, num, -1)
+}
+
+// convertColWidthToPixels provieds function to convert the width of a cell
+// from user's units to pixels. Excel rounds the column width to the nearest
+// pixel. If the width hasn't been set by the user we use the default value.
+// If the column is hidden it has a value of zero.
+func convertColWidthToPixels(width float64) float64 {
+	var padding float64 = 5
+	var pixels float64
+	var maxDigitWidth float64 = 7
+	if width == 0 {
+		return pixels
+	}
+	if width < 1 {
+		pixels = (width * 12) + 0.5
+		return math.Ceil(pixels)
+	}
+	pixels = (width*maxDigitWidth + 0.5) + padding
+	return math.Ceil(pixels)
+}

+ 367 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/comment.go

@@ -0,0 +1,367 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"bytes"
+	"encoding/json"
+	"encoding/xml"
+	"fmt"
+	"io"
+	"log"
+	"path/filepath"
+	"strconv"
+	"strings"
+)
+
+// parseFormatCommentsSet provides a function to parse the format settings of
+// the comment with default value.
+func parseFormatCommentsSet(formatSet string) (*formatComment, error) {
+	format := formatComment{
+		Author: "Author:",
+		Text:   " ",
+	}
+	err := json.Unmarshal([]byte(formatSet), &format)
+	return &format, err
+}
+
+// GetComments retrieves all comments and returns a map of worksheet name to
+// the worksheet comments.
+func (f *File) GetComments() (comments map[string][]Comment) {
+	comments = map[string][]Comment{}
+	for n, path := range f.sheetMap {
+		if d := f.commentsReader("xl" + strings.TrimPrefix(f.getSheetComments(filepath.Base(path)), "..")); d != nil {
+			sheetComments := []Comment{}
+			for _, comment := range d.CommentList.Comment {
+				sheetComment := Comment{}
+				if comment.AuthorID < len(d.Authors) {
+					sheetComment.Author = d.Authors[comment.AuthorID].Author
+				}
+				sheetComment.Ref = comment.Ref
+				sheetComment.AuthorID = comment.AuthorID
+				if comment.Text.T != nil {
+					sheetComment.Text += *comment.Text.T
+				}
+				for _, text := range comment.Text.R {
+					if text.T != nil {
+						sheetComment.Text += text.T.Val
+					}
+				}
+				sheetComments = append(sheetComments, sheetComment)
+			}
+			comments[n] = sheetComments
+		}
+	}
+	return
+}
+
+// getSheetComments provides the method to get the target comment reference by
+// given worksheet file path.
+func (f *File) getSheetComments(sheetFile string) string {
+	var rels = "xl/worksheets/_rels/" + sheetFile + ".rels"
+	if sheetRels := f.relsReader(rels); sheetRels != nil {
+		for _, v := range sheetRels.Relationships {
+			if v.Type == SourceRelationshipComments {
+				return v.Target
+			}
+		}
+	}
+	return ""
+}
+
+// AddComment provides the method to add comment in a sheet by given worksheet
+// index, cell and format set (such as author and text). Note that the max
+// author length is 255 and the max text length is 32512. For example, add a
+// comment in Sheet1!$A$30:
+//
+//    err := f.AddComment("Sheet1", "A30", `{"author":"Excelize: ","text":"This is a comment."}`)
+//
+func (f *File) AddComment(sheet, cell, format string) error {
+	formatSet, err := parseFormatCommentsSet(format)
+	if err != nil {
+		return err
+	}
+	// Read sheet data.
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	commentID := f.countComments() + 1
+	drawingVML := "xl/drawings/vmlDrawing" + strconv.Itoa(commentID) + ".vml"
+	sheetRelationshipsComments := "../comments" + strconv.Itoa(commentID) + ".xml"
+	sheetRelationshipsDrawingVML := "../drawings/vmlDrawing" + strconv.Itoa(commentID) + ".vml"
+	if xlsx.LegacyDrawing != nil {
+		// The worksheet already has a comments relationships, use the relationships drawing ../drawings/vmlDrawing%d.vml.
+		sheetRelationshipsDrawingVML = f.getSheetRelationshipsTargetByID(sheet, xlsx.LegacyDrawing.RID)
+		commentID, _ = strconv.Atoi(strings.TrimSuffix(strings.TrimPrefix(sheetRelationshipsDrawingVML, "../drawings/vmlDrawing"), ".vml"))
+		drawingVML = strings.Replace(sheetRelationshipsDrawingVML, "..", "xl", -1)
+	} else {
+		// Add first comment for given sheet.
+		sheetRels := "xl/worksheets/_rels/" + strings.TrimPrefix(f.sheetMap[trimSheetName(sheet)], "xl/worksheets/") + ".rels"
+		rID := f.addRels(sheetRels, SourceRelationshipDrawingVML, sheetRelationshipsDrawingVML, "")
+		f.addRels(sheetRels, SourceRelationshipComments, sheetRelationshipsComments, "")
+		f.addSheetNameSpace(sheet, SourceRelationship)
+		f.addSheetLegacyDrawing(sheet, rID)
+	}
+	commentsXML := "xl/comments" + strconv.Itoa(commentID) + ".xml"
+	var colCount int
+	for i, l := range strings.Split(formatSet.Text, "\n") {
+		if ll := len(l); ll > colCount {
+			if i == 0 {
+				ll += len(formatSet.Author)
+			}
+			colCount = ll
+		}
+	}
+	err = f.addDrawingVML(commentID, drawingVML, cell, strings.Count(formatSet.Text, "\n")+1, colCount)
+	if err != nil {
+		return err
+	}
+	f.addComment(commentsXML, cell, formatSet)
+	f.addContentTypePart(commentID, "comments")
+	return err
+}
+
+// addDrawingVML provides a function to create comment as
+// xl/drawings/vmlDrawing%d.vml by given commit ID and cell.
+func (f *File) addDrawingVML(commentID int, drawingVML, cell string, lineCount, colCount int) error {
+	col, row, err := CellNameToCoordinates(cell)
+	if err != nil {
+		return err
+	}
+	yAxis := col - 1
+	xAxis := row - 1
+	vml := f.VMLDrawing[drawingVML]
+	if vml == nil {
+		vml = &vmlDrawing{
+			XMLNSv:  "urn:schemas-microsoft-com:vml",
+			XMLNSo:  "urn:schemas-microsoft-com:office:office",
+			XMLNSx:  "urn:schemas-microsoft-com:office:excel",
+			XMLNSmv: "http://macVmlSchemaUri",
+			Shapelayout: &xlsxShapelayout{
+				Ext: "edit",
+				IDmap: &xlsxIDmap{
+					Ext:  "edit",
+					Data: commentID,
+				},
+			},
+			Shapetype: &xlsxShapetype{
+				ID:        "_x0000_t202",
+				Coordsize: "21600,21600",
+				Spt:       202,
+				Path:      "m0,0l0,21600,21600,21600,21600,0xe",
+				Stroke: &xlsxStroke{
+					Joinstyle: "miter",
+				},
+				VPath: &vPath{
+					Gradientshapeok: "t",
+					Connecttype:     "rect",
+				},
+			},
+		}
+	}
+	sp := encodeShape{
+		Fill: &vFill{
+			Color2: "#fbfe82",
+			Angle:  -180,
+			Type:   "gradient",
+			Fill: &oFill{
+				Ext:  "view",
+				Type: "gradientUnscaled",
+			},
+		},
+		Shadow: &vShadow{
+			On:       "t",
+			Color:    "black",
+			Obscured: "t",
+		},
+		Path: &vPath{
+			Connecttype: "none",
+		},
+		Textbox: &vTextbox{
+			Style: "mso-direction-alt:auto",
+			Div: &xlsxDiv{
+				Style: "text-align:left",
+			},
+		},
+		ClientData: &xClientData{
+			ObjectType: "Note",
+			Anchor: fmt.Sprintf(
+				"%d, 23, %d, 0, %d, %d, %d, 5",
+				1+yAxis, 1+xAxis, 2+yAxis+lineCount, colCount+yAxis, 2+xAxis+lineCount),
+			AutoFill: "True",
+			Row:      xAxis,
+			Column:   yAxis,
+		},
+	}
+	s, _ := xml.Marshal(sp)
+	shape := xlsxShape{
+		ID:          "_x0000_s1025",
+		Type:        "#_x0000_t202",
+		Style:       "position:absolute;73.5pt;width:108pt;height:59.25pt;z-index:1;visibility:hidden",
+		Fillcolor:   "#fbf6d6",
+		Strokecolor: "#edeaa1",
+		Val:         string(s[13 : len(s)-14]),
+	}
+	d := f.decodeVMLDrawingReader(drawingVML)
+	if d != nil {
+		for _, v := range d.Shape {
+			s := xlsxShape{
+				ID:          "_x0000_s1025",
+				Type:        "#_x0000_t202",
+				Style:       "position:absolute;73.5pt;width:108pt;height:59.25pt;z-index:1;visibility:hidden",
+				Fillcolor:   "#fbf6d6",
+				Strokecolor: "#edeaa1",
+				Val:         v.Val,
+			}
+			vml.Shape = append(vml.Shape, s)
+		}
+	}
+	vml.Shape = append(vml.Shape, shape)
+	f.VMLDrawing[drawingVML] = vml
+	return err
+}
+
+// addComment provides a function to create chart as xl/comments%d.xml by
+// given cell and format sets.
+func (f *File) addComment(commentsXML, cell string, formatSet *formatComment) {
+	a := formatSet.Author
+	t := formatSet.Text
+	if len(a) > 255 {
+		a = a[0:255]
+	}
+	if len(t) > 32512 {
+		t = t[0:32512]
+	}
+	comments := f.commentsReader(commentsXML)
+	if comments == nil {
+		comments = &xlsxComments{
+			Authors: []xlsxAuthor{
+				{
+					Author: formatSet.Author,
+				},
+			},
+		}
+	}
+	defaultFont := f.GetDefaultFont()
+	cmt := xlsxComment{
+		Ref:      cell,
+		AuthorID: 0,
+		Text: xlsxText{
+			R: []xlsxR{
+				{
+					RPr: &xlsxRPr{
+						B:  " ",
+						Sz: &attrValFloat{Val: float64Ptr(9)},
+						Color: &xlsxColor{
+							Indexed: 81,
+						},
+						RFont:  &attrValString{Val: stringPtr(defaultFont)},
+						Family: &attrValInt{Val: intPtr(2)},
+					},
+					T: &xlsxT{Val: a},
+				},
+				{
+					RPr: &xlsxRPr{
+						Sz: &attrValFloat{Val: float64Ptr(9)},
+						Color: &xlsxColor{
+							Indexed: 81,
+						},
+						RFont:  &attrValString{Val: stringPtr(defaultFont)},
+						Family: &attrValInt{Val: intPtr(2)},
+					},
+					T: &xlsxT{Val: t},
+				},
+			},
+		},
+	}
+	comments.CommentList.Comment = append(comments.CommentList.Comment, cmt)
+	f.Comments[commentsXML] = comments
+}
+
+// countComments provides a function to get comments files count storage in
+// the folder xl.
+func (f *File) countComments() int {
+	c1, c2 := 0, 0
+	for k := range f.XLSX {
+		if strings.Contains(k, "xl/comments") {
+			c1++
+		}
+	}
+	for rel := range f.Comments {
+		if strings.Contains(rel, "xl/comments") {
+			c2++
+		}
+	}
+	if c1 < c2 {
+		return c2
+	}
+	return c1
+}
+
+// decodeVMLDrawingReader provides a function to get the pointer to the
+// structure after deserialization of xl/drawings/vmlDrawing%d.xml.
+func (f *File) decodeVMLDrawingReader(path string) *decodeVmlDrawing {
+	var err error
+
+	if f.DecodeVMLDrawing[path] == nil {
+		c, ok := f.XLSX[path]
+		if ok {
+			f.DecodeVMLDrawing[path] = new(decodeVmlDrawing)
+			if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(c))).
+				Decode(f.DecodeVMLDrawing[path]); err != nil && err != io.EOF {
+				log.Printf("xml decode error: %s", err)
+			}
+		}
+	}
+	return f.DecodeVMLDrawing[path]
+}
+
+// vmlDrawingWriter provides a function to save xl/drawings/vmlDrawing%d.xml
+// after serialize structure.
+func (f *File) vmlDrawingWriter() {
+	for path, vml := range f.VMLDrawing {
+		if vml != nil {
+			v, _ := xml.Marshal(vml)
+			f.XLSX[path] = v
+		}
+	}
+}
+
+// commentsReader provides a function to get the pointer to the structure
+// after deserialization of xl/comments%d.xml.
+func (f *File) commentsReader(path string) *xlsxComments {
+	var err error
+
+	if f.Comments[path] == nil {
+		content, ok := f.XLSX[path]
+		if ok {
+			f.Comments[path] = new(xlsxComments)
+			if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(content))).
+				Decode(f.Comments[path]); err != nil && err != io.EOF {
+				log.Printf("xml decode error: %s", err)
+			}
+		}
+	}
+	return f.Comments[path]
+}
+
+// commentsWriter provides a function to save xl/comments%d.xml after
+// serialize structure.
+func (f *File) commentsWriter() {
+	for path, c := range f.Comments {
+		if c != nil {
+			v, _ := xml.Marshal(c)
+			f.saveFileList(path, v)
+		}
+	}
+}

+ 267 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/datavalidation.go

@@ -0,0 +1,267 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"fmt"
+	"strings"
+)
+
+// DataValidationType defined the type of data validation.
+type DataValidationType int
+
+// Data validation types.
+const (
+	_DataValidationType = iota
+	typeNone            // inline use
+	DataValidationTypeCustom
+	DataValidationTypeDate
+	DataValidationTypeDecimal
+	typeList // inline use
+	DataValidationTypeTextLeng
+	DataValidationTypeTime
+	// DataValidationTypeWhole Integer
+	DataValidationTypeWhole
+)
+
+const (
+	// dataValidationFormulaStrLen 255 characters+ 2 quotes
+	dataValidationFormulaStrLen = 257
+	// dataValidationFormulaStrLenErr
+	dataValidationFormulaStrLenErr = "data validation must be 0-255 characters"
+)
+
+// DataValidationErrorStyle defined the style of data validation error alert.
+type DataValidationErrorStyle int
+
+// Data validation error styles.
+const (
+	_ DataValidationErrorStyle = iota
+	DataValidationErrorStyleStop
+	DataValidationErrorStyleWarning
+	DataValidationErrorStyleInformation
+)
+
+// Data validation error styles.
+const (
+	styleStop        = "stop"
+	styleWarning     = "warning"
+	styleInformation = "information"
+)
+
+// DataValidationOperator operator enum.
+type DataValidationOperator int
+
+// Data validation operators.
+const (
+	_DataValidationOperator = iota
+	DataValidationOperatorBetween
+	DataValidationOperatorEqual
+	DataValidationOperatorGreaterThan
+	DataValidationOperatorGreaterThanOrEqual
+	DataValidationOperatorLessThan
+	DataValidationOperatorLessThanOrEqual
+	DataValidationOperatorNotBetween
+	DataValidationOperatorNotEqual
+)
+
+// NewDataValidation return data validation struct.
+func NewDataValidation(allowBlank bool) *DataValidation {
+	return &DataValidation{
+		AllowBlank:       allowBlank,
+		ShowErrorMessage: false,
+		ShowInputMessage: false,
+	}
+}
+
+// SetError set error notice.
+func (dd *DataValidation) SetError(style DataValidationErrorStyle, title, msg string) {
+	dd.Error = &msg
+	dd.ErrorTitle = &title
+	strStyle := styleStop
+	switch style {
+	case DataValidationErrorStyleStop:
+		strStyle = styleStop
+	case DataValidationErrorStyleWarning:
+		strStyle = styleWarning
+	case DataValidationErrorStyleInformation:
+		strStyle = styleInformation
+
+	}
+	dd.ShowErrorMessage = true
+	dd.ErrorStyle = &strStyle
+}
+
+// SetInput set prompt notice.
+func (dd *DataValidation) SetInput(title, msg string) {
+	dd.ShowInputMessage = true
+	dd.PromptTitle = &title
+	dd.Prompt = &msg
+}
+
+// SetDropList data validation list.
+func (dd *DataValidation) SetDropList(keys []string) error {
+	formula := "\"" + strings.Join(keys, ",") + "\""
+	if dataValidationFormulaStrLen < len(formula) {
+		return fmt.Errorf(dataValidationFormulaStrLenErr)
+	}
+	dd.Formula1 = fmt.Sprintf("<formula1>%s</formula1>", formula)
+	dd.Type = convDataValidationType(typeList)
+	return nil
+}
+
+// SetRange provides function to set data validation range in drop list.
+func (dd *DataValidation) SetRange(f1, f2 int, t DataValidationType, o DataValidationOperator) error {
+	formula1 := fmt.Sprintf("%d", f1)
+	formula2 := fmt.Sprintf("%d", f2)
+	if dataValidationFormulaStrLen+21 < len(dd.Formula1) || dataValidationFormulaStrLen+21 < len(dd.Formula2) {
+		return fmt.Errorf(dataValidationFormulaStrLenErr)
+	}
+
+	dd.Formula1 = fmt.Sprintf("<formula1>%s</formula1>", formula1)
+	dd.Formula2 = fmt.Sprintf("<formula2>%s</formula2>", formula2)
+	dd.Type = convDataValidationType(t)
+	dd.Operator = convDataValidationOperatior(o)
+	return nil
+}
+
+// SetSqrefDropList provides set data validation on a range with source
+// reference range of the worksheet by given data validation object and
+// worksheet name. The data validation object can be created by
+// NewDataValidation function. For example, set data validation on
+// Sheet1!A7:B8 with validation criteria source Sheet1!E1:E3 settings, create
+// in-cell dropdown by allowing list source:
+//
+//     dvRange := excelize.NewDataValidation(true)
+//     dvRange.Sqref = "A7:B8"
+//     dvRange.SetSqrefDropList("$E$1:$E$3", true)
+//     f.AddDataValidation("Sheet1", dvRange)
+//
+func (dd *DataValidation) SetSqrefDropList(sqref string, isCurrentSheet bool) error {
+	if isCurrentSheet {
+		dd.Formula1 = fmt.Sprintf("<formula1>%s</formula1>", sqref)
+		dd.Type = convDataValidationType(typeList)
+		return nil
+	}
+	return fmt.Errorf("cross-sheet sqref cell are not supported")
+}
+
+// SetSqref provides function to set data validation range in drop list.
+func (dd *DataValidation) SetSqref(sqref string) {
+	if dd.Sqref == "" {
+		dd.Sqref = sqref
+	} else {
+		dd.Sqref = fmt.Sprintf("%s %s", dd.Sqref, sqref)
+	}
+}
+
+// convDataValidationType get excel data validation type.
+func convDataValidationType(t DataValidationType) string {
+	typeMap := map[DataValidationType]string{
+		typeNone:                   "none",
+		DataValidationTypeCustom:   "custom",
+		DataValidationTypeDate:     "date",
+		DataValidationTypeDecimal:  "decimal",
+		typeList:                   "list",
+		DataValidationTypeTextLeng: "textLength",
+		DataValidationTypeTime:     "time",
+		DataValidationTypeWhole:    "whole",
+	}
+
+	return typeMap[t]
+
+}
+
+// convDataValidationOperatior get excel data validation operator.
+func convDataValidationOperatior(o DataValidationOperator) string {
+	typeMap := map[DataValidationOperator]string{
+		DataValidationOperatorBetween:            "between",
+		DataValidationOperatorEqual:              "equal",
+		DataValidationOperatorGreaterThan:        "greaterThan",
+		DataValidationOperatorGreaterThanOrEqual: "greaterThanOrEqual",
+		DataValidationOperatorLessThan:           "lessThan",
+		DataValidationOperatorLessThanOrEqual:    "lessThanOrEqual",
+		DataValidationOperatorNotBetween:         "notBetween",
+		DataValidationOperatorNotEqual:           "notEqual",
+	}
+
+	return typeMap[o]
+
+}
+
+// AddDataValidation provides set data validation on a range of the worksheet
+// by given data validation object and worksheet name. The data validation
+// object can be created by NewDataValidation function.
+//
+// Example 1, set data validation on Sheet1!A1:B2 with validation criteria
+// settings, show error alert after invalid data is entered with "Stop" style
+// and custom title "error body":
+//
+//     dvRange := excelize.NewDataValidation(true)
+//     dvRange.Sqref = "A1:B2"
+//     dvRange.SetRange(10, 20, excelize.DataValidationTypeWhole, excelize.DataValidationOperatorBetween)
+//     dvRange.SetError(excelize.DataValidationErrorStyleStop, "error title", "error body")
+//     err := f.AddDataValidation("Sheet1", dvRange)
+//
+// Example 2, set data validation on Sheet1!A3:B4 with validation criteria
+// settings, and show input message when cell is selected:
+//
+//     dvRange = excelize.NewDataValidation(true)
+//     dvRange.Sqref = "A3:B4"
+//     dvRange.SetRange(10, 20, excelize.DataValidationTypeWhole, excelize.DataValidationOperatorGreaterThan)
+//     dvRange.SetInput("input title", "input body")
+//     err = f.AddDataValidation("Sheet1", dvRange)
+//
+// Example 3, set data validation on Sheet1!A5:B6 with validation criteria
+// settings, create in-cell dropdown by allowing list source:
+//
+//     dvRange = excelize.NewDataValidation(true)
+//     dvRange.Sqref = "A5:B6"
+//     dvRange.SetDropList([]string{"1", "2", "3"})
+//     err = f.AddDataValidation("Sheet1", dvRange)
+//
+func (f *File) AddDataValidation(sheet string, dv *DataValidation) error {
+	ws, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	if nil == ws.DataValidations {
+		ws.DataValidations = new(xlsxDataValidations)
+	}
+	ws.DataValidations.DataValidation = append(ws.DataValidations.DataValidation, dv)
+	ws.DataValidations.Count = len(ws.DataValidations.DataValidation)
+	return err
+}
+
+// DeleteDataValidation delete data validation by given worksheet name and
+// reference sequence.
+func (f *File) DeleteDataValidation(sheet, sqref string) error {
+	ws, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	if ws.DataValidations == nil {
+		return nil
+	}
+	dv := ws.DataValidations
+	for i := 0; i < len(dv.DataValidation); i++ {
+		if dv.DataValidation[i].Sqref == sqref {
+			dv.DataValidation = append(dv.DataValidation[:i], dv.DataValidation[i+1:]...)
+			i--
+		}
+	}
+	dv.Count = len(dv.DataValidation)
+	if dv.Count == 0 {
+		ws.DataValidations = nil
+	}
+	return nil
+}

+ 184 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/date.go

@@ -0,0 +1,184 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"errors"
+	"math"
+	"time"
+)
+
+const (
+	dayNanoseconds = 24 * time.Hour
+	maxDuration    = 290 * 364 * dayNanoseconds
+)
+
+var (
+	excelMinTime1900      = time.Date(1899, time.December, 31, 0, 0, 0, 0, time.UTC)
+	excelBuggyPeriodStart = time.Date(1900, time.March, 1, 0, 0, 0, 0, time.UTC).Add(-time.Nanosecond)
+)
+
+// timeToExcelTime provides a function to convert time to Excel time.
+func timeToExcelTime(t time.Time) (float64, error) {
+	// TODO in future this should probably also handle date1904 and like TimeFromExcelTime
+
+	// Force user to explicit convet passed value to UTC time.
+	// Because for example 1900-01-01 00:00:00 +0300 MSK converts to 1900-01-01 00:00:00 +0230 LMT
+	// probably due to daylight saving.
+	if t.Location() != time.UTC {
+		return 0.0, errors.New("only UTC time expected")
+	}
+
+	if t.Before(excelMinTime1900) {
+		return 0.0, nil
+	}
+
+	tt := t
+	diff := t.Sub(excelMinTime1900)
+	result := float64(0)
+
+	for diff >= maxDuration {
+		result += float64(maxDuration / dayNanoseconds)
+		tt = tt.Add(-maxDuration)
+		diff = tt.Sub(excelMinTime1900)
+	}
+
+	rem := diff % dayNanoseconds
+	result += float64(diff-rem)/float64(dayNanoseconds) + float64(rem)/float64(dayNanoseconds)
+
+	// Excel dates after 28th February 1900 are actually one day out.
+	// Excel behaves as though the date 29th February 1900 existed, which it didn't.
+	// Microsoft intentionally included this bug in Excel so that it would remain compatible with the spreadsheet
+	// program that had the majority market share at the time; Lotus 1-2-3.
+	// https://www.myonlinetraininghub.com/excel-date-and-time
+	if t.After(excelBuggyPeriodStart) {
+		result += 1.0
+	}
+	return result, nil
+}
+
+// shiftJulianToNoon provides a function to process julian date to noon.
+func shiftJulianToNoon(julianDays, julianFraction float64) (float64, float64) {
+	switch {
+	case -0.5 < julianFraction && julianFraction < 0.5:
+		julianFraction += 0.5
+	case julianFraction >= 0.5:
+		julianDays++
+		julianFraction -= 0.5
+	case julianFraction <= -0.5:
+		julianDays--
+		julianFraction += 1.5
+	}
+	return julianDays, julianFraction
+}
+
+// fractionOfADay provides a function to return the integer values for hour,
+// minutes, seconds and nanoseconds that comprised a given fraction of a day.
+// values would round to 1 us.
+func fractionOfADay(fraction float64) (hours, minutes, seconds, nanoseconds int) {
+
+	const (
+		c1us  = 1e3
+		c1s   = 1e9
+		c1day = 24 * 60 * 60 * c1s
+	)
+
+	frac := int64(c1day*fraction + c1us/2)
+	nanoseconds = int((frac%c1s)/c1us) * c1us
+	frac /= c1s
+	seconds = int(frac % 60)
+	frac /= 60
+	minutes = int(frac % 60)
+	hours = int(frac / 60)
+	return
+}
+
+// julianDateToGregorianTime provides a function to convert julian date to
+// gregorian time.
+func julianDateToGregorianTime(part1, part2 float64) time.Time {
+	part1I, part1F := math.Modf(part1)
+	part2I, part2F := math.Modf(part2)
+	julianDays := part1I + part2I
+	julianFraction := part1F + part2F
+	julianDays, julianFraction = shiftJulianToNoon(julianDays, julianFraction)
+	day, month, year := doTheFliegelAndVanFlandernAlgorithm(int(julianDays))
+	hours, minutes, seconds, nanoseconds := fractionOfADay(julianFraction)
+	return time.Date(year, time.Month(month), day, hours, minutes, seconds, nanoseconds, time.UTC)
+}
+
+// doTheFliegelAndVanFlandernAlgorithm; By this point generations of
+// programmers have repeated the algorithm sent to the editor of
+// "Communications of the ACM" in 1968 (published in CACM, volume 11, number
+// 10, October 1968, p.657). None of those programmers seems to have found it
+// necessary to explain the constants or variable names set out by Henry F.
+// Fliegel and Thomas C. Van Flandern.  Maybe one day I'll buy that jounal and
+// expand an explanation here - that day is not today.
+func doTheFliegelAndVanFlandernAlgorithm(jd int) (day, month, year int) {
+	l := jd + 68569
+	n := (4 * l) / 146097
+	l = l - (146097*n+3)/4
+	i := (4000 * (l + 1)) / 1461001
+	l = l - (1461*i)/4 + 31
+	j := (80 * l) / 2447
+	d := l - (2447*j)/80
+	l = j / 11
+	m := j + 2 - (12 * l)
+	y := 100*(n-49) + i + l
+	return d, m, y
+}
+
+// timeFromExcelTime provides a function to convert an excelTime
+// representation (stored as a floating point number) to a time.Time.
+func timeFromExcelTime(excelTime float64, date1904 bool) time.Time {
+	const MDD int64 = 106750 // Max time.Duration Days, aprox. 290 years
+	var date time.Time
+	var intPart = int64(excelTime)
+	// Excel uses Julian dates prior to March 1st 1900, and Gregorian
+	// thereafter.
+	if intPart <= 61 {
+		const OFFSET1900 = 15018.0
+		const OFFSET1904 = 16480.0
+		const MJD0 float64 = 2400000.5
+		var date time.Time
+		if date1904 {
+			date = julianDateToGregorianTime(MJD0, excelTime+OFFSET1904)
+		} else {
+			date = julianDateToGregorianTime(MJD0, excelTime+OFFSET1900)
+		}
+		return date
+	}
+	var floatPart = excelTime - float64(intPart)
+	var dayNanoSeconds float64 = 24 * 60 * 60 * 1000 * 1000 * 1000
+	if date1904 {
+		date = time.Date(1904, 1, 1, 0, 0, 0, 0, time.UTC)
+	} else {
+		date = time.Date(1899, 12, 30, 0, 0, 0, 0, time.UTC)
+	}
+
+	// Duration is limited to aprox. 290 years
+	for intPart > MDD {
+		durationDays := time.Duration(MDD) * time.Hour * 24
+		date = date.Add(durationDays)
+		intPart = intPart - MDD
+	}
+	durationDays := time.Duration(intPart) * time.Hour * 24
+	durationPart := time.Duration(dayNanoSeconds * floatPart)
+	return date.Add(durationDays).Add(durationPart)
+}
+
+// ExcelDateToTime converts a float-based excel date representation to a time.Time.
+func ExcelDateToTime(excelDate float64, use1904Format bool) (time.Time, error) {
+	if excelDate < 0 {
+		return time.Time{}, newInvalidExcelDateError(excelDate)
+	}
+	return timeFromExcelTime(excelDate, use1904Format), nil
+}

+ 158 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/docProps.go

@@ -0,0 +1,158 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"bytes"
+	"encoding/xml"
+	"fmt"
+	"io"
+	"reflect"
+)
+
+// SetDocProps provides a function to set document core properties. The
+// properties that can be set are:
+//
+//     Property       | Description
+//    ----------------+-----------------------------------------------------------------------------
+//     Title          | The name given to the resource.
+//                    |
+//     Subject        | The topic of the content of the resource.
+//                    |
+//     Creator        | An entity primarily responsible for making the content of the resource.
+//                    |
+//     Keywords       | A delimited set of keywords to support searching and indexing. This is
+//                    | typically a list of terms that are not available elsewhere in the properties.
+//                    |
+//     Description    | An explanation of the content of the resource.
+//                    |
+//     LastModifiedBy | The user who performed the last modification. The identification is
+//                    | environment-specific.
+//                    |
+//     Language       | The language of the intellectual content of the resource.
+//                    |
+//     Identifier     | An unambiguous reference to the resource within a given context.
+//                    |
+//     Revision       | The topic of the content of the resource.
+//                    |
+//     ContentStatus  | The status of the content. For example: Values might include "Draft",
+//                    | "Reviewed" and "Final"
+//                    |
+//     Category       | A categorization of the content of this package.
+//                    |
+//     Version        | The version number. This value is set by the user or by the application.
+//
+// For example:
+//
+//    err := f.SetDocProps(&excelize.DocProperties{
+//        Category:       "category",
+//        ContentStatus:  "Draft",
+//        Created:        "2019-06-04T22:00:10Z",
+//        Creator:        "Go Excelize",
+//        Description:    "This file created by Go Excelize",
+//        Identifier:     "xlsx",
+//        Keywords:       "Spreadsheet",
+//        LastModifiedBy: "Go Author",
+//        Modified:       "2019-06-04T22:00:10Z",
+//        Revision:       "0",
+//        Subject:        "Test Subject",
+//        Title:          "Test Title",
+//        Language:       "en-US",
+//        Version:        "1.0.0",
+//    })
+//
+func (f *File) SetDocProps(docProperties *DocProperties) (err error) {
+	var (
+		core               *decodeCoreProperties
+		newProps           *xlsxCoreProperties
+		fields             []string
+		output             []byte
+		immutable, mutable reflect.Value
+		field, val         string
+	)
+
+	core = new(decodeCoreProperties)
+	if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML("docProps/core.xml")))).
+		Decode(core); err != nil && err != io.EOF {
+		err = fmt.Errorf("xml decode error: %s", err)
+		return
+	}
+	newProps, err = &xlsxCoreProperties{
+		Dc:             NameSpaceDublinCore,
+		Dcterms:        NameSpaceDublinCoreTerms,
+		Dcmitype:       NameSpaceDublinCoreMetadataIntiative,
+		XSI:            NameSpaceXMLSchemaInstance,
+		Title:          core.Title,
+		Subject:        core.Subject,
+		Creator:        core.Creator,
+		Keywords:       core.Keywords,
+		Description:    core.Description,
+		LastModifiedBy: core.LastModifiedBy,
+		Language:       core.Language,
+		Identifier:     core.Identifier,
+		Revision:       core.Revision,
+		ContentStatus:  core.ContentStatus,
+		Category:       core.Category,
+		Version:        core.Version,
+	}, nil
+	newProps.Created.Text, newProps.Created.Type, newProps.Modified.Text, newProps.Modified.Type =
+		core.Created.Text, core.Created.Type, core.Modified.Text, core.Modified.Type
+	fields = []string{
+		"Category", "ContentStatus", "Creator", "Description", "Identifier", "Keywords",
+		"LastModifiedBy", "Revision", "Subject", "Title", "Language", "Version",
+	}
+	immutable, mutable = reflect.ValueOf(*docProperties), reflect.ValueOf(newProps).Elem()
+	for _, field = range fields {
+		if val = immutable.FieldByName(field).String(); val != "" {
+			mutable.FieldByName(field).SetString(val)
+		}
+	}
+	if docProperties.Created != "" {
+		newProps.Created.Text = docProperties.Created
+	}
+	if docProperties.Modified != "" {
+		newProps.Modified.Text = docProperties.Modified
+	}
+	output, err = xml.Marshal(newProps)
+	f.saveFileList("docProps/core.xml", output)
+
+	return
+}
+
+// GetDocProps provides a function to get document core properties.
+func (f *File) GetDocProps() (ret *DocProperties, err error) {
+	var core = new(decodeCoreProperties)
+
+	if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML("docProps/core.xml")))).
+		Decode(core); err != nil && err != io.EOF {
+		err = fmt.Errorf("xml decode error: %s", err)
+		return
+	}
+	ret, err = &DocProperties{
+		Category:       core.Category,
+		ContentStatus:  core.ContentStatus,
+		Created:        core.Created.Text,
+		Creator:        core.Creator,
+		Description:    core.Description,
+		Identifier:     core.Identifier,
+		Keywords:       core.Keywords,
+		LastModifiedBy: core.LastModifiedBy,
+		Modified:       core.Modified.Text,
+		Revision:       core.Revision,
+		Subject:        core.Subject,
+		Title:          core.Title,
+		Language:       core.Language,
+		Version:        core.Version,
+	}, nil
+
+	return
+}

+ 1313 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/drawing.go

@@ -0,0 +1,1313 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"bytes"
+	"encoding/xml"
+	"fmt"
+	"io"
+	"log"
+	"reflect"
+	"strconv"
+	"strings"
+)
+
+// prepareDrawing provides a function to prepare drawing ID and XML by given
+// drawingID, worksheet name and default drawingXML.
+func (f *File) prepareDrawing(xlsx *xlsxWorksheet, drawingID int, sheet, drawingXML string) (int, string) {
+	sheetRelationshipsDrawingXML := "../drawings/drawing" + strconv.Itoa(drawingID) + ".xml"
+	if xlsx.Drawing != nil {
+		// The worksheet already has a picture or chart relationships, use the relationships drawing ../drawings/drawing%d.xml.
+		sheetRelationshipsDrawingXML = f.getSheetRelationshipsTargetByID(sheet, xlsx.Drawing.RID)
+		drawingID, _ = strconv.Atoi(strings.TrimSuffix(strings.TrimPrefix(sheetRelationshipsDrawingXML, "../drawings/drawing"), ".xml"))
+		drawingXML = strings.Replace(sheetRelationshipsDrawingXML, "..", "xl", -1)
+	} else {
+		// Add first picture for given sheet.
+		sheetRels := "xl/worksheets/_rels/" + strings.TrimPrefix(f.sheetMap[trimSheetName(sheet)], "xl/worksheets/") + ".rels"
+		rID := f.addRels(sheetRels, SourceRelationshipDrawingML, sheetRelationshipsDrawingXML, "")
+		f.addSheetDrawing(sheet, rID)
+	}
+	return drawingID, drawingXML
+}
+
+// prepareChartSheetDrawing provides a function to prepare drawing ID and XML
+// by given drawingID, worksheet name and default drawingXML.
+func (f *File) prepareChartSheetDrawing(xlsx *xlsxChartsheet, drawingID int, sheet string) {
+	sheetRelationshipsDrawingXML := "../drawings/drawing" + strconv.Itoa(drawingID) + ".xml"
+	// Only allow one chart in a chartsheet.
+	sheetRels := "xl/chartsheets/_rels/" + strings.TrimPrefix(f.sheetMap[trimSheetName(sheet)], "xl/chartsheets/") + ".rels"
+	rID := f.addRels(sheetRels, SourceRelationshipDrawingML, sheetRelationshipsDrawingXML, "")
+	f.addSheetNameSpace(sheet, SourceRelationship)
+	xlsx.Drawing = &xlsxDrawing{
+		RID: "rId" + strconv.Itoa(rID),
+	}
+	return
+}
+
+// addChart provides a function to create chart as xl/charts/chart%d.xml by
+// given format sets.
+func (f *File) addChart(formatSet *formatChart, comboCharts []*formatChart) {
+	count := f.countCharts()
+	xlsxChartSpace := xlsxChartSpace{
+		XMLNSc:         NameSpaceDrawingMLChart,
+		XMLNSa:         NameSpaceDrawingML,
+		XMLNSr:         SourceRelationship.Value,
+		XMLNSc16r2:     SourceRelationshipChart201506,
+		Date1904:       &attrValBool{Val: boolPtr(false)},
+		Lang:           &attrValString{Val: stringPtr("en-US")},
+		RoundedCorners: &attrValBool{Val: boolPtr(false)},
+		Chart: cChart{
+			Title: &cTitle{
+				Tx: cTx{
+					Rich: &cRich{
+						P: aP{
+							PPr: &aPPr{
+								DefRPr: aRPr{
+									Kern:   1200,
+									Strike: "noStrike",
+									U:      "none",
+									Sz:     1400,
+									SolidFill: &aSolidFill{
+										SchemeClr: &aSchemeClr{
+											Val: "tx1",
+											LumMod: &attrValInt{
+												Val: intPtr(65000),
+											},
+											LumOff: &attrValInt{
+												Val: intPtr(35000),
+											},
+										},
+									},
+									Ea: &aEa{
+										Typeface: "+mn-ea",
+									},
+									Cs: &aCs{
+										Typeface: "+mn-cs",
+									},
+									Latin: &aLatin{
+										Typeface: "+mn-lt",
+									},
+								},
+							},
+							R: &aR{
+								RPr: aRPr{
+									Lang:    "en-US",
+									AltLang: "en-US",
+								},
+								T: formatSet.Title.Name,
+							},
+						},
+					},
+				},
+				TxPr: cTxPr{
+					P: aP{
+						PPr: &aPPr{
+							DefRPr: aRPr{
+								Kern:   1200,
+								U:      "none",
+								Sz:     14000,
+								Strike: "noStrike",
+							},
+						},
+						EndParaRPr: &aEndParaRPr{
+							Lang: "en-US",
+						},
+					},
+				},
+				Overlay: &attrValBool{Val: boolPtr(false)},
+			},
+			View3D: &cView3D{
+				RotX:        &attrValInt{Val: intPtr(chartView3DRotX[formatSet.Type])},
+				RotY:        &attrValInt{Val: intPtr(chartView3DRotY[formatSet.Type])},
+				Perspective: &attrValInt{Val: intPtr(chartView3DPerspective[formatSet.Type])},
+				RAngAx:      &attrValInt{Val: intPtr(chartView3DRAngAx[formatSet.Type])},
+			},
+			Floor: &cThicknessSpPr{
+				Thickness: &attrValInt{Val: intPtr(0)},
+			},
+			SideWall: &cThicknessSpPr{
+				Thickness: &attrValInt{Val: intPtr(0)},
+			},
+			BackWall: &cThicknessSpPr{
+				Thickness: &attrValInt{Val: intPtr(0)},
+			},
+			PlotArea: &cPlotArea{},
+			Legend: &cLegend{
+				LegendPos: &attrValString{Val: stringPtr(chartLegendPosition[formatSet.Legend.Position])},
+				Overlay:   &attrValBool{Val: boolPtr(false)},
+			},
+
+			PlotVisOnly:      &attrValBool{Val: boolPtr(false)},
+			DispBlanksAs:     &attrValString{Val: stringPtr(formatSet.ShowBlanksAs)},
+			ShowDLblsOverMax: &attrValBool{Val: boolPtr(false)},
+		},
+		SpPr: &cSpPr{
+			SolidFill: &aSolidFill{
+				SchemeClr: &aSchemeClr{Val: "bg1"},
+			},
+			Ln: &aLn{
+				W:    9525,
+				Cap:  "flat",
+				Cmpd: "sng",
+				Algn: "ctr",
+				SolidFill: &aSolidFill{
+					SchemeClr: &aSchemeClr{Val: "tx1",
+						LumMod: &attrValInt{
+							Val: intPtr(15000),
+						},
+						LumOff: &attrValInt{
+							Val: intPtr(85000),
+						},
+					},
+				},
+			},
+		},
+		PrintSettings: &cPrintSettings{
+			PageMargins: &cPageMargins{
+				B:      0.75,
+				L:      0.7,
+				R:      0.7,
+				T:      0.7,
+				Header: 0.3,
+				Footer: 0.3,
+			},
+		},
+	}
+	plotAreaFunc := map[string]func(*formatChart) *cPlotArea{
+		Area:                        f.drawBaseChart,
+		AreaStacked:                 f.drawBaseChart,
+		AreaPercentStacked:          f.drawBaseChart,
+		Area3D:                      f.drawBaseChart,
+		Area3DStacked:               f.drawBaseChart,
+		Area3DPercentStacked:        f.drawBaseChart,
+		Bar:                         f.drawBaseChart,
+		BarStacked:                  f.drawBaseChart,
+		BarPercentStacked:           f.drawBaseChart,
+		Bar3DClustered:              f.drawBaseChart,
+		Bar3DStacked:                f.drawBaseChart,
+		Bar3DPercentStacked:         f.drawBaseChart,
+		Bar3DConeClustered:          f.drawBaseChart,
+		Bar3DConeStacked:            f.drawBaseChart,
+		Bar3DConePercentStacked:     f.drawBaseChart,
+		Bar3DPyramidClustered:       f.drawBaseChart,
+		Bar3DPyramidStacked:         f.drawBaseChart,
+		Bar3DPyramidPercentStacked:  f.drawBaseChart,
+		Bar3DCylinderClustered:      f.drawBaseChart,
+		Bar3DCylinderStacked:        f.drawBaseChart,
+		Bar3DCylinderPercentStacked: f.drawBaseChart,
+		Col:                         f.drawBaseChart,
+		ColStacked:                  f.drawBaseChart,
+		ColPercentStacked:           f.drawBaseChart,
+		Col3D:                       f.drawBaseChart,
+		Col3DClustered:              f.drawBaseChart,
+		Col3DStacked:                f.drawBaseChart,
+		Col3DPercentStacked:         f.drawBaseChart,
+		Col3DCone:                   f.drawBaseChart,
+		Col3DConeClustered:          f.drawBaseChart,
+		Col3DConeStacked:            f.drawBaseChart,
+		Col3DConePercentStacked:     f.drawBaseChart,
+		Col3DPyramid:                f.drawBaseChart,
+		Col3DPyramidClustered:       f.drawBaseChart,
+		Col3DPyramidStacked:         f.drawBaseChart,
+		Col3DPyramidPercentStacked:  f.drawBaseChart,
+		Col3DCylinder:               f.drawBaseChart,
+		Col3DCylinderClustered:      f.drawBaseChart,
+		Col3DCylinderStacked:        f.drawBaseChart,
+		Col3DCylinderPercentStacked: f.drawBaseChart,
+		Doughnut:                    f.drawDoughnutChart,
+		Line:                        f.drawLineChart,
+		Pie3D:                       f.drawPie3DChart,
+		Pie:                         f.drawPieChart,
+		PieOfPieChart:               f.drawPieOfPieChart,
+		BarOfPieChart:               f.drawBarOfPieChart,
+		Radar:                       f.drawRadarChart,
+		Scatter:                     f.drawScatterChart,
+		Surface3D:                   f.drawSurface3DChart,
+		WireframeSurface3D:          f.drawSurface3DChart,
+		Contour:                     f.drawSurfaceChart,
+		WireframeContour:            f.drawSurfaceChart,
+		Bubble:                      f.drawBaseChart,
+		Bubble3D:                    f.drawBaseChart,
+	}
+	addChart := func(c, p *cPlotArea) {
+		immutable, mutable := reflect.ValueOf(c).Elem(), reflect.ValueOf(p).Elem()
+		for i := 0; i < mutable.NumField(); i++ {
+			field := mutable.Field(i)
+			if field.IsNil() {
+				continue
+			}
+			immutable.FieldByName(mutable.Type().Field(i).Name).Set(field)
+		}
+	}
+	addChart(xlsxChartSpace.Chart.PlotArea, plotAreaFunc[formatSet.Type](formatSet))
+	order := len(formatSet.Series)
+	for idx := range comboCharts {
+		comboCharts[idx].order = order
+		addChart(xlsxChartSpace.Chart.PlotArea, plotAreaFunc[comboCharts[idx].Type](comboCharts[idx]))
+		order += len(comboCharts[idx].Series)
+	}
+	chart, _ := xml.Marshal(xlsxChartSpace)
+	media := "xl/charts/chart" + strconv.Itoa(count+1) + ".xml"
+	f.saveFileList(media, chart)
+}
+
+// drawBaseChart provides a function to draw the c:plotArea element for bar,
+// and column series charts by given format sets.
+func (f *File) drawBaseChart(formatSet *formatChart) *cPlotArea {
+	c := cCharts{
+		BarDir: &attrValString{
+			Val: stringPtr("col"),
+		},
+		Grouping: &attrValString{
+			Val: stringPtr("clustered"),
+		},
+		VaryColors: &attrValBool{
+			Val: boolPtr(true),
+		},
+		Ser:   f.drawChartSeries(formatSet),
+		Shape: f.drawChartShape(formatSet),
+		DLbls: f.drawChartDLbls(formatSet),
+		AxID: []*attrValInt{
+			{Val: intPtr(754001152)},
+			{Val: intPtr(753999904)},
+		},
+		Overlap: &attrValInt{Val: intPtr(100)},
+	}
+	var ok bool
+	if *c.BarDir.Val, ok = plotAreaChartBarDir[formatSet.Type]; !ok {
+		c.BarDir = nil
+	}
+	if *c.Grouping.Val, ok = plotAreaChartGrouping[formatSet.Type]; !ok {
+		c.Grouping = nil
+	}
+	if *c.Overlap.Val, ok = plotAreaChartOverlap[formatSet.Type]; !ok {
+		c.Overlap = nil
+	}
+	catAx := f.drawPlotAreaCatAx(formatSet)
+	valAx := f.drawPlotAreaValAx(formatSet)
+	charts := map[string]*cPlotArea{
+		"area": {
+			AreaChart: &c,
+			CatAx:     catAx,
+			ValAx:     valAx,
+		},
+		"areaStacked": {
+			AreaChart: &c,
+			CatAx:     catAx,
+			ValAx:     valAx,
+		},
+		"areaPercentStacked": {
+			AreaChart: &c,
+			CatAx:     catAx,
+			ValAx:     valAx,
+		},
+		"area3D": {
+			Area3DChart: &c,
+			CatAx:       catAx,
+			ValAx:       valAx,
+		},
+		"area3DStacked": {
+			Area3DChart: &c,
+			CatAx:       catAx,
+			ValAx:       valAx,
+		},
+		"area3DPercentStacked": {
+			Area3DChart: &c,
+			CatAx:       catAx,
+			ValAx:       valAx,
+		},
+		"bar": {
+			BarChart: &c,
+			CatAx:    catAx,
+			ValAx:    valAx,
+		},
+		"barStacked": {
+			BarChart: &c,
+			CatAx:    catAx,
+			ValAx:    valAx,
+		},
+		"barPercentStacked": {
+			BarChart: &c,
+			CatAx:    catAx,
+			ValAx:    valAx,
+		},
+		"bar3DClustered": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"bar3DStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"bar3DPercentStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"bar3DConeClustered": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"bar3DConeStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"bar3DConePercentStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"bar3DPyramidClustered": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"bar3DPyramidStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"bar3DPyramidPercentStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"bar3DCylinderClustered": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"bar3DCylinderStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"bar3DCylinderPercentStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col": {
+			BarChart: &c,
+			CatAx:    catAx,
+			ValAx:    valAx,
+		},
+		"colStacked": {
+			BarChart: &c,
+			CatAx:    catAx,
+			ValAx:    valAx,
+		},
+		"colPercentStacked": {
+			BarChart: &c,
+			CatAx:    catAx,
+			ValAx:    valAx,
+		},
+		"col3D": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col3DClustered": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col3DStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col3DPercentStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col3DCone": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col3DConeClustered": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col3DConeStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col3DConePercentStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col3DPyramid": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col3DPyramidClustered": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col3DPyramidStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col3DPyramidPercentStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col3DCylinder": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col3DCylinderClustered": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col3DCylinderStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"col3DCylinderPercentStacked": {
+			Bar3DChart: &c,
+			CatAx:      catAx,
+			ValAx:      valAx,
+		},
+		"bubble": {
+			BubbleChart: &c,
+			CatAx:       catAx,
+			ValAx:       valAx,
+		},
+		"bubble3D": {
+			BubbleChart: &c,
+			CatAx:       catAx,
+			ValAx:       valAx,
+		},
+	}
+	return charts[formatSet.Type]
+}
+
+// drawDoughnutChart provides a function to draw the c:plotArea element for
+// doughnut chart by given format sets.
+func (f *File) drawDoughnutChart(formatSet *formatChart) *cPlotArea {
+	return &cPlotArea{
+		DoughnutChart: &cCharts{
+			VaryColors: &attrValBool{
+				Val: boolPtr(true),
+			},
+			Ser:      f.drawChartSeries(formatSet),
+			HoleSize: &attrValInt{Val: intPtr(75)},
+		},
+	}
+}
+
+// drawLineChart provides a function to draw the c:plotArea element for line
+// chart by given format sets.
+func (f *File) drawLineChart(formatSet *formatChart) *cPlotArea {
+	return &cPlotArea{
+		LineChart: &cCharts{
+			Grouping: &attrValString{
+				Val: stringPtr(plotAreaChartGrouping[formatSet.Type]),
+			},
+			VaryColors: &attrValBool{
+				Val: boolPtr(false),
+			},
+			Ser:   f.drawChartSeries(formatSet),
+			DLbls: f.drawChartDLbls(formatSet),
+			Smooth: &attrValBool{
+				Val: boolPtr(false),
+			},
+			AxID: []*attrValInt{
+				{Val: intPtr(754001152)},
+				{Val: intPtr(753999904)},
+			},
+		},
+		CatAx: f.drawPlotAreaCatAx(formatSet),
+		ValAx: f.drawPlotAreaValAx(formatSet),
+	}
+}
+
+// drawPieChart provides a function to draw the c:plotArea element for pie
+// chart by given format sets.
+func (f *File) drawPieChart(formatSet *formatChart) *cPlotArea {
+	return &cPlotArea{
+		PieChart: &cCharts{
+			VaryColors: &attrValBool{
+				Val: boolPtr(true),
+			},
+			Ser: f.drawChartSeries(formatSet),
+		},
+	}
+}
+
+// drawPie3DChart provides a function to draw the c:plotArea element for 3D
+// pie chart by given format sets.
+func (f *File) drawPie3DChart(formatSet *formatChart) *cPlotArea {
+	return &cPlotArea{
+		Pie3DChart: &cCharts{
+			VaryColors: &attrValBool{
+				Val: boolPtr(true),
+			},
+			Ser: f.drawChartSeries(formatSet),
+		},
+	}
+}
+
+// drawPieOfPieChart provides a function to draw the c:plotArea element for
+// pie chart by given format sets.
+func (f *File) drawPieOfPieChart(formatSet *formatChart) *cPlotArea {
+	return &cPlotArea{
+		OfPieChart: &cCharts{
+			OfPieType: &attrValString{
+				Val: stringPtr("pie"),
+			},
+			VaryColors: &attrValBool{
+				Val: boolPtr(true),
+			},
+			Ser:      f.drawChartSeries(formatSet),
+			SerLines: &attrValString{},
+		},
+	}
+}
+
+// drawBarOfPieChart provides a function to draw the c:plotArea element for
+// pie chart by given format sets.
+func (f *File) drawBarOfPieChart(formatSet *formatChart) *cPlotArea {
+	return &cPlotArea{
+		OfPieChart: &cCharts{
+			OfPieType: &attrValString{
+				Val: stringPtr("bar"),
+			},
+			VaryColors: &attrValBool{
+				Val: boolPtr(true),
+			},
+			Ser:      f.drawChartSeries(formatSet),
+			SerLines: &attrValString{},
+		},
+	}
+}
+
+// drawRadarChart provides a function to draw the c:plotArea element for radar
+// chart by given format sets.
+func (f *File) drawRadarChart(formatSet *formatChart) *cPlotArea {
+	return &cPlotArea{
+		RadarChart: &cCharts{
+			RadarStyle: &attrValString{
+				Val: stringPtr("marker"),
+			},
+			VaryColors: &attrValBool{
+				Val: boolPtr(false),
+			},
+			Ser:   f.drawChartSeries(formatSet),
+			DLbls: f.drawChartDLbls(formatSet),
+			AxID: []*attrValInt{
+				{Val: intPtr(754001152)},
+				{Val: intPtr(753999904)},
+			},
+		},
+		CatAx: f.drawPlotAreaCatAx(formatSet),
+		ValAx: f.drawPlotAreaValAx(formatSet),
+	}
+}
+
+// drawScatterChart provides a function to draw the c:plotArea element for
+// scatter chart by given format sets.
+func (f *File) drawScatterChart(formatSet *formatChart) *cPlotArea {
+	return &cPlotArea{
+		ScatterChart: &cCharts{
+			ScatterStyle: &attrValString{
+				Val: stringPtr("smoothMarker"), // line,lineMarker,marker,none,smooth,smoothMarker
+			},
+			VaryColors: &attrValBool{
+				Val: boolPtr(false),
+			},
+			Ser:   f.drawChartSeries(formatSet),
+			DLbls: f.drawChartDLbls(formatSet),
+			AxID: []*attrValInt{
+				{Val: intPtr(754001152)},
+				{Val: intPtr(753999904)},
+			},
+		},
+		CatAx: f.drawPlotAreaCatAx(formatSet),
+		ValAx: f.drawPlotAreaValAx(formatSet),
+	}
+}
+
+// drawSurface3DChart provides a function to draw the c:surface3DChart element by
+// given format sets.
+func (f *File) drawSurface3DChart(formatSet *formatChart) *cPlotArea {
+	plotArea := &cPlotArea{
+		Surface3DChart: &cCharts{
+			Ser: f.drawChartSeries(formatSet),
+			AxID: []*attrValInt{
+				{Val: intPtr(754001152)},
+				{Val: intPtr(753999904)},
+				{Val: intPtr(832256642)},
+			},
+		},
+		CatAx: f.drawPlotAreaCatAx(formatSet),
+		ValAx: f.drawPlotAreaValAx(formatSet),
+		SerAx: f.drawPlotAreaSerAx(formatSet),
+	}
+	if formatSet.Type == WireframeSurface3D {
+		plotArea.Surface3DChart.Wireframe = &attrValBool{Val: boolPtr(true)}
+	}
+	return plotArea
+}
+
+// drawSurfaceChart provides a function to draw the c:surfaceChart element by
+// given format sets.
+func (f *File) drawSurfaceChart(formatSet *formatChart) *cPlotArea {
+	plotArea := &cPlotArea{
+		SurfaceChart: &cCharts{
+			Ser: f.drawChartSeries(formatSet),
+			AxID: []*attrValInt{
+				{Val: intPtr(754001152)},
+				{Val: intPtr(753999904)},
+				{Val: intPtr(832256642)},
+			},
+		},
+		CatAx: f.drawPlotAreaCatAx(formatSet),
+		ValAx: f.drawPlotAreaValAx(formatSet),
+		SerAx: f.drawPlotAreaSerAx(formatSet),
+	}
+	if formatSet.Type == WireframeContour {
+		plotArea.SurfaceChart.Wireframe = &attrValBool{Val: boolPtr(true)}
+	}
+	return plotArea
+}
+
+// drawChartShape provides a function to draw the c:shape element by given
+// format sets.
+func (f *File) drawChartShape(formatSet *formatChart) *attrValString {
+	shapes := map[string]string{
+		Bar3DConeClustered:          "cone",
+		Bar3DConeStacked:            "cone",
+		Bar3DConePercentStacked:     "cone",
+		Bar3DPyramidClustered:       "pyramid",
+		Bar3DPyramidStacked:         "pyramid",
+		Bar3DPyramidPercentStacked:  "pyramid",
+		Bar3DCylinderClustered:      "cylinder",
+		Bar3DCylinderStacked:        "cylinder",
+		Bar3DCylinderPercentStacked: "cylinder",
+		Col3DCone:                   "cone",
+		Col3DConeClustered:          "cone",
+		Col3DConeStacked:            "cone",
+		Col3DConePercentStacked:     "cone",
+		Col3DPyramid:                "pyramid",
+		Col3DPyramidClustered:       "pyramid",
+		Col3DPyramidStacked:         "pyramid",
+		Col3DPyramidPercentStacked:  "pyramid",
+		Col3DCylinder:               "cylinder",
+		Col3DCylinderClustered:      "cylinder",
+		Col3DCylinderStacked:        "cylinder",
+		Col3DCylinderPercentStacked: "cylinder",
+	}
+	if shape, ok := shapes[formatSet.Type]; ok {
+		return &attrValString{Val: stringPtr(shape)}
+	}
+	return nil
+}
+
+// drawChartSeries provides a function to draw the c:ser element by given
+// format sets.
+func (f *File) drawChartSeries(formatSet *formatChart) *[]cSer {
+	ser := []cSer{}
+	for k := range formatSet.Series {
+		ser = append(ser, cSer{
+			IDx:   &attrValInt{Val: intPtr(k + formatSet.order)},
+			Order: &attrValInt{Val: intPtr(k + formatSet.order)},
+			Tx: &cTx{
+				StrRef: &cStrRef{
+					F: formatSet.Series[k].Name,
+				},
+			},
+			SpPr:       f.drawChartSeriesSpPr(k, formatSet),
+			Marker:     f.drawChartSeriesMarker(k, formatSet),
+			DPt:        f.drawChartSeriesDPt(k, formatSet),
+			DLbls:      f.drawChartSeriesDLbls(formatSet),
+			Cat:        f.drawChartSeriesCat(formatSet.Series[k], formatSet),
+			Val:        f.drawChartSeriesVal(formatSet.Series[k], formatSet),
+			XVal:       f.drawChartSeriesXVal(formatSet.Series[k], formatSet),
+			YVal:       f.drawChartSeriesYVal(formatSet.Series[k], formatSet),
+			BubbleSize: f.drawCharSeriesBubbleSize(formatSet.Series[k], formatSet),
+			Bubble3D:   f.drawCharSeriesBubble3D(formatSet),
+		})
+	}
+	return &ser
+}
+
+// drawChartSeriesSpPr provides a function to draw the c:spPr element by given
+// format sets.
+func (f *File) drawChartSeriesSpPr(i int, formatSet *formatChart) *cSpPr {
+	spPrScatter := &cSpPr{
+		Ln: &aLn{
+			W:      25400,
+			NoFill: " ",
+		},
+	}
+	spPrLine := &cSpPr{
+		Ln: &aLn{
+			W:   f.ptToEMUs(formatSet.Series[i].Line.Width),
+			Cap: "rnd", // rnd, sq, flat
+		},
+	}
+	if i+formatSet.order < 6 {
+		spPrLine.Ln.SolidFill = &aSolidFill{
+			SchemeClr: &aSchemeClr{Val: "accent" + strconv.Itoa(i+formatSet.order+1)},
+		}
+	}
+	chartSeriesSpPr := map[string]*cSpPr{Line: spPrLine, Scatter: spPrScatter}
+	return chartSeriesSpPr[formatSet.Type]
+}
+
+// drawChartSeriesDPt provides a function to draw the c:dPt element by given
+// data index and format sets.
+func (f *File) drawChartSeriesDPt(i int, formatSet *formatChart) []*cDPt {
+	dpt := []*cDPt{{
+		IDx:      &attrValInt{Val: intPtr(i)},
+		Bubble3D: &attrValBool{Val: boolPtr(false)},
+		SpPr: &cSpPr{
+			SolidFill: &aSolidFill{
+				SchemeClr: &aSchemeClr{Val: "accent" + strconv.Itoa(i+1)},
+			},
+			Ln: &aLn{
+				W:   25400,
+				Cap: "rnd",
+				SolidFill: &aSolidFill{
+					SchemeClr: &aSchemeClr{Val: "lt" + strconv.Itoa(i+1)},
+				},
+			},
+			Sp3D: &aSp3D{
+				ContourW: 25400,
+				ContourClr: &aContourClr{
+					SchemeClr: &aSchemeClr{Val: "lt" + strconv.Itoa(i+1)},
+				},
+			},
+		},
+	}}
+	chartSeriesDPt := map[string][]*cDPt{Pie: dpt, Pie3D: dpt}
+	return chartSeriesDPt[formatSet.Type]
+}
+
+// drawChartSeriesCat provides a function to draw the c:cat element by given
+// chart series and format sets.
+func (f *File) drawChartSeriesCat(v formatChartSeries, formatSet *formatChart) *cCat {
+	cat := &cCat{
+		StrRef: &cStrRef{
+			F: v.Categories,
+		},
+	}
+	chartSeriesCat := map[string]*cCat{Scatter: nil, Bubble: nil, Bubble3D: nil}
+	if _, ok := chartSeriesCat[formatSet.Type]; ok || v.Categories == "" {
+		return nil
+	}
+	return cat
+}
+
+// drawChartSeriesVal provides a function to draw the c:val element by given
+// chart series and format sets.
+func (f *File) drawChartSeriesVal(v formatChartSeries, formatSet *formatChart) *cVal {
+	val := &cVal{
+		NumRef: &cNumRef{
+			F: v.Values,
+		},
+	}
+	chartSeriesVal := map[string]*cVal{Scatter: nil, Bubble: nil, Bubble3D: nil}
+	if _, ok := chartSeriesVal[formatSet.Type]; ok {
+		return nil
+	}
+	return val
+}
+
+// drawChartSeriesMarker provides a function to draw the c:marker element by
+// given data index and format sets.
+func (f *File) drawChartSeriesMarker(i int, formatSet *formatChart) *cMarker {
+	marker := &cMarker{
+		Symbol: &attrValString{Val: stringPtr("circle")},
+		Size:   &attrValInt{Val: intPtr(5)},
+	}
+	if i < 6 {
+		marker.SpPr = &cSpPr{
+			SolidFill: &aSolidFill{
+				SchemeClr: &aSchemeClr{
+					Val: "accent" + strconv.Itoa(i+1),
+				},
+			},
+			Ln: &aLn{
+				W: 9252,
+				SolidFill: &aSolidFill{
+					SchemeClr: &aSchemeClr{
+						Val: "accent" + strconv.Itoa(i+1),
+					},
+				},
+			},
+		}
+	}
+	chartSeriesMarker := map[string]*cMarker{Scatter: marker}
+	return chartSeriesMarker[formatSet.Type]
+}
+
+// drawChartSeriesXVal provides a function to draw the c:xVal element by given
+// chart series and format sets.
+func (f *File) drawChartSeriesXVal(v formatChartSeries, formatSet *formatChart) *cCat {
+	cat := &cCat{
+		StrRef: &cStrRef{
+			F: v.Categories,
+		},
+	}
+	chartSeriesXVal := map[string]*cCat{Scatter: cat}
+	return chartSeriesXVal[formatSet.Type]
+}
+
+// drawChartSeriesYVal provides a function to draw the c:yVal element by given
+// chart series and format sets.
+func (f *File) drawChartSeriesYVal(v formatChartSeries, formatSet *formatChart) *cVal {
+	val := &cVal{
+		NumRef: &cNumRef{
+			F: v.Values,
+		},
+	}
+	chartSeriesYVal := map[string]*cVal{Scatter: val, Bubble: val, Bubble3D: val}
+	return chartSeriesYVal[formatSet.Type]
+}
+
+// drawCharSeriesBubbleSize provides a function to draw the c:bubbleSize
+// element by given chart series and format sets.
+func (f *File) drawCharSeriesBubbleSize(v formatChartSeries, formatSet *formatChart) *cVal {
+	if _, ok := map[string]bool{Bubble: true, Bubble3D: true}[formatSet.Type]; !ok {
+		return nil
+	}
+	return &cVal{
+		NumRef: &cNumRef{
+			F: v.Values,
+		},
+	}
+}
+
+// drawCharSeriesBubble3D provides a function to draw the c:bubble3D element
+// by given format sets.
+func (f *File) drawCharSeriesBubble3D(formatSet *formatChart) *attrValBool {
+	if _, ok := map[string]bool{Bubble3D: true}[formatSet.Type]; !ok {
+		return nil
+	}
+	return &attrValBool{Val: boolPtr(true)}
+}
+
+// drawChartDLbls provides a function to draw the c:dLbls element by given
+// format sets.
+func (f *File) drawChartDLbls(formatSet *formatChart) *cDLbls {
+	return &cDLbls{
+		ShowLegendKey:   &attrValBool{Val: boolPtr(formatSet.Legend.ShowLegendKey)},
+		ShowVal:         &attrValBool{Val: boolPtr(formatSet.Plotarea.ShowVal)},
+		ShowCatName:     &attrValBool{Val: boolPtr(formatSet.Plotarea.ShowCatName)},
+		ShowSerName:     &attrValBool{Val: boolPtr(formatSet.Plotarea.ShowSerName)},
+		ShowBubbleSize:  &attrValBool{Val: boolPtr(formatSet.Plotarea.ShowBubbleSize)},
+		ShowPercent:     &attrValBool{Val: boolPtr(formatSet.Plotarea.ShowPercent)},
+		ShowLeaderLines: &attrValBool{Val: boolPtr(formatSet.Plotarea.ShowLeaderLines)},
+	}
+}
+
+// drawChartSeriesDLbls provides a function to draw the c:dLbls element by
+// given format sets.
+func (f *File) drawChartSeriesDLbls(formatSet *formatChart) *cDLbls {
+	dLbls := f.drawChartDLbls(formatSet)
+	chartSeriesDLbls := map[string]*cDLbls{Scatter: nil, Surface3D: nil, WireframeSurface3D: nil, Contour: nil, WireframeContour: nil, Bubble: nil, Bubble3D: nil}
+	if _, ok := chartSeriesDLbls[formatSet.Type]; ok {
+		return nil
+	}
+	return dLbls
+}
+
+// drawPlotAreaCatAx provides a function to draw the c:catAx element.
+func (f *File) drawPlotAreaCatAx(formatSet *formatChart) []*cAxs {
+	min := &attrValFloat{Val: float64Ptr(formatSet.XAxis.Minimum)}
+	max := &attrValFloat{Val: float64Ptr(formatSet.XAxis.Maximum)}
+	if formatSet.XAxis.Minimum == 0 {
+		min = nil
+	}
+	if formatSet.XAxis.Maximum == 0 {
+		max = nil
+	}
+	axs := []*cAxs{
+		{
+			AxID: &attrValInt{Val: intPtr(754001152)},
+			Scaling: &cScaling{
+				Orientation: &attrValString{Val: stringPtr(orientation[formatSet.XAxis.ReverseOrder])},
+				Max:         max,
+				Min:         min,
+			},
+			Delete: &attrValBool{Val: boolPtr(false)},
+			AxPos:  &attrValString{Val: stringPtr(catAxPos[formatSet.XAxis.ReverseOrder])},
+			NumFmt: &cNumFmt{
+				FormatCode:   "General",
+				SourceLinked: true,
+			},
+			MajorTickMark: &attrValString{Val: stringPtr("none")},
+			MinorTickMark: &attrValString{Val: stringPtr("none")},
+			TickLblPos:    &attrValString{Val: stringPtr("nextTo")},
+			SpPr:          f.drawPlotAreaSpPr(),
+			TxPr:          f.drawPlotAreaTxPr(),
+			CrossAx:       &attrValInt{Val: intPtr(753999904)},
+			Crosses:       &attrValString{Val: stringPtr("autoZero")},
+			Auto:          &attrValBool{Val: boolPtr(true)},
+			LblAlgn:       &attrValString{Val: stringPtr("ctr")},
+			LblOffset:     &attrValInt{Val: intPtr(100)},
+			NoMultiLvlLbl: &attrValBool{Val: boolPtr(false)},
+		},
+	}
+	if formatSet.XAxis.MajorGridlines {
+		axs[0].MajorGridlines = &cChartLines{SpPr: f.drawPlotAreaSpPr()}
+	}
+	if formatSet.XAxis.MinorGridlines {
+		axs[0].MinorGridlines = &cChartLines{SpPr: f.drawPlotAreaSpPr()}
+	}
+	if formatSet.XAxis.TickLabelSkip != 0 {
+		axs[0].TickLblSkip = &attrValInt{Val: intPtr(formatSet.XAxis.TickLabelSkip)}
+	}
+	return axs
+}
+
+// drawPlotAreaValAx provides a function to draw the c:valAx element.
+func (f *File) drawPlotAreaValAx(formatSet *formatChart) []*cAxs {
+	min := &attrValFloat{Val: float64Ptr(formatSet.YAxis.Minimum)}
+	max := &attrValFloat{Val: float64Ptr(formatSet.YAxis.Maximum)}
+	if formatSet.YAxis.Minimum == 0 {
+		min = nil
+	}
+	if formatSet.YAxis.Maximum == 0 {
+		max = nil
+	}
+	var logBase *attrValFloat
+	if formatSet.YAxis.LogBase >= 2 && formatSet.YAxis.LogBase <= 1000 {
+		logBase = &attrValFloat{Val: float64Ptr(formatSet.YAxis.LogBase)}
+	}
+	axs := []*cAxs{
+		{
+			AxID: &attrValInt{Val: intPtr(753999904)},
+			Scaling: &cScaling{
+				LogBase:     logBase,
+				Orientation: &attrValString{Val: stringPtr(orientation[formatSet.YAxis.ReverseOrder])},
+				Max:         max,
+				Min:         min,
+			},
+			Delete: &attrValBool{Val: boolPtr(false)},
+			AxPos:  &attrValString{Val: stringPtr(valAxPos[formatSet.YAxis.ReverseOrder])},
+			NumFmt: &cNumFmt{
+				FormatCode:   chartValAxNumFmtFormatCode[formatSet.Type],
+				SourceLinked: true,
+			},
+			MajorTickMark: &attrValString{Val: stringPtr("none")},
+			MinorTickMark: &attrValString{Val: stringPtr("none")},
+			TickLblPos:    &attrValString{Val: stringPtr("nextTo")},
+			SpPr:          f.drawPlotAreaSpPr(),
+			TxPr:          f.drawPlotAreaTxPr(),
+			CrossAx:       &attrValInt{Val: intPtr(754001152)},
+			Crosses:       &attrValString{Val: stringPtr("autoZero")},
+			CrossBetween:  &attrValString{Val: stringPtr(chartValAxCrossBetween[formatSet.Type])},
+		},
+	}
+	if formatSet.YAxis.MajorGridlines {
+		axs[0].MajorGridlines = &cChartLines{SpPr: f.drawPlotAreaSpPr()}
+	}
+	if formatSet.YAxis.MinorGridlines {
+		axs[0].MinorGridlines = &cChartLines{SpPr: f.drawPlotAreaSpPr()}
+	}
+	if pos, ok := valTickLblPos[formatSet.Type]; ok {
+		axs[0].TickLblPos.Val = stringPtr(pos)
+	}
+	if formatSet.YAxis.MajorUnit != 0 {
+		axs[0].MajorUnit = &attrValFloat{Val: float64Ptr(formatSet.YAxis.MajorUnit)}
+	}
+	return axs
+}
+
+// drawPlotAreaSerAx provides a function to draw the c:serAx element.
+func (f *File) drawPlotAreaSerAx(formatSet *formatChart) []*cAxs {
+	min := &attrValFloat{Val: float64Ptr(formatSet.YAxis.Minimum)}
+	max := &attrValFloat{Val: float64Ptr(formatSet.YAxis.Maximum)}
+	if formatSet.YAxis.Minimum == 0 {
+		min = nil
+	}
+	if formatSet.YAxis.Maximum == 0 {
+		max = nil
+	}
+	return []*cAxs{
+		{
+			AxID: &attrValInt{Val: intPtr(832256642)},
+			Scaling: &cScaling{
+				Orientation: &attrValString{Val: stringPtr(orientation[formatSet.YAxis.ReverseOrder])},
+				Max:         max,
+				Min:         min,
+			},
+			Delete:     &attrValBool{Val: boolPtr(false)},
+			AxPos:      &attrValString{Val: stringPtr(catAxPos[formatSet.XAxis.ReverseOrder])},
+			TickLblPos: &attrValString{Val: stringPtr("nextTo")},
+			SpPr:       f.drawPlotAreaSpPr(),
+			TxPr:       f.drawPlotAreaTxPr(),
+			CrossAx:    &attrValInt{Val: intPtr(753999904)},
+		},
+	}
+}
+
+// drawPlotAreaSpPr provides a function to draw the c:spPr element.
+func (f *File) drawPlotAreaSpPr() *cSpPr {
+	return &cSpPr{
+		Ln: &aLn{
+			W:    9525,
+			Cap:  "flat",
+			Cmpd: "sng",
+			Algn: "ctr",
+			SolidFill: &aSolidFill{
+				SchemeClr: &aSchemeClr{
+					Val:    "tx1",
+					LumMod: &attrValInt{Val: intPtr(15000)},
+					LumOff: &attrValInt{Val: intPtr(85000)},
+				},
+			},
+		},
+	}
+}
+
+// drawPlotAreaTxPr provides a function to draw the c:txPr element.
+func (f *File) drawPlotAreaTxPr() *cTxPr {
+	return &cTxPr{
+		BodyPr: aBodyPr{
+			Rot:              -60000000,
+			SpcFirstLastPara: true,
+			VertOverflow:     "ellipsis",
+			Vert:             "horz",
+			Wrap:             "square",
+			Anchor:           "ctr",
+			AnchorCtr:        true,
+		},
+		P: aP{
+			PPr: &aPPr{
+				DefRPr: aRPr{
+					Sz:       900,
+					B:        false,
+					I:        false,
+					U:        "none",
+					Strike:   "noStrike",
+					Kern:     1200,
+					Baseline: 0,
+					SolidFill: &aSolidFill{
+						SchemeClr: &aSchemeClr{
+							Val:    "tx1",
+							LumMod: &attrValInt{Val: intPtr(15000)},
+							LumOff: &attrValInt{Val: intPtr(85000)},
+						},
+					},
+					Latin: &aLatin{Typeface: "+mn-lt"},
+					Ea:    &aEa{Typeface: "+mn-ea"},
+					Cs:    &aCs{Typeface: "+mn-cs"},
+				},
+			},
+			EndParaRPr: &aEndParaRPr{Lang: "en-US"},
+		},
+	}
+}
+
+// drawingParser provides a function to parse drawingXML. In order to solve
+// the problem that the label structure is changed after serialization and
+// deserialization, two different structures: decodeWsDr and encodeWsDr are
+// defined.
+func (f *File) drawingParser(path string) (*xlsxWsDr, int) {
+	var (
+		err error
+		ok  bool
+	)
+
+	if f.Drawings[path] == nil {
+		content := xlsxWsDr{}
+		content.A = NameSpaceDrawingML
+		content.Xdr = NameSpaceDrawingMLSpreadSheet
+		if _, ok = f.XLSX[path]; ok { // Append Model
+			decodeWsDr := decodeWsDr{}
+			if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(path)))).
+				Decode(&decodeWsDr); err != nil && err != io.EOF {
+				log.Printf("xml decode error: %s", err)
+			}
+			content.R = decodeWsDr.R
+			for _, v := range decodeWsDr.OneCellAnchor {
+				content.OneCellAnchor = append(content.OneCellAnchor, &xdrCellAnchor{
+					EditAs:       v.EditAs,
+					GraphicFrame: v.Content,
+				})
+			}
+			for _, v := range decodeWsDr.TwoCellAnchor {
+				content.TwoCellAnchor = append(content.TwoCellAnchor, &xdrCellAnchor{
+					EditAs:       v.EditAs,
+					GraphicFrame: v.Content,
+				})
+			}
+		}
+		f.Drawings[path] = &content
+	}
+	wsDr := f.Drawings[path]
+	return wsDr, len(wsDr.OneCellAnchor) + len(wsDr.TwoCellAnchor) + 2
+}
+
+// addDrawingChart provides a function to add chart graphic frame by given
+// sheet, drawingXML, cell, width, height, relationship index and format sets.
+func (f *File) addDrawingChart(sheet, drawingXML, cell string, width, height, rID int, formatSet *formatPicture) error {
+	col, row, err := CellNameToCoordinates(cell)
+	if err != nil {
+		return err
+	}
+	colIdx := col - 1
+	rowIdx := row - 1
+
+	width = int(float64(width) * formatSet.XScale)
+	height = int(float64(height) * formatSet.YScale)
+	colStart, rowStart, _, _, colEnd, rowEnd, x2, y2 :=
+		f.positionObjectPixels(sheet, colIdx, rowIdx, formatSet.OffsetX, formatSet.OffsetY, width, height)
+	content, cNvPrID := f.drawingParser(drawingXML)
+	twoCellAnchor := xdrCellAnchor{}
+	twoCellAnchor.EditAs = formatSet.Positioning
+	from := xlsxFrom{}
+	from.Col = colStart
+	from.ColOff = formatSet.OffsetX * EMU
+	from.Row = rowStart
+	from.RowOff = formatSet.OffsetY * EMU
+	to := xlsxTo{}
+	to.Col = colEnd
+	to.ColOff = x2 * EMU
+	to.Row = rowEnd
+	to.RowOff = y2 * EMU
+	twoCellAnchor.From = &from
+	twoCellAnchor.To = &to
+
+	graphicFrame := xlsxGraphicFrame{
+		NvGraphicFramePr: xlsxNvGraphicFramePr{
+			CNvPr: &xlsxCNvPr{
+				ID:   cNvPrID,
+				Name: "Chart " + strconv.Itoa(cNvPrID),
+			},
+		},
+		Graphic: &xlsxGraphic{
+			GraphicData: &xlsxGraphicData{
+				URI: NameSpaceDrawingMLChart,
+				Chart: &xlsxChart{
+					C:   NameSpaceDrawingMLChart,
+					R:   SourceRelationship.Value,
+					RID: "rId" + strconv.Itoa(rID),
+				},
+			},
+		},
+	}
+	graphic, _ := xml.Marshal(graphicFrame)
+	twoCellAnchor.GraphicFrame = string(graphic)
+	twoCellAnchor.ClientData = &xdrClientData{
+		FLocksWithSheet:  formatSet.FLocksWithSheet,
+		FPrintsWithSheet: formatSet.FPrintsWithSheet,
+	}
+	content.TwoCellAnchor = append(content.TwoCellAnchor, &twoCellAnchor)
+	f.Drawings[drawingXML] = content
+	return err
+}
+
+// addSheetDrawingChart provides a function to add chart graphic frame for
+// chartsheet by given sheet, drawingXML, width, height, relationship index
+// and format sets.
+func (f *File) addSheetDrawingChart(drawingXML string, rID int, formatSet *formatPicture) {
+	content, cNvPrID := f.drawingParser(drawingXML)
+	absoluteAnchor := xdrCellAnchor{
+		EditAs: formatSet.Positioning,
+		Pos:    &xlsxPoint2D{},
+		Ext:    &xlsxExt{},
+	}
+
+	graphicFrame := xlsxGraphicFrame{
+		NvGraphicFramePr: xlsxNvGraphicFramePr{
+			CNvPr: &xlsxCNvPr{
+				ID:   cNvPrID,
+				Name: "Chart " + strconv.Itoa(cNvPrID),
+			},
+		},
+		Graphic: &xlsxGraphic{
+			GraphicData: &xlsxGraphicData{
+				URI: NameSpaceDrawingMLChart,
+				Chart: &xlsxChart{
+					C:   NameSpaceDrawingMLChart,
+					R:   SourceRelationship.Value,
+					RID: "rId" + strconv.Itoa(rID),
+				},
+			},
+		},
+	}
+	graphic, _ := xml.Marshal(graphicFrame)
+	absoluteAnchor.GraphicFrame = string(graphic)
+	absoluteAnchor.ClientData = &xdrClientData{
+		FLocksWithSheet:  formatSet.FLocksWithSheet,
+		FPrintsWithSheet: formatSet.FPrintsWithSheet,
+	}
+	content.AbsoluteAnchor = append(content.AbsoluteAnchor, &absoluteAnchor)
+	f.Drawings[drawingXML] = content
+	return
+}
+
+// deleteDrawing provides a function to delete chart graphic frame by given by
+// given coordinates and graphic type.
+func (f *File) deleteDrawing(col, row int, drawingXML, drawingType string) (err error) {
+	var (
+		wsDr            *xlsxWsDr
+		deTwoCellAnchor *decodeTwoCellAnchor
+	)
+	xdrCellAnchorFuncs := map[string]func(anchor *xdrCellAnchor) bool{
+		"Chart": func(anchor *xdrCellAnchor) bool { return anchor.Pic == nil },
+		"Pic":   func(anchor *xdrCellAnchor) bool { return anchor.Pic != nil },
+	}
+	decodeTwoCellAnchorFuncs := map[string]func(anchor *decodeTwoCellAnchor) bool{
+		"Chart": func(anchor *decodeTwoCellAnchor) bool { return anchor.Pic == nil },
+		"Pic":   func(anchor *decodeTwoCellAnchor) bool { return anchor.Pic != nil },
+	}
+	wsDr, _ = f.drawingParser(drawingXML)
+	for idx := 0; idx < len(wsDr.TwoCellAnchor); idx++ {
+		if err = nil; wsDr.TwoCellAnchor[idx].From != nil && xdrCellAnchorFuncs[drawingType](wsDr.TwoCellAnchor[idx]) {
+			if wsDr.TwoCellAnchor[idx].From.Col == col && wsDr.TwoCellAnchor[idx].From.Row == row {
+				wsDr.TwoCellAnchor = append(wsDr.TwoCellAnchor[:idx], wsDr.TwoCellAnchor[idx+1:]...)
+				idx--
+			}
+		}
+	}
+	for idx := 0; idx < len(wsDr.TwoCellAnchor); idx++ {
+		deTwoCellAnchor = new(decodeTwoCellAnchor)
+		if err = f.xmlNewDecoder(strings.NewReader("<decodeTwoCellAnchor>" + wsDr.TwoCellAnchor[idx].GraphicFrame + "</decodeTwoCellAnchor>")).
+			Decode(deTwoCellAnchor); err != nil && err != io.EOF {
+			err = fmt.Errorf("xml decode error: %s", err)
+			return
+		}
+		if err = nil; deTwoCellAnchor.From != nil && decodeTwoCellAnchorFuncs[drawingType](deTwoCellAnchor) {
+			if deTwoCellAnchor.From.Col == col && deTwoCellAnchor.From.Row == row {
+				wsDr.TwoCellAnchor = append(wsDr.TwoCellAnchor[:idx], wsDr.TwoCellAnchor[idx+1:]...)
+				idx--
+			}
+		}
+	}
+	f.Drawings[drawingXML] = wsDr
+	return err
+}

+ 30 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/errors.go

@@ -0,0 +1,30 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "fmt"
+
+func newInvalidColumnNameError(col string) error {
+	return fmt.Errorf("invalid column name %q", col)
+}
+
+func newInvalidRowNumberError(row int) error {
+	return fmt.Errorf("invalid row number %d", row)
+}
+
+func newInvalidCellNameError(cell string) error {
+	return fmt.Errorf("invalid cell name %q", cell)
+}
+
+func newInvalidExcelDateError(dateValue float64) error {
+	return fmt.Errorf("invalid date value %f, negative values are not supported supported", dateValue)
+}

+ 379 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/excelize.go

@@ -0,0 +1,379 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+//
+// See https://xuri.me/excelize for more information about this package.
+package excelize
+
+import (
+	"archive/zip"
+	"bytes"
+	"encoding/xml"
+	"errors"
+	"fmt"
+	"io"
+	"io/ioutil"
+	"os"
+	"path"
+	"strconv"
+	"strings"
+
+	"golang.org/x/net/html/charset"
+)
+
+// File define a populated spreadsheet file struct.
+type File struct {
+	xmlAttr          map[string][]xml.Attr
+	checked          map[string]bool
+	sheetMap         map[string]string
+	CalcChain        *xlsxCalcChain
+	Comments         map[string]*xlsxComments
+	ContentTypes     *xlsxTypes
+	Drawings         map[string]*xlsxWsDr
+	Path             string
+	SharedStrings    *xlsxSST
+	sharedStringsMap map[string]int
+	Sheet            map[string]*xlsxWorksheet
+	SheetCount       int
+	Styles           *xlsxStyleSheet
+	Theme            *xlsxTheme
+	DecodeVMLDrawing map[string]*decodeVmlDrawing
+	VMLDrawing       map[string]*vmlDrawing
+	WorkBook         *xlsxWorkbook
+	Relationships    map[string]*xlsxRelationships
+	XLSX             map[string][]byte
+	CharsetReader    charsetTranscoderFn
+}
+
+type charsetTranscoderFn func(charset string, input io.Reader) (rdr io.Reader, err error)
+
+// OpenFile take the name of an spreadsheet file and returns a populated
+// spreadsheet file struct for it.
+func OpenFile(filename string) (*File, error) {
+	file, err := os.Open(filename)
+	if err != nil {
+		return nil, err
+	}
+	defer file.Close()
+	f, err := OpenReader(file)
+	if err != nil {
+		return nil, err
+	}
+	f.Path = filename
+	return f, nil
+}
+
+// newFile is object builder
+func newFile() *File {
+	return &File{
+		xmlAttr:          make(map[string][]xml.Attr),
+		checked:          make(map[string]bool),
+		sheetMap:         make(map[string]string),
+		Comments:         make(map[string]*xlsxComments),
+		Drawings:         make(map[string]*xlsxWsDr),
+		sharedStringsMap: make(map[string]int),
+		Sheet:            make(map[string]*xlsxWorksheet),
+		DecodeVMLDrawing: make(map[string]*decodeVmlDrawing),
+		VMLDrawing:       make(map[string]*vmlDrawing),
+		Relationships:    make(map[string]*xlsxRelationships),
+		CharsetReader:    charset.NewReaderLabel,
+	}
+}
+
+// OpenReader read data stream from io.Reader and return a populated
+// spreadsheet file.
+func OpenReader(r io.Reader) (*File, error) {
+	b, err := ioutil.ReadAll(r)
+	if err != nil {
+		return nil, err
+	}
+
+	zr, err := zip.NewReader(bytes.NewReader(b), int64(len(b)))
+	if err != nil {
+		identifier := []byte{
+			// checking protect workbook by [MS-OFFCRYPTO] - v20181211 3.1 FeatureIdentifier
+			0x3c, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x69, 0x00, 0x63, 0x00, 0x72, 0x00, 0x6f, 0x00, 0x73, 0x00,
+			0x6f, 0x00, 0x66, 0x00, 0x74, 0x00, 0x2e, 0x00, 0x43, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x74, 0x00,
+			0x61, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x65, 0x00, 0x72, 0x00, 0x2e, 0x00, 0x44, 0x00, 0x61, 0x00,
+			0x74, 0x00, 0x61, 0x00, 0x53, 0x00, 0x70, 0x00, 0x61, 0x00, 0x63, 0x00, 0x65, 0x00, 0x73, 0x00,
+			0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+		}
+		if bytes.Contains(b, identifier) {
+			return nil, errors.New("not support encrypted file currently")
+		}
+		return nil, err
+	}
+
+	file, sheetCount, err := ReadZipReader(zr)
+	if err != nil {
+		return nil, err
+	}
+	f := newFile()
+	f.SheetCount, f.XLSX = sheetCount, file
+	f.CalcChain = f.calcChainReader()
+	f.sheetMap = f.getSheetMap()
+	f.Styles = f.stylesReader()
+	f.Theme = f.themeReader()
+	return f, nil
+}
+
+// CharsetTranscoder Set user defined codepage transcoder function for open
+// XLSX from non UTF-8 encoding.
+func (f *File) CharsetTranscoder(fn charsetTranscoderFn) *File { f.CharsetReader = fn; return f }
+
+// Creates new XML decoder with charset reader.
+func (f *File) xmlNewDecoder(rdr io.Reader) (ret *xml.Decoder) {
+	ret = xml.NewDecoder(rdr)
+	ret.CharsetReader = f.CharsetReader
+	return
+}
+
+// setDefaultTimeStyle provides a function to set default numbers format for
+// time.Time type cell value by given worksheet name, cell coordinates and
+// number format code.
+func (f *File) setDefaultTimeStyle(sheet, axis string, format int) error {
+	s, err := f.GetCellStyle(sheet, axis)
+	if err != nil {
+		return err
+	}
+	if s == 0 {
+		style, _ := f.NewStyle(&Style{NumFmt: format})
+		_ = f.SetCellStyle(sheet, axis, axis, style)
+	}
+	return err
+}
+
+// workSheetReader provides a function to get the pointer to the structure
+// after deserialization by given worksheet name.
+func (f *File) workSheetReader(sheet string) (xlsx *xlsxWorksheet, err error) {
+	var (
+		name string
+		ok   bool
+	)
+
+	if name, ok = f.sheetMap[trimSheetName(sheet)]; !ok {
+		err = fmt.Errorf("sheet %s is not exist", sheet)
+		return
+	}
+	if xlsx = f.Sheet[name]; f.Sheet[name] == nil {
+		if strings.HasPrefix(name, "xl/chartsheets") {
+			err = fmt.Errorf("sheet %s is chart sheet", sheet)
+			return
+		}
+		xlsx = new(xlsxWorksheet)
+		if _, ok := f.xmlAttr[name]; !ok {
+			d := f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(name))))
+			f.xmlAttr[name] = append(f.xmlAttr[name], getRootElement(d)...)
+		}
+		if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(name)))).
+			Decode(xlsx); err != nil && err != io.EOF {
+			err = fmt.Errorf("xml decode error: %s", err)
+			return
+		}
+		err = nil
+		if f.checked == nil {
+			f.checked = make(map[string]bool)
+		}
+		if ok = f.checked[name]; !ok {
+			checkSheet(xlsx)
+			if err = checkRow(xlsx); err != nil {
+				return
+			}
+			f.checked[name] = true
+		}
+		f.Sheet[name] = xlsx
+	}
+
+	return
+}
+
+// checkSheet provides a function to fill each row element and make that is
+// continuous in a worksheet of XML.
+func checkSheet(xlsx *xlsxWorksheet) {
+	var row int
+	for _, r := range xlsx.SheetData.Row {
+		if r.R != 0 && r.R > row {
+			row = r.R
+			continue
+		}
+		row++
+	}
+	sheetData := xlsxSheetData{Row: make([]xlsxRow, row)}
+	row = 0
+	for _, r := range xlsx.SheetData.Row {
+		if r.R != 0 {
+			sheetData.Row[r.R-1] = r
+			row = r.R
+			continue
+		}
+		row++
+		r.R = row
+		sheetData.Row[row-1] = r
+	}
+	for i := 1; i <= row; i++ {
+		sheetData.Row[i-1].R = i
+	}
+	xlsx.SheetData = sheetData
+}
+
+// addRels provides a function to add relationships by given XML path,
+// relationship type, target and target mode.
+func (f *File) addRels(relPath, relType, target, targetMode string) int {
+	var uniqPart = map[string]string{
+		SourceRelationshipSharedStrings: "/xl/sharedStrings.xml",
+	}
+	rels := f.relsReader(relPath)
+	if rels == nil {
+		rels = &xlsxRelationships{}
+	}
+	var rID int
+	for idx, rel := range rels.Relationships {
+		ID, _ := strconv.Atoi(strings.TrimPrefix(rel.ID, "rId"))
+		if ID > rID {
+			rID = ID
+		}
+		if relType == rel.Type {
+			if partName, ok := uniqPart[rel.Type]; ok {
+				rels.Relationships[idx].Target = partName
+				return rID
+			}
+		}
+	}
+	rID++
+	var ID bytes.Buffer
+	ID.WriteString("rId")
+	ID.WriteString(strconv.Itoa(rID))
+	rels.Relationships = append(rels.Relationships, xlsxRelationship{
+		ID:         ID.String(),
+		Type:       relType,
+		Target:     target,
+		TargetMode: targetMode,
+	})
+	f.Relationships[relPath] = rels
+	return rID
+}
+
+// UpdateLinkedValue fix linked values within a spreadsheet are not updating in
+// Office Excel 2007 and 2010. This function will be remove value tag when met a
+// cell have a linked value. Reference
+// https://social.technet.microsoft.com/Forums/office/en-US/e16bae1f-6a2c-4325-8013-e989a3479066/excel-2010-linked-cells-not-updating
+//
+// Notice: after open XLSX file Excel will be update linked value and generate
+// new value and will prompt save file or not.
+//
+// For example:
+//
+//    <row r="19" spans="2:2">
+//        <c r="B19">
+//            <f>SUM(Sheet2!D2,Sheet2!D11)</f>
+//            <v>100</v>
+//         </c>
+//    </row>
+//
+// to
+//
+//    <row r="19" spans="2:2">
+//        <c r="B19">
+//            <f>SUM(Sheet2!D2,Sheet2!D11)</f>
+//        </c>
+//    </row>
+//
+func (f *File) UpdateLinkedValue() error {
+	wb := f.workbookReader()
+	// recalculate formulas
+	wb.CalcPr = nil
+	for _, name := range f.GetSheetList() {
+		xlsx, err := f.workSheetReader(name)
+		if err != nil {
+			return err
+		}
+		for indexR := range xlsx.SheetData.Row {
+			for indexC, col := range xlsx.SheetData.Row[indexR].C {
+				if col.F != nil && col.V != "" {
+					xlsx.SheetData.Row[indexR].C[indexC].V = ""
+					xlsx.SheetData.Row[indexR].C[indexC].T = ""
+				}
+			}
+		}
+	}
+	return nil
+}
+
+// AddVBAProject provides the method to add vbaProject.bin file which contains
+// functions and/or macros. The file extension should be .xlsm. For example:
+//
+//    if err := f.SetSheetPrOptions("Sheet1", excelize.CodeName("Sheet1")); err != nil {
+//        fmt.Println(err)
+//    }
+//    if err := f.AddVBAProject("vbaProject.bin"); err != nil {
+//        fmt.Println(err)
+//    }
+//    if err := f.SaveAs("macros.xlsm"); err != nil {
+//        fmt.Println(err)
+//    }
+//
+func (f *File) AddVBAProject(bin string) error {
+	var err error
+	// Check vbaProject.bin exists first.
+	if _, err = os.Stat(bin); os.IsNotExist(err) {
+		return err
+	}
+	if path.Ext(bin) != ".bin" {
+		return errors.New("unsupported VBA project extension")
+	}
+	f.setContentTypePartVBAProjectExtensions()
+	wb := f.relsReader("xl/_rels/workbook.xml.rels")
+	var rID int
+	var ok bool
+	for _, rel := range wb.Relationships {
+		if rel.Target == "vbaProject.bin" && rel.Type == SourceRelationshipVBAProject {
+			ok = true
+			continue
+		}
+		t, _ := strconv.Atoi(strings.TrimPrefix(rel.ID, "rId"))
+		if t > rID {
+			rID = t
+		}
+	}
+	rID++
+	if !ok {
+		wb.Relationships = append(wb.Relationships, xlsxRelationship{
+			ID:     "rId" + strconv.Itoa(rID),
+			Target: "vbaProject.bin",
+			Type:   SourceRelationshipVBAProject,
+		})
+	}
+	file, _ := ioutil.ReadFile(bin)
+	f.XLSX["xl/vbaProject.bin"] = file
+	return err
+}
+
+// setContentTypePartVBAProjectExtensions provides a function to set the
+// content type for relationship parts and the main document part.
+func (f *File) setContentTypePartVBAProjectExtensions() {
+	var ok bool
+	content := f.contentTypesReader()
+	for _, v := range content.Defaults {
+		if v.Extension == "bin" {
+			ok = true
+		}
+	}
+	for idx, o := range content.Overrides {
+		if o.PartName == "/xl/workbook.xml" {
+			content.Overrides[idx].ContentType = ContentTypeMacro
+		}
+	}
+	if !ok {
+		content.Defaults = append(content.Defaults, xlsxDefault{
+			Extension:   "bin",
+			ContentType: ContentTypeVBA,
+		})
+	}
+}

File diff ditekan karena terlalu besar
+ 0 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/excelize.svg


+ 122 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/file.go

@@ -0,0 +1,122 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"archive/zip"
+	"bytes"
+	"errors"
+	"fmt"
+	"io"
+	"os"
+)
+
+// NewFile provides a function to create new file by default template. For
+// example:
+//
+//    xlsx := NewFile()
+//
+func NewFile() *File {
+	file := make(map[string][]byte)
+	file["_rels/.rels"] = []byte(XMLHeader + templateRels)
+	file["docProps/app.xml"] = []byte(XMLHeader + templateDocpropsApp)
+	file["docProps/core.xml"] = []byte(XMLHeader + templateDocpropsCore)
+	file["xl/_rels/workbook.xml.rels"] = []byte(XMLHeader + templateWorkbookRels)
+	file["xl/theme/theme1.xml"] = []byte(XMLHeader + templateTheme)
+	file["xl/worksheets/sheet1.xml"] = []byte(XMLHeader + templateSheet)
+	file["xl/styles.xml"] = []byte(XMLHeader + templateStyles)
+	file["xl/workbook.xml"] = []byte(XMLHeader + templateWorkbook)
+	file["[Content_Types].xml"] = []byte(XMLHeader + templateContentTypes)
+	f := newFile()
+	f.SheetCount, f.XLSX = 1, file
+	f.CalcChain = f.calcChainReader()
+	f.Comments = make(map[string]*xlsxComments)
+	f.ContentTypes = f.contentTypesReader()
+	f.Drawings = make(map[string]*xlsxWsDr)
+	f.Styles = f.stylesReader()
+	f.DecodeVMLDrawing = make(map[string]*decodeVmlDrawing)
+	f.VMLDrawing = make(map[string]*vmlDrawing)
+	f.WorkBook = f.workbookReader()
+	f.Relationships = make(map[string]*xlsxRelationships)
+	f.Relationships["xl/_rels/workbook.xml.rels"] = f.relsReader("xl/_rels/workbook.xml.rels")
+	f.Sheet["xl/worksheets/sheet1.xml"], _ = f.workSheetReader("Sheet1")
+	f.sheetMap["Sheet1"] = "xl/worksheets/sheet1.xml"
+	f.Theme = f.themeReader()
+	return f
+}
+
+// Save provides a function to override the xlsx file with origin path.
+func (f *File) Save() error {
+	if f.Path == "" {
+		return fmt.Errorf("no path defined for file, consider File.WriteTo or File.Write")
+	}
+	return f.SaveAs(f.Path)
+}
+
+// SaveAs provides a function to create or update to an xlsx file at the
+// provided path.
+func (f *File) SaveAs(name string) error {
+	if len(name) > FileNameLength {
+		return errors.New("file name length exceeds maximum limit")
+	}
+	file, err := os.OpenFile(name, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0666)
+	if err != nil {
+		return err
+	}
+	defer file.Close()
+	return f.Write(file)
+}
+
+// Write provides a function to write to an io.Writer.
+func (f *File) Write(w io.Writer) error {
+	_, err := f.WriteTo(w)
+	return err
+}
+
+// WriteTo implements io.WriterTo to write the file.
+func (f *File) WriteTo(w io.Writer) (int64, error) {
+	buf, err := f.WriteToBuffer()
+	if err != nil {
+		return 0, err
+	}
+	return buf.WriteTo(w)
+}
+
+// WriteToBuffer provides a function to get bytes.Buffer from the saved file.
+func (f *File) WriteToBuffer() (*bytes.Buffer, error) {
+	buf := new(bytes.Buffer)
+	zw := zip.NewWriter(buf)
+	f.calcChainWriter()
+	f.commentsWriter()
+	f.contentTypesWriter()
+	f.drawingsWriter()
+	f.vmlDrawingWriter()
+	f.workBookWriter()
+	f.workSheetWriter()
+	f.relsWriter()
+	f.sharedStringsWriter()
+	f.styleSheetWriter()
+
+	for path, content := range f.XLSX {
+		fi, err := zw.Create(path)
+		if err != nil {
+			zw.Close()
+			return buf, err
+		}
+		_, err = fi.Write(content)
+		if err != nil {
+			zw.Close()
+			return buf, err
+		}
+	}
+	return buf, zw.Close()
+}

+ 17 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/go.mod

@@ -0,0 +1,17 @@
+module github.com/360EntSecGroup-Skylar/excelize/v2
+
+go 1.12
+
+require (
+	github.com/davecgh/go-spew v1.1.1 // indirect
+	github.com/kr/text v0.2.0 // indirect
+	github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
+	github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
+	github.com/stretchr/testify v1.5.1
+	github.com/xuri/efp v0.0.0-20191019043341-b7dc4fe9aa91
+	golang.org/x/image v0.0.0-20200430140353-33d19683fad8
+	golang.org/x/net v0.0.0-20200506145744-7e3656a0809f
+	golang.org/x/text v0.3.2 // indirect
+	gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
+	gopkg.in/yaml.v2 v2.2.8 // indirect
+)

+ 39 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/go.sum

@@ -0,0 +1,39 @@
+github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
+github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
+github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
+github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
+github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
+github.com/xuri/efp v0.0.0-20191019043341-b7dc4fe9aa91 h1:gp02YctZuIPTk0t7qI+wvg3VQwTPyNmSGG6ZqOsjSL8=
+github.com/xuri/efp v0.0.0-20191019043341-b7dc4fe9aa91/go.mod h1:uBiSUepVYMhGTfDeBKKasV4GpgBlzJ46gXUBAqV8qLk=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/image v0.0.0-20200430140353-33d19683fad8 h1:6WW6V3x1P/jokJBpRQYUJnMHRP6isStQwCozxnU7XQw=
+golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
+golang.org/x/net v0.0.0-20200506145744-7e3656a0809f h1:QBjCr1Fz5kw158VqdE9JfI9cJnl/ymnJWAdMuinqL7Y=
+golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
+golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
+gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
+gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

+ 139 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/hsl.go

@@ -0,0 +1,139 @@
+// Copyright (c) 2012 Rodrigo Moraes. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// 	 * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 	 * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// 	 * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+package excelize
+
+import (
+	"image/color"
+	"math"
+)
+
+// HSLModel converts any color.Color to a HSL color.
+var HSLModel = color.ModelFunc(hslModel)
+
+// HSL represents a cylindrical coordinate of points in an RGB color model.
+//
+// Values are in the range 0 to 1.
+type HSL struct {
+	H, S, L float64
+}
+
+// RGBA returns the alpha-premultiplied red, green, blue and alpha values
+// for the HSL.
+func (c HSL) RGBA() (uint32, uint32, uint32, uint32) {
+	r, g, b := HSLToRGB(c.H, c.S, c.L)
+	return uint32(r) * 0x101, uint32(g) * 0x101, uint32(b) * 0x101, 0xffff
+}
+
+// hslModel converts a color.Color to HSL.
+func hslModel(c color.Color) color.Color {
+	if _, ok := c.(HSL); ok {
+		return c
+	}
+	r, g, b, _ := c.RGBA()
+	h, s, l := RGBToHSL(uint8(r>>8), uint8(g>>8), uint8(b>>8))
+	return HSL{h, s, l}
+}
+
+// RGBToHSL converts an RGB triple to a HSL triple.
+func RGBToHSL(r, g, b uint8) (h, s, l float64) {
+	fR := float64(r) / 255
+	fG := float64(g) / 255
+	fB := float64(b) / 255
+	max := math.Max(math.Max(fR, fG), fB)
+	min := math.Min(math.Min(fR, fG), fB)
+	l = (max + min) / 2
+	if max == min {
+		// Achromatic.
+		h, s = 0, 0
+	} else {
+		// Chromatic.
+		d := max - min
+		if l > 0.5 {
+			s = d / (2.0 - max - min)
+		} else {
+			s = d / (max + min)
+		}
+		switch max {
+		case fR:
+			h = (fG - fB) / d
+			if fG < fB {
+				h += 6
+			}
+		case fG:
+			h = (fB-fR)/d + 2
+		case fB:
+			h = (fR-fG)/d + 4
+		}
+		h /= 6
+	}
+	return
+}
+
+// HSLToRGB converts an HSL triple to a RGB triple.
+func HSLToRGB(h, s, l float64) (r, g, b uint8) {
+	var fR, fG, fB float64
+	if s == 0 {
+		fR, fG, fB = l, l, l
+	} else {
+		var q float64
+		if l < 0.5 {
+			q = l * (1 + s)
+		} else {
+			q = l + s - s*l
+		}
+		p := 2*l - q
+		fR = hueToRGB(p, q, h+1.0/3)
+		fG = hueToRGB(p, q, h)
+		fB = hueToRGB(p, q, h-1.0/3)
+	}
+	r = uint8((fR * 255) + 0.5)
+	g = uint8((fG * 255) + 0.5)
+	b = uint8((fB * 255) + 0.5)
+	return
+}
+
+// hueToRGB is a helper function for HSLToRGB.
+func hueToRGB(p, q, t float64) float64 {
+	if t < 0 {
+		t++
+	}
+	if t > 1 {
+		t--
+	}
+	if t < 1.0/6 {
+		return p + (q-p)*6*t
+	}
+	if t < 0.5 {
+		return q
+	}
+	if t < 2.0/3 {
+		return p + (q-p)*(2.0/3-t)*6
+	}
+	return p
+}

+ 463 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/lib.go

@@ -0,0 +1,463 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"archive/zip"
+	"bytes"
+	"container/list"
+	"encoding/xml"
+	"fmt"
+	"io"
+	"strconv"
+	"strings"
+)
+
+// ReadZipReader can be used to read the spreadsheet in memory without touching the
+// filesystem.
+func ReadZipReader(r *zip.Reader) (map[string][]byte, int, error) {
+	var err error
+	var docPart = map[string]string{
+		"[content_types].xml":  "[Content_Types].xml",
+		"xl/sharedstrings.xml": "xl/sharedStrings.xml",
+	}
+	fileList := make(map[string][]byte, len(r.File))
+	worksheets := 0
+	for _, v := range r.File {
+		fileName := v.Name
+		if partName, ok := docPart[strings.ToLower(v.Name)]; ok {
+			fileName = partName
+		}
+		if fileList[fileName], err = readFile(v); err != nil {
+			return nil, 0, err
+		}
+		if strings.HasPrefix(v.Name, "xl/worksheets/sheet") {
+			worksheets++
+		}
+	}
+	return fileList, worksheets, nil
+}
+
+// readXML provides a function to read XML content as string.
+func (f *File) readXML(name string) []byte {
+	if content, ok := f.XLSX[name]; ok {
+		return content
+	}
+	return []byte{}
+}
+
+// saveFileList provides a function to update given file content in file list
+// of XLSX.
+func (f *File) saveFileList(name string, content []byte) {
+	newContent := make([]byte, 0, len(XMLHeader)+len(content))
+	newContent = append(newContent, []byte(XMLHeader)...)
+	newContent = append(newContent, content...)
+	f.XLSX[name] = newContent
+}
+
+// Read file content as string in a archive file.
+func readFile(file *zip.File) ([]byte, error) {
+	rc, err := file.Open()
+	if err != nil {
+		return nil, err
+	}
+	dat := make([]byte, 0, file.FileInfo().Size())
+	buff := bytes.NewBuffer(dat)
+	_, _ = io.Copy(buff, rc)
+	rc.Close()
+	return buff.Bytes(), nil
+}
+
+// SplitCellName splits cell name to column name and row number.
+//
+// Example:
+//
+//     excelize.SplitCellName("AK74") // return "AK", 74, nil
+//
+func SplitCellName(cell string) (string, int, error) {
+	alpha := func(r rune) bool {
+		return ('A' <= r && r <= 'Z') || ('a' <= r && r <= 'z')
+	}
+
+	if strings.IndexFunc(cell, alpha) == 0 {
+		i := strings.LastIndexFunc(cell, alpha)
+		if i >= 0 && i < len(cell)-1 {
+			col, rowstr := cell[:i+1], cell[i+1:]
+			if row, err := strconv.Atoi(rowstr); err == nil && row > 0 {
+				return col, row, nil
+			}
+		}
+	}
+	return "", -1, newInvalidCellNameError(cell)
+}
+
+// JoinCellName joins cell name from column name and row number.
+func JoinCellName(col string, row int) (string, error) {
+	normCol := strings.Map(func(rune rune) rune {
+		switch {
+		case 'A' <= rune && rune <= 'Z':
+			return rune
+		case 'a' <= rune && rune <= 'z':
+			return rune - 32
+		}
+		return -1
+	}, col)
+	if len(col) == 0 || len(col) != len(normCol) {
+		return "", newInvalidColumnNameError(col)
+	}
+	if row < 1 {
+		return "", newInvalidRowNumberError(row)
+	}
+	return normCol + strconv.Itoa(row), nil
+}
+
+// ColumnNameToNumber provides a function to convert Excel sheet column name
+// to int. Column name case insensitive. The function returns an error if
+// column name incorrect.
+//
+// Example:
+//
+//     excelize.ColumnNameToNumber("AK") // returns 37, nil
+//
+func ColumnNameToNumber(name string) (int, error) {
+	if len(name) == 0 {
+		return -1, newInvalidColumnNameError(name)
+	}
+	col := 0
+	multi := 1
+	for i := len(name) - 1; i >= 0; i-- {
+		r := name[i]
+		if r >= 'A' && r <= 'Z' {
+			col += int(r-'A'+1) * multi
+		} else if r >= 'a' && r <= 'z' {
+			col += int(r-'a'+1) * multi
+		} else {
+			return -1, newInvalidColumnNameError(name)
+		}
+		multi *= 26
+	}
+	if col > TotalColumns {
+		return -1, fmt.Errorf("column number exceeds maximum limit")
+	}
+	return col, nil
+}
+
+// ColumnNumberToName provides a function to convert the integer to Excel
+// sheet column title.
+//
+// Example:
+//
+//     excelize.ColumnNumberToName(37) // returns "AK", nil
+//
+func ColumnNumberToName(num int) (string, error) {
+	if num < 1 {
+		return "", fmt.Errorf("incorrect column number %d", num)
+	}
+	if num > TotalColumns {
+		return "", fmt.Errorf("column number exceeds maximum limit")
+	}
+	var col string
+	for num > 0 {
+		col = string((num-1)%26+65) + col
+		num = (num - 1) / 26
+	}
+	return col, nil
+}
+
+// CellNameToCoordinates converts alphanumeric cell name to [X, Y] coordinates
+// or returns an error.
+//
+// Example:
+//
+//    excelize.CellNameToCoordinates("A1") // returns 1, 1, nil
+//    excelize.CellNameToCoordinates("Z3") // returns 26, 3, nil
+//
+func CellNameToCoordinates(cell string) (int, int, error) {
+	const msg = "cannot convert cell %q to coordinates: %v"
+
+	colname, row, err := SplitCellName(cell)
+	if err != nil {
+		return -1, -1, fmt.Errorf(msg, cell, err)
+	}
+	if row > TotalRows {
+		return -1, -1, fmt.Errorf("row number exceeds maximum limit")
+	}
+	col, err := ColumnNameToNumber(colname)
+	return col, row, err
+}
+
+// CoordinatesToCellName converts [X, Y] coordinates to alpha-numeric cell
+// name or returns an error.
+//
+// Example:
+//
+//    excelize.CoordinatesToCellName(1, 1) // returns "A1", nil
+//
+func CoordinatesToCellName(col, row int) (string, error) {
+	if col < 1 || row < 1 {
+		return "", fmt.Errorf("invalid cell coordinates [%d, %d]", col, row)
+	}
+	colname, err := ColumnNumberToName(col)
+	return fmt.Sprintf("%s%d", colname, row), err
+}
+
+// boolPtr returns a pointer to a bool with the given value.
+func boolPtr(b bool) *bool { return &b }
+
+// intPtr returns a pointer to a int with the given value.
+func intPtr(i int) *int { return &i }
+
+// float64Ptr returns a pofloat64er to a float64 with the given value.
+func float64Ptr(f float64) *float64 { return &f }
+
+// stringPtr returns a pointer to a string with the given value.
+func stringPtr(s string) *string { return &s }
+
+// defaultTrue returns true if b is nil, or the pointed value.
+func defaultTrue(b *bool) bool {
+	if b == nil {
+		return true
+	}
+	return *b
+}
+
+// parseFormatSet provides a method to convert format string to []byte and
+// handle empty string.
+func parseFormatSet(formatSet string) []byte {
+	if formatSet != "" {
+		return []byte(formatSet)
+	}
+	return []byte("{}")
+}
+
+// namespaceStrictToTransitional provides a method to convert Strict and
+// Transitional namespaces.
+func namespaceStrictToTransitional(content []byte) []byte {
+	var namespaceTranslationDic = map[string]string{
+		StrictSourceRelationship:         SourceRelationship.Value,
+		StrictSourceRelationshipChart:    SourceRelationshipChart,
+		StrictSourceRelationshipComments: SourceRelationshipComments,
+		StrictSourceRelationshipImage:    SourceRelationshipImage,
+		StrictNameSpaceSpreadSheet:       NameSpaceSpreadSheet.Value,
+	}
+	for s, n := range namespaceTranslationDic {
+		content = bytesReplace(content, []byte(s), []byte(n), -1)
+	}
+	return content
+}
+
+// bytesReplace replace old bytes with given new.
+func bytesReplace(s, old, new []byte, n int) []byte {
+	if n == 0 {
+		return s
+	}
+
+	if len(old) < len(new) {
+		return bytes.Replace(s, old, new, n)
+	}
+
+	if n < 0 {
+		n = len(s)
+	}
+
+	var wid, i, j, w int
+	for i, j = 0, 0; i < len(s) && j < n; j++ {
+		wid = bytes.Index(s[i:], old)
+		if wid < 0 {
+			break
+		}
+
+		w += copy(s[w:], s[i:i+wid])
+		w += copy(s[w:], new)
+		i += wid + len(old)
+	}
+
+	w += copy(s[w:], s[i:])
+	return s[0:w]
+}
+
+// genSheetPasswd provides a method to generate password for worksheet
+// protection by given plaintext. When an Excel sheet is being protected with
+// a password, a 16-bit (two byte) long hash is generated. To verify a
+// password, it is compared to the hash. Obviously, if the input data volume
+// is great, numerous passwords will match the same hash. Here is the
+// algorithm to create the hash value:
+//
+// take the ASCII values of all characters shift left the first character 1 bit,
+// the second 2 bits and so on (use only the lower 15 bits and rotate all higher bits,
+// the highest bit of the 16-bit value is always 0 [signed short])
+// XOR all these values
+// XOR the count of characters
+// XOR the constant 0xCE4B
+func genSheetPasswd(plaintext string) string {
+	var password int64 = 0x0000
+	var charPos uint = 1
+	for _, v := range plaintext {
+		value := int64(v) << charPos
+		charPos++
+		rotatedBits := value >> 15 // rotated bits beyond bit 15
+		value &= 0x7fff            // first 15 bits
+		password ^= (value | rotatedBits)
+	}
+	password ^= int64(len(plaintext))
+	password ^= 0xCE4B
+	return strings.ToUpper(strconv.FormatInt(password, 16))
+}
+
+// getRootElement extract root element attributes by given XML decoder.
+func getRootElement(d *xml.Decoder) []xml.Attr {
+	tokenIdx := 0
+	for {
+		token, _ := d.Token()
+		if token == nil {
+			break
+		}
+		switch startElement := token.(type) {
+		case xml.StartElement:
+			tokenIdx++
+			if tokenIdx == 1 {
+				return startElement.Attr
+			}
+		}
+	}
+	return nil
+}
+
+// genXMLNamespace generate serialized XML attributes with a multi namespace
+// by given element attributes.
+func genXMLNamespace(attr []xml.Attr) string {
+	var rootElement string
+	for _, v := range attr {
+		if lastSpace := getXMLNamespace(v.Name.Space, attr); lastSpace != "" {
+			rootElement += fmt.Sprintf("%s:%s=\"%s\" ", lastSpace, v.Name.Local, v.Value)
+			continue
+		}
+		rootElement += fmt.Sprintf("%s=\"%s\" ", v.Name.Local, v.Value)
+	}
+	return strings.TrimSpace(rootElement) + ">"
+}
+
+// getXMLNamespace extract XML namespace from specified element name and attributes.
+func getXMLNamespace(space string, attr []xml.Attr) string {
+	for _, attribute := range attr {
+		if attribute.Value == space {
+			return attribute.Name.Local
+		}
+	}
+	return space
+}
+
+// replaceNameSpaceBytes provides a function to replace the XML root element
+// attribute by the given component part path and XML content.
+func (f *File) replaceNameSpaceBytes(path string, contentMarshal []byte) []byte {
+	var oldXmlns = []byte(`xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">`)
+	var newXmlns = []byte(templateNamespaceIDMap)
+	if attr, ok := f.xmlAttr[path]; ok {
+		newXmlns = []byte(genXMLNamespace(attr))
+	}
+	return bytesReplace(contentMarshal, oldXmlns, newXmlns, -1)
+}
+
+// addNameSpaces provides a function to add a XML attribute by the given
+// component part path.
+func (f *File) addNameSpaces(path string, ns xml.Attr) {
+	exist := false
+	mc := false
+	ignore := -1
+	if attr, ok := f.xmlAttr[path]; ok {
+		for i, attribute := range attr {
+			if attribute.Name.Local == ns.Name.Local && attribute.Name.Space == ns.Name.Space {
+				exist = true
+			}
+			if attribute.Name.Local == "Ignorable" && getXMLNamespace(attribute.Name.Space, attr) == "mc" {
+				ignore = i
+			}
+			if attribute.Name.Local == "mc" && attribute.Name.Space == "xmlns" {
+				mc = true
+			}
+		}
+	}
+	if !exist {
+		f.xmlAttr[path] = append(f.xmlAttr[path], ns)
+		if !mc {
+			f.xmlAttr[path] = append(f.xmlAttr[path], SourceRelationshipCompatibility)
+		}
+		if ignore == -1 {
+			f.xmlAttr[path] = append(f.xmlAttr[path], xml.Attr{
+				Name:  xml.Name{Local: "Ignorable", Space: "mc"},
+				Value: ns.Name.Local,
+			})
+			return
+		}
+		f.setIgnorableNameSpace(path, ignore, ns)
+	}
+}
+
+// setIgnorableNameSpace provides a function to set XML namespace as ignorable by the given
+// attribute.
+func (f *File) setIgnorableNameSpace(path string, index int, ns xml.Attr) {
+	ignorableNS := []string{"c14", "cdr14", "a14", "pic14", "x14", "xdr14", "x14ac", "dsp", "mso14", "dgm14", "x15", "x12ac", "x15ac", "xr", "xr2", "xr3", "xr4", "xr5", "xr6", "xr7", "xr8", "xr9", "xr10", "xr11", "xr12", "xr13", "xr14", "xr15", "x15", "x16", "x16r2", "mo", "mx", "mv", "o", "v"}
+	if inStrSlice(strings.Fields(f.xmlAttr[path][index].Value), ns.Name.Local) == -1 && inStrSlice(ignorableNS, ns.Name.Local) != -1 {
+		f.xmlAttr[path][index].Value = strings.TrimSpace(fmt.Sprintf("%s %s", f.xmlAttr[path][index].Value, ns.Name.Local))
+	}
+}
+
+// addSheetNameSpace add XML attribute for worksheet.
+func (f *File) addSheetNameSpace(sheet string, ns xml.Attr) {
+	name, _ := f.sheetMap[trimSheetName(sheet)]
+	f.addNameSpaces(name, ns)
+}
+
+// Stack defined an abstract data type that serves as a collection of elements.
+type Stack struct {
+	list *list.List
+}
+
+// NewStack create a new stack.
+func NewStack() *Stack {
+	list := list.New()
+	return &Stack{list}
+}
+
+// Push a value onto the top of the stack.
+func (stack *Stack) Push(value interface{}) {
+	stack.list.PushBack(value)
+}
+
+// Pop the top item of the stack and return it.
+func (stack *Stack) Pop() interface{} {
+	e := stack.list.Back()
+	if e != nil {
+		stack.list.Remove(e)
+		return e.Value
+	}
+	return nil
+}
+
+// Peek view the top item on the stack.
+func (stack *Stack) Peek() interface{} {
+	e := stack.list.Back()
+	if e != nil {
+		return e.Value
+	}
+	return nil
+}
+
+// Len return the number of items in the stack.
+func (stack *Stack) Len() int {
+	return stack.list.Len()
+}
+
+// Empty the stack.
+func (stack *Stack) Empty() bool {
+	return stack.list.Len() == 0
+}

TEMPAT SAMPAH
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/logo.png


+ 196 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/merge.go

@@ -0,0 +1,196 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"fmt"
+	"strings"
+)
+
+// MergeCell provides a function to merge cells by given coordinate area and
+// sheet name. For example create a merged cell of D3:E9 on Sheet1:
+//
+//    err := f.MergeCell("Sheet1", "D3", "E9")
+//
+// If you create a merged cell that overlaps with another existing merged cell,
+// those merged cells that already exist will be removed.
+//
+//                 B1(x1,y1)      D1(x2,y1)
+//               +------------------------+
+//               |                        |
+//     A4(x3,y3) |    C4(x4,y3)           |
+//    +------------------------+          |
+//    |          |             |          |
+//    |          |B5(x1,y2)    | D5(x2,y2)|
+//    |          +------------------------+
+//    |                        |
+//    |A8(x3,y4)      C8(x4,y4)|
+//    +------------------------+
+//
+func (f *File) MergeCell(sheet, hcell, vcell string) error {
+	rect1, err := f.areaRefToCoordinates(hcell + ":" + vcell)
+	if err != nil {
+		return err
+	}
+	// Correct the coordinate area, such correct C1:B3 to B1:C3.
+	_ = sortCoordinates(rect1)
+
+	hcell, _ = CoordinatesToCellName(rect1[0], rect1[1])
+	vcell, _ = CoordinatesToCellName(rect1[2], rect1[3])
+
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	ref := hcell + ":" + vcell
+	if xlsx.MergeCells != nil {
+		for i := 0; i < len(xlsx.MergeCells.Cells); i++ {
+			cellData := xlsx.MergeCells.Cells[i]
+			if cellData == nil {
+				continue
+			}
+			cc := strings.Split(cellData.Ref, ":")
+			if len(cc) != 2 {
+				return fmt.Errorf("invalid area %q", cellData.Ref)
+			}
+
+			rect2, err := f.areaRefToCoordinates(cellData.Ref)
+			if err != nil {
+				return err
+			}
+
+			// Delete the merged cells of the overlapping area.
+			if isOverlap(rect1, rect2) {
+				xlsx.MergeCells.Cells = append(xlsx.MergeCells.Cells[:i], xlsx.MergeCells.Cells[i+1:]...)
+				i--
+
+				if rect1[0] > rect2[0] {
+					rect1[0], rect2[0] = rect2[0], rect1[0]
+				}
+
+				if rect1[2] < rect2[2] {
+					rect1[2], rect2[2] = rect2[2], rect1[2]
+				}
+
+				if rect1[1] > rect2[1] {
+					rect1[1], rect2[1] = rect2[1], rect1[1]
+				}
+
+				if rect1[3] < rect2[3] {
+					rect1[3], rect2[3] = rect2[3], rect1[3]
+				}
+				hcell, _ = CoordinatesToCellName(rect1[0], rect1[1])
+				vcell, _ = CoordinatesToCellName(rect1[2], rect1[3])
+				ref = hcell + ":" + vcell
+			}
+		}
+		xlsx.MergeCells.Cells = append(xlsx.MergeCells.Cells, &xlsxMergeCell{Ref: ref})
+	} else {
+		xlsx.MergeCells = &xlsxMergeCells{Cells: []*xlsxMergeCell{{Ref: ref}}}
+	}
+	return err
+}
+
+// UnmergeCell provides a function to unmerge a given coordinate area.
+// For example unmerge area D3:E9 on Sheet1:
+//
+//    err := f.UnmergeCell("Sheet1", "D3", "E9")
+//
+// Attention: overlapped areas will also be unmerged.
+func (f *File) UnmergeCell(sheet string, hcell, vcell string) error {
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	rect1, err := f.areaRefToCoordinates(hcell + ":" + vcell)
+	if err != nil {
+		return err
+	}
+
+	// Correct the coordinate area, such correct C1:B3 to B1:C3.
+	_ = sortCoordinates(rect1)
+
+	// return nil since no MergeCells in the sheet
+	if xlsx.MergeCells == nil {
+		return nil
+	}
+
+	i := 0
+	for _, cellData := range xlsx.MergeCells.Cells {
+		if cellData == nil {
+			continue
+		}
+		cc := strings.Split(cellData.Ref, ":")
+		if len(cc) != 2 {
+			return fmt.Errorf("invalid area %q", cellData.Ref)
+		}
+
+		rect2, err := f.areaRefToCoordinates(cellData.Ref)
+		if err != nil {
+			return err
+		}
+
+		if isOverlap(rect1, rect2) {
+			continue
+		}
+		xlsx.MergeCells.Cells[i] = cellData
+		i++
+	}
+	xlsx.MergeCells.Cells = xlsx.MergeCells.Cells[:i]
+	return nil
+}
+
+// GetMergeCells provides a function to get all merged cells from a worksheet
+// currently.
+func (f *File) GetMergeCells(sheet string) ([]MergeCell, error) {
+	var mergeCells []MergeCell
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return mergeCells, err
+	}
+	if xlsx.MergeCells != nil {
+		mergeCells = make([]MergeCell, 0, len(xlsx.MergeCells.Cells))
+
+		for i := range xlsx.MergeCells.Cells {
+			ref := xlsx.MergeCells.Cells[i].Ref
+			axis := strings.Split(ref, ":")[0]
+			val, _ := f.GetCellValue(sheet, axis)
+			mergeCells = append(mergeCells, []string{ref, val})
+		}
+	}
+
+	return mergeCells, err
+}
+
+// MergeCell define a merged cell data.
+// It consists of the following structure.
+// example: []string{"D4:E10", "cell value"}
+type MergeCell []string
+
+// GetCellValue returns merged cell value.
+func (m *MergeCell) GetCellValue() string {
+	return (*m)[1]
+}
+
+// GetStartAxis returns the merge start axis.
+// example: "C2"
+func (m *MergeCell) GetStartAxis() string {
+	axis := strings.Split((*m)[0], ":")
+	return axis[0]
+}
+
+// GetEndAxis returns the merge end axis.
+// example: "D4"
+func (m *MergeCell) GetEndAxis() string {
+	axis := strings.Split((*m)[0], ":")
+	return axis[1]
+}

+ 634 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/picture.go

@@ -0,0 +1,634 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"bytes"
+	"encoding/json"
+	"encoding/xml"
+	"errors"
+	"fmt"
+	"image"
+	"io"
+	"io/ioutil"
+	"os"
+	"path"
+	"path/filepath"
+	"strconv"
+	"strings"
+)
+
+// parseFormatPictureSet provides a function to parse the format settings of
+// the picture with default value.
+func parseFormatPictureSet(formatSet string) (*formatPicture, error) {
+	format := formatPicture{
+		FPrintsWithSheet: true,
+		FLocksWithSheet:  false,
+		NoChangeAspect:   false,
+		Autofit:          false,
+		OffsetX:          0,
+		OffsetY:          0,
+		XScale:           1.0,
+		YScale:           1.0,
+	}
+	err := json.Unmarshal(parseFormatSet(formatSet), &format)
+	return &format, err
+}
+
+// AddPicture provides the method to add picture in a sheet by given picture
+// format set (such as offset, scale, aspect ratio setting and print settings)
+// and file path. For example:
+//
+//    package main
+//
+//    import (
+//        _ "image/gif"
+//        _ "image/jpeg"
+//        _ "image/png"
+//
+//        "github.com/360EntSecGroup-Skylar/excelize"
+//    )
+//
+//    func main() {
+//        f := excelize.NewFile()
+//        // Insert a picture.
+//        if err := f.AddPicture("Sheet1", "A2", "image.jpg", ""); err != nil {
+//            fmt.Println(err)
+//        }
+//        // Insert a picture scaling in the cell with location hyperlink.
+//        if err := f.AddPicture("Sheet1", "D2", "image.png", `{"x_scale": 0.5, "y_scale": 0.5, "hyperlink": "#Sheet2!D8", "hyperlink_type": "Location"}`); err != nil {
+//            fmt.Println(err)
+//        }
+//        // Insert a picture offset in the cell with external hyperlink, printing and positioning support.
+//        if err := f.AddPicture("Sheet1", "H2", "image.gif", `{"x_offset": 15, "y_offset": 10, "hyperlink": "https://github.com/360EntSecGroup-Skylar/excelize", "hyperlink_type": "External", "print_obj": true, "lock_aspect_ratio": false, "locked": false, "positioning": "oneCell"}`); err != nil {
+//            fmt.Println(err)
+//        }
+//        if err := f.SaveAs("Book1.xlsx"); err != nil {
+//            fmt.Println(err)
+//        }
+//    }
+//
+// LinkType defines two types of hyperlink "External" for web site or
+// "Location" for moving to one of cell in this workbook. When the
+// "hyperlink_type" is "Location", coordinates need to start with "#".
+//
+// Positioning defines two types of the position of a picture in an Excel
+// spreadsheet, "oneCell" (Move but don't size with cells) or "absolute"
+// (Don't move or size with cells). If you don't set this parameter, default
+// positioning is move and size with cells.
+func (f *File) AddPicture(sheet, cell, picture, format string) error {
+	var err error
+	// Check picture exists first.
+	if _, err = os.Stat(picture); os.IsNotExist(err) {
+		return err
+	}
+	ext, ok := supportImageTypes[path.Ext(picture)]
+	if !ok {
+		return errors.New("unsupported image extension")
+	}
+	file, _ := ioutil.ReadFile(picture)
+	_, name := filepath.Split(picture)
+	return f.AddPictureFromBytes(sheet, cell, format, name, ext, file)
+}
+
+// AddPictureFromBytes provides the method to add picture in a sheet by given
+// picture format set (such as offset, scale, aspect ratio setting and print
+// settings), file base name, extension name and file bytes. For example:
+//
+//    package main
+//
+//    import (
+//        "fmt"
+//        _ "image/jpeg"
+//        "io/ioutil"
+//
+//        "github.com/360EntSecGroup-Skylar/excelize"
+//    )
+//
+//    func main() {
+//        f := excelize.NewFile()
+//
+//        file, err := ioutil.ReadFile("image.jpg")
+//        if err != nil {
+//            fmt.Println(err)
+//        }
+//        if err := f.AddPictureFromBytes("Sheet1", "A2", "", "Excel Logo", ".jpg", file); err != nil {
+//            fmt.Println(err)
+//        }
+//        if err := f.SaveAs("Book1.xlsx"); err != nil {
+//            fmt.Println(err)
+//        }
+//    }
+//
+func (f *File) AddPictureFromBytes(sheet, cell, format, name, extension string, file []byte) error {
+	var drawingHyperlinkRID int
+	var hyperlinkType string
+	ext, ok := supportImageTypes[extension]
+	if !ok {
+		return errors.New("unsupported image extension")
+	}
+	formatSet, err := parseFormatPictureSet(format)
+	if err != nil {
+		return err
+	}
+	img, _, err := image.DecodeConfig(bytes.NewReader(file))
+	if err != nil {
+		return err
+	}
+	// Read sheet data.
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	// Add first picture for given sheet, create xl/drawings/ and xl/drawings/_rels/ folder.
+	drawingID := f.countDrawings() + 1
+	drawingXML := "xl/drawings/drawing" + strconv.Itoa(drawingID) + ".xml"
+	drawingID, drawingXML = f.prepareDrawing(xlsx, drawingID, sheet, drawingXML)
+	drawingRels := "xl/drawings/_rels/drawing" + strconv.Itoa(drawingID) + ".xml.rels"
+	mediaStr := ".." + strings.TrimPrefix(f.addMedia(file, ext), "xl")
+	drawingRID := f.addRels(drawingRels, SourceRelationshipImage, mediaStr, hyperlinkType)
+	// Add picture with hyperlink.
+	if formatSet.Hyperlink != "" && formatSet.HyperlinkType != "" {
+		if formatSet.HyperlinkType == "External" {
+			hyperlinkType = formatSet.HyperlinkType
+		}
+		drawingHyperlinkRID = f.addRels(drawingRels, SourceRelationshipHyperLink, formatSet.Hyperlink, hyperlinkType)
+	}
+	err = f.addDrawingPicture(sheet, drawingXML, cell, name, img.Width, img.Height, drawingRID, drawingHyperlinkRID, formatSet)
+	if err != nil {
+		return err
+	}
+	f.addContentTypePart(drawingID, "drawings")
+	f.addSheetNameSpace(sheet, SourceRelationship)
+	return err
+}
+
+// deleteSheetRelationships provides a function to delete relationships in
+// xl/worksheets/_rels/sheet%d.xml.rels by given worksheet name and
+// relationship index.
+func (f *File) deleteSheetRelationships(sheet, rID string) {
+	name, ok := f.sheetMap[trimSheetName(sheet)]
+	if !ok {
+		name = strings.ToLower(sheet) + ".xml"
+	}
+	var rels = "xl/worksheets/_rels/" + strings.TrimPrefix(name, "xl/worksheets/") + ".rels"
+	sheetRels := f.relsReader(rels)
+	if sheetRels == nil {
+		sheetRels = &xlsxRelationships{}
+	}
+	for k, v := range sheetRels.Relationships {
+		if v.ID == rID {
+			sheetRels.Relationships = append(sheetRels.Relationships[:k], sheetRels.Relationships[k+1:]...)
+		}
+	}
+	f.Relationships[rels] = sheetRels
+}
+
+// addSheetLegacyDrawing provides a function to add legacy drawing element to
+// xl/worksheets/sheet%d.xml by given worksheet name and relationship index.
+func (f *File) addSheetLegacyDrawing(sheet string, rID int) {
+	xlsx, _ := f.workSheetReader(sheet)
+	xlsx.LegacyDrawing = &xlsxLegacyDrawing{
+		RID: "rId" + strconv.Itoa(rID),
+	}
+}
+
+// addSheetDrawing provides a function to add drawing element to
+// xl/worksheets/sheet%d.xml by given worksheet name and relationship index.
+func (f *File) addSheetDrawing(sheet string, rID int) {
+	xlsx, _ := f.workSheetReader(sheet)
+	xlsx.Drawing = &xlsxDrawing{
+		RID: "rId" + strconv.Itoa(rID),
+	}
+}
+
+// addSheetPicture provides a function to add picture element to
+// xl/worksheets/sheet%d.xml by given worksheet name and relationship index.
+func (f *File) addSheetPicture(sheet string, rID int) {
+	xlsx, _ := f.workSheetReader(sheet)
+	xlsx.Picture = &xlsxPicture{
+		RID: "rId" + strconv.Itoa(rID),
+	}
+}
+
+// countDrawings provides a function to get drawing files count storage in the
+// folder xl/drawings.
+func (f *File) countDrawings() int {
+	c1, c2 := 0, 0
+	for k := range f.XLSX {
+		if strings.Contains(k, "xl/drawings/drawing") {
+			c1++
+		}
+	}
+	for rel := range f.Drawings {
+		if strings.Contains(rel, "xl/drawings/drawing") {
+			c2++
+		}
+	}
+	if c1 < c2 {
+		return c2
+	}
+	return c1
+}
+
+// addDrawingPicture provides a function to add picture by given sheet,
+// drawingXML, cell, file name, width, height relationship index and format
+// sets.
+func (f *File) addDrawingPicture(sheet, drawingXML, cell, file string, width, height, rID, hyperlinkRID int, formatSet *formatPicture) error {
+	col, row, err := CellNameToCoordinates(cell)
+	if err != nil {
+		return err
+	}
+	if formatSet.Autofit {
+		width, height, col, row, err = f.drawingResize(sheet, cell, float64(width), float64(height), formatSet)
+		if err != nil {
+			return err
+		}
+	}
+	col--
+	row--
+	colStart, rowStart, _, _, colEnd, rowEnd, x2, y2 :=
+		f.positionObjectPixels(sheet, col, row, formatSet.OffsetX, formatSet.OffsetY, width, height)
+	content, cNvPrID := f.drawingParser(drawingXML)
+	twoCellAnchor := xdrCellAnchor{}
+	twoCellAnchor.EditAs = formatSet.Positioning
+	from := xlsxFrom{}
+	from.Col = colStart
+	from.ColOff = formatSet.OffsetX * EMU
+	from.Row = rowStart
+	from.RowOff = formatSet.OffsetY * EMU
+	to := xlsxTo{}
+	to.Col = colEnd
+	to.ColOff = x2 * EMU
+	to.Row = rowEnd
+	to.RowOff = y2 * EMU
+	twoCellAnchor.From = &from
+	twoCellAnchor.To = &to
+	pic := xlsxPic{}
+	pic.NvPicPr.CNvPicPr.PicLocks.NoChangeAspect = formatSet.NoChangeAspect
+	pic.NvPicPr.CNvPr.ID = cNvPrID
+	pic.NvPicPr.CNvPr.Descr = file
+	pic.NvPicPr.CNvPr.Name = "Picture " + strconv.Itoa(cNvPrID)
+	if hyperlinkRID != 0 {
+		pic.NvPicPr.CNvPr.HlinkClick = &xlsxHlinkClick{
+			R:   SourceRelationship.Value,
+			RID: "rId" + strconv.Itoa(hyperlinkRID),
+		}
+	}
+	pic.BlipFill.Blip.R = SourceRelationship.Value
+	pic.BlipFill.Blip.Embed = "rId" + strconv.Itoa(rID)
+	pic.SpPr.PrstGeom.Prst = "rect"
+
+	twoCellAnchor.Pic = &pic
+	twoCellAnchor.ClientData = &xdrClientData{
+		FLocksWithSheet:  formatSet.FLocksWithSheet,
+		FPrintsWithSheet: formatSet.FPrintsWithSheet,
+	}
+	content.TwoCellAnchor = append(content.TwoCellAnchor, &twoCellAnchor)
+	f.Drawings[drawingXML] = content
+	return err
+}
+
+// countMedia provides a function to get media files count storage in the
+// folder xl/media/image.
+func (f *File) countMedia() int {
+	count := 0
+	for k := range f.XLSX {
+		if strings.Contains(k, "xl/media/image") {
+			count++
+		}
+	}
+	return count
+}
+
+// addMedia provides a function to add a picture into folder xl/media/image by
+// given file and extension name. Duplicate images are only actually stored once
+// and drawings that use it will reference the same image.
+func (f *File) addMedia(file []byte, ext string) string {
+	count := f.countMedia()
+	for name, existing := range f.XLSX {
+		if !strings.HasPrefix(name, "xl/media/image") {
+			continue
+		}
+		if bytes.Equal(file, existing) {
+			return name
+		}
+	}
+	media := "xl/media/image" + strconv.Itoa(count+1) + ext
+	f.XLSX[media] = file
+	return media
+}
+
+// setContentTypePartImageExtensions provides a function to set the content
+// type for relationship parts and the Main Document part.
+func (f *File) setContentTypePartImageExtensions() {
+	var imageTypes = map[string]bool{"jpeg": false, "png": false, "gif": false, "tiff": false}
+	content := f.contentTypesReader()
+	for _, v := range content.Defaults {
+		_, ok := imageTypes[v.Extension]
+		if ok {
+			imageTypes[v.Extension] = true
+		}
+	}
+	for k, v := range imageTypes {
+		if !v {
+			content.Defaults = append(content.Defaults, xlsxDefault{
+				Extension:   k,
+				ContentType: "image/" + k,
+			})
+		}
+	}
+}
+
+// setContentTypePartVMLExtensions provides a function to set the content type
+// for relationship parts and the Main Document part.
+func (f *File) setContentTypePartVMLExtensions() {
+	vml := false
+	content := f.contentTypesReader()
+	for _, v := range content.Defaults {
+		if v.Extension == "vml" {
+			vml = true
+		}
+	}
+	if !vml {
+		content.Defaults = append(content.Defaults, xlsxDefault{
+			Extension:   "vml",
+			ContentType: ContentTypeVML,
+		})
+	}
+}
+
+// addContentTypePart provides a function to add content type part
+// relationships in the file [Content_Types].xml by given index.
+func (f *File) addContentTypePart(index int, contentType string) {
+	setContentType := map[string]func(){
+		"comments": f.setContentTypePartVMLExtensions,
+		"drawings": f.setContentTypePartImageExtensions,
+	}
+	partNames := map[string]string{
+		"chart":         "/xl/charts/chart" + strconv.Itoa(index) + ".xml",
+		"chartsheet":    "/xl/chartsheets/sheet" + strconv.Itoa(index) + ".xml",
+		"comments":      "/xl/comments" + strconv.Itoa(index) + ".xml",
+		"drawings":      "/xl/drawings/drawing" + strconv.Itoa(index) + ".xml",
+		"table":         "/xl/tables/table" + strconv.Itoa(index) + ".xml",
+		"pivotTable":    "/xl/pivotTables/pivotTable" + strconv.Itoa(index) + ".xml",
+		"pivotCache":    "/xl/pivotCache/pivotCacheDefinition" + strconv.Itoa(index) + ".xml",
+		"sharedStrings": "/xl/sharedStrings.xml",
+	}
+	contentTypes := map[string]string{
+		"chart":         ContentTypeDrawingML,
+		"chartsheet":    ContentTypeSpreadSheetMLChartsheet,
+		"comments":      ContentTypeSpreadSheetMLComments,
+		"drawings":      ContentTypeDrawing,
+		"table":         ContentTypeSpreadSheetMLTable,
+		"pivotTable":    ContentTypeSpreadSheetMLPivotTable,
+		"pivotCache":    ContentTypeSpreadSheetMLPivotCacheDefinition,
+		"sharedStrings": ContentTypeSpreadSheetMLSharedStrings,
+	}
+	s, ok := setContentType[contentType]
+	if ok {
+		s()
+	}
+	content := f.contentTypesReader()
+	for _, v := range content.Overrides {
+		if v.PartName == partNames[contentType] {
+			return
+		}
+	}
+	content.Overrides = append(content.Overrides, xlsxOverride{
+		PartName:    partNames[contentType],
+		ContentType: contentTypes[contentType],
+	})
+}
+
+// getSheetRelationshipsTargetByID provides a function to get Target attribute
+// value in xl/worksheets/_rels/sheet%d.xml.rels by given worksheet name and
+// relationship index.
+func (f *File) getSheetRelationshipsTargetByID(sheet, rID string) string {
+	name, ok := f.sheetMap[trimSheetName(sheet)]
+	if !ok {
+		name = strings.ToLower(sheet) + ".xml"
+	}
+	var rels = "xl/worksheets/_rels/" + strings.TrimPrefix(name, "xl/worksheets/") + ".rels"
+	sheetRels := f.relsReader(rels)
+	if sheetRels == nil {
+		sheetRels = &xlsxRelationships{}
+	}
+	for _, v := range sheetRels.Relationships {
+		if v.ID == rID {
+			return v.Target
+		}
+	}
+	return ""
+}
+
+// GetPicture provides a function to get picture base name and raw content
+// embed in XLSX by given worksheet and cell name. This function returns the
+// file name in XLSX and file contents as []byte data types. For example:
+//
+//    f, err := excelize.OpenFile("Book1.xlsx")
+//    if err != nil {
+//        fmt.Println(err)
+//        return
+//    }
+//    file, raw, err := f.GetPicture("Sheet1", "A2")
+//    if err != nil {
+//        fmt.Println(err)
+//        return
+//    }
+//    if err := ioutil.WriteFile(file, raw, 0644); err != nil {
+//        fmt.Println(err)
+//    }
+//
+func (f *File) GetPicture(sheet, cell string) (string, []byte, error) {
+	col, row, err := CellNameToCoordinates(cell)
+	if err != nil {
+		return "", nil, err
+	}
+	col--
+	row--
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return "", nil, err
+	}
+	if xlsx.Drawing == nil {
+		return "", nil, err
+	}
+	target := f.getSheetRelationshipsTargetByID(sheet, xlsx.Drawing.RID)
+	drawingXML := strings.Replace(target, "..", "xl", -1)
+	_, ok := f.XLSX[drawingXML]
+	if !ok {
+		return "", nil, err
+	}
+	drawingRelationships := strings.Replace(
+		strings.Replace(target, "../drawings", "xl/drawings/_rels", -1), ".xml", ".xml.rels", -1)
+
+	return f.getPicture(row, col, drawingXML, drawingRelationships)
+}
+
+// DeletePicture provides a function to delete charts in spreadsheet by given
+// worksheet and cell name. Note that the image file won't be deleted from the
+// document currently.
+func (f *File) DeletePicture(sheet, cell string) (err error) {
+	col, row, err := CellNameToCoordinates(cell)
+	if err != nil {
+		return
+	}
+	col--
+	row--
+	ws, err := f.workSheetReader(sheet)
+	if err != nil {
+		return
+	}
+	if ws.Drawing == nil {
+		return
+	}
+	drawingXML := strings.Replace(f.getSheetRelationshipsTargetByID(sheet, ws.Drawing.RID), "..", "xl", -1)
+	return f.deleteDrawing(col, row, drawingXML, "Pic")
+}
+
+// getPicture provides a function to get picture base name and raw content
+// embed in spreadsheet by given coordinates and drawing relationships.
+func (f *File) getPicture(row, col int, drawingXML, drawingRelationships string) (ret string, buf []byte, err error) {
+	var (
+		wsDr            *xlsxWsDr
+		ok              bool
+		deWsDr          *decodeWsDr
+		drawRel         *xlsxRelationship
+		deTwoCellAnchor *decodeTwoCellAnchor
+	)
+
+	wsDr, _ = f.drawingParser(drawingXML)
+	if ret, buf = f.getPictureFromWsDr(row, col, drawingRelationships, wsDr); len(buf) > 0 {
+		return
+	}
+	deWsDr = new(decodeWsDr)
+	if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(drawingXML)))).
+		Decode(deWsDr); err != nil && err != io.EOF {
+		err = fmt.Errorf("xml decode error: %s", err)
+		return
+	}
+	err = nil
+	for _, anchor := range deWsDr.TwoCellAnchor {
+		deTwoCellAnchor = new(decodeTwoCellAnchor)
+		if err = f.xmlNewDecoder(strings.NewReader("<decodeTwoCellAnchor>" + anchor.Content + "</decodeTwoCellAnchor>")).
+			Decode(deTwoCellAnchor); err != nil && err != io.EOF {
+			err = fmt.Errorf("xml decode error: %s", err)
+			return
+		}
+		if err = nil; deTwoCellAnchor.From != nil && deTwoCellAnchor.Pic != nil {
+			if deTwoCellAnchor.From.Col == col && deTwoCellAnchor.From.Row == row {
+				drawRel = f.getDrawingRelationships(drawingRelationships, deTwoCellAnchor.Pic.BlipFill.Blip.Embed)
+				if _, ok = supportImageTypes[filepath.Ext(drawRel.Target)]; ok {
+					ret, buf = filepath.Base(drawRel.Target), f.XLSX[strings.Replace(drawRel.Target, "..", "xl", -1)]
+					return
+				}
+			}
+		}
+	}
+	return
+}
+
+// getPictureFromWsDr provides a function to get picture base name and raw
+// content in worksheet drawing by given coordinates and drawing
+// relationships.
+func (f *File) getPictureFromWsDr(row, col int, drawingRelationships string, wsDr *xlsxWsDr) (ret string, buf []byte) {
+	var (
+		ok      bool
+		anchor  *xdrCellAnchor
+		drawRel *xlsxRelationship
+	)
+	for _, anchor = range wsDr.TwoCellAnchor {
+		if anchor.From != nil && anchor.Pic != nil {
+			if anchor.From.Col == col && anchor.From.Row == row {
+				if drawRel = f.getDrawingRelationships(drawingRelationships,
+					anchor.Pic.BlipFill.Blip.Embed); drawRel != nil {
+					if _, ok = supportImageTypes[filepath.Ext(drawRel.Target)]; ok {
+						ret, buf = filepath.Base(drawRel.Target), f.XLSX[strings.Replace(drawRel.Target, "..", "xl", -1)]
+						return
+					}
+				}
+			}
+		}
+	}
+	return
+}
+
+// getDrawingRelationships provides a function to get drawing relationships
+// from xl/drawings/_rels/drawing%s.xml.rels by given file name and
+// relationship ID.
+func (f *File) getDrawingRelationships(rels, rID string) *xlsxRelationship {
+	if drawingRels := f.relsReader(rels); drawingRels != nil {
+		for _, v := range drawingRels.Relationships {
+			if v.ID == rID {
+				return &v
+			}
+		}
+	}
+	return nil
+}
+
+// drawingsWriter provides a function to save xl/drawings/drawing%d.xml after
+// serialize structure.
+func (f *File) drawingsWriter() {
+	for path, d := range f.Drawings {
+		if d != nil {
+			v, _ := xml.Marshal(d)
+			f.saveFileList(path, v)
+		}
+	}
+}
+
+// drawingResize calculate the height and width after resizing.
+func (f *File) drawingResize(sheet string, cell string, width, height float64, formatSet *formatPicture) (w, h, c, r int, err error) {
+	var mergeCells []MergeCell
+	mergeCells, err = f.GetMergeCells(sheet)
+	if err != nil {
+		return
+	}
+	var rng []int
+	var inMergeCell bool
+	if c, r, err = CellNameToCoordinates(cell); err != nil {
+		return
+	}
+	cellWidth, cellHeight := f.getColWidth(sheet, c), f.getRowHeight(sheet, r)
+	for _, mergeCell := range mergeCells {
+		if inMergeCell, err = f.checkCellInArea(cell, mergeCell[0]); err != nil {
+			return
+		}
+		if inMergeCell {
+			rng, _ = areaRangeToCoordinates(mergeCell.GetStartAxis(), mergeCell.GetEndAxis())
+			sortCoordinates(rng)
+		}
+	}
+	if inMergeCell {
+		cellWidth, cellHeight = 0, 0
+		c, r = rng[0], rng[1]
+		for col := rng[0] - 1; col < rng[2]; col++ {
+			cellWidth += f.getColWidth(sheet, col)
+		}
+		for row := rng[1] - 1; row < rng[3]; row++ {
+			cellHeight += f.getRowHeight(sheet, row)
+		}
+	}
+	if float64(cellWidth) < width {
+		asp := float64(cellWidth) / width
+		width, height = float64(cellWidth), height*asp
+	}
+	if float64(cellHeight) < height {
+		asp := float64(cellHeight) / height
+		height, width = float64(cellHeight), width*asp
+	}
+	width, height = width-float64(formatSet.OffsetX), height-float64(formatSet.OffsetY)
+	w, h = int(width*formatSet.XScale), int(height*formatSet.YScale)
+	return
+}

+ 595 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/pivotTable.go

@@ -0,0 +1,595 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"encoding/xml"
+	"errors"
+	"fmt"
+	"strconv"
+	"strings"
+)
+
+// PivotTableOption directly maps the format settings of the pivot table.
+type PivotTableOption struct {
+	DataRange       string
+	PivotTableRange string
+	Rows            []PivotTableField
+	Columns         []PivotTableField
+	Data            []PivotTableField
+	Filter          []PivotTableField
+}
+
+// PivotTableField directly maps the field settings of the pivot table.
+// Subtotal specifies the aggregation function that applies to this data
+// field. The default value is sum. The possible values for this attribute
+// are:
+//
+//     Average
+//     Count
+//     CountNums
+//     Max
+//     Min
+//     Product
+//     StdDev
+//     StdDevp
+//     Sum
+//     Var
+//     Varp
+//
+// Name specifies the name of the data field. Maximum 255 characters
+// are allowed in data field name, excess characters will be truncated.
+type PivotTableField struct {
+	Data     string
+	Name     string
+	Subtotal string
+}
+
+// AddPivotTable provides the method to add pivot table by given pivot table
+// options.
+//
+// For example, create a pivot table on the Sheet1!$G$2:$M$34 area with the
+// region Sheet1!$A$1:$E$31 as the data source, summarize by sum for sales:
+//
+//    package main
+//
+//    import (
+//        "fmt"
+//        "math/rand"
+//
+//        "github.com/360EntSecGroup-Skylar/excelize"
+//    )
+//
+//    func main() {
+//        f := excelize.NewFile()
+//        // Create some data in a sheet
+//        month := []string{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}
+//        year := []int{2017, 2018, 2019}
+//        types := []string{"Meat", "Dairy", "Beverages", "Produce"}
+//        region := []string{"East", "West", "North", "South"}
+//        f.SetSheetRow("Sheet1", "A1", &[]string{"Month", "Year", "Type", "Sales", "Region"})
+//        for i := 0; i < 30; i++ {
+//            f.SetCellValue("Sheet1", fmt.Sprintf("A%d", i+2), month[rand.Intn(12)])
+//            f.SetCellValue("Sheet1", fmt.Sprintf("B%d", i+2), year[rand.Intn(3)])
+//            f.SetCellValue("Sheet1", fmt.Sprintf("C%d", i+2), types[rand.Intn(4)])
+//            f.SetCellValue("Sheet1", fmt.Sprintf("D%d", i+2), rand.Intn(5000))
+//            f.SetCellValue("Sheet1", fmt.Sprintf("E%d", i+2), region[rand.Intn(4)])
+//        }
+//        if err := f.AddPivotTable(&excelize.PivotTableOption{
+//            DataRange:       "Sheet1!$A$1:$E$31",
+//            PivotTableRange: "Sheet1!$G$2:$M$34",
+//            Rows:            []excelize.PivotTableField{{Data: "Month"}, {Data: "Year"}},
+//            Filter:          []excelize.PivotTableField{{Data: "Region"}},
+//            Columns:         []excelize.PivotTableField{{Data: "Type"}},
+//            Data:            []excelize.PivotTableField{{Data: "Sales", Name: "Summarize", Subtotal: "Sum"}},
+//        }); err != nil {
+//            fmt.Println(err)
+//        }
+//        if err := f.SaveAs("Book1.xlsx"); err != nil {
+//            fmt.Println(err)
+//        }
+//    }
+//
+func (f *File) AddPivotTable(opt *PivotTableOption) error {
+	// parameter validation
+	dataSheet, pivotTableSheetPath, err := f.parseFormatPivotTableSet(opt)
+	if err != nil {
+		return err
+	}
+
+	pivotTableID := f.countPivotTables() + 1
+	pivotCacheID := f.countPivotCache() + 1
+
+	sheetRelationshipsPivotTableXML := "../pivotTables/pivotTable" + strconv.Itoa(pivotTableID) + ".xml"
+	pivotTableXML := strings.Replace(sheetRelationshipsPivotTableXML, "..", "xl", -1)
+	pivotCacheXML := "xl/pivotCache/pivotCacheDefinition" + strconv.Itoa(pivotCacheID) + ".xml"
+	err = f.addPivotCache(pivotCacheID, pivotCacheXML, opt, dataSheet)
+	if err != nil {
+		return err
+	}
+
+	// workbook pivot cache
+	workBookPivotCacheRID := f.addRels("xl/_rels/workbook.xml.rels", SourceRelationshipPivotCache, fmt.Sprintf("pivotCache/pivotCacheDefinition%d.xml", pivotCacheID), "")
+	cacheID := f.addWorkbookPivotCache(workBookPivotCacheRID)
+
+	pivotCacheRels := "xl/pivotTables/_rels/pivotTable" + strconv.Itoa(pivotTableID) + ".xml.rels"
+	// rId not used
+	_ = f.addRels(pivotCacheRels, SourceRelationshipPivotCache, fmt.Sprintf("../pivotCache/pivotCacheDefinition%d.xml", pivotCacheID), "")
+	err = f.addPivotTable(cacheID, pivotTableID, pivotTableXML, opt)
+	if err != nil {
+		return err
+	}
+	pivotTableSheetRels := "xl/worksheets/_rels/" + strings.TrimPrefix(pivotTableSheetPath, "xl/worksheets/") + ".rels"
+	f.addRels(pivotTableSheetRels, SourceRelationshipPivotTable, sheetRelationshipsPivotTableXML, "")
+	f.addContentTypePart(pivotTableID, "pivotTable")
+	f.addContentTypePart(pivotCacheID, "pivotCache")
+
+	return nil
+}
+
+// parseFormatPivotTableSet provides a function to validate pivot table
+// properties.
+func (f *File) parseFormatPivotTableSet(opt *PivotTableOption) (*xlsxWorksheet, string, error) {
+	if opt == nil {
+		return nil, "", errors.New("parameter is required")
+	}
+	dataSheetName, _, err := f.adjustRange(opt.DataRange)
+	if err != nil {
+		return nil, "", fmt.Errorf("parameter 'DataRange' parsing error: %s", err.Error())
+	}
+	pivotTableSheetName, _, err := f.adjustRange(opt.PivotTableRange)
+	if err != nil {
+		return nil, "", fmt.Errorf("parameter 'PivotTableRange' parsing error: %s", err.Error())
+	}
+	dataSheet, err := f.workSheetReader(dataSheetName)
+	if err != nil {
+		return dataSheet, "", err
+	}
+	pivotTableSheetPath, ok := f.sheetMap[trimSheetName(pivotTableSheetName)]
+	if !ok {
+		return dataSheet, pivotTableSheetPath, fmt.Errorf("sheet %s is not exist", pivotTableSheetName)
+	}
+	return dataSheet, pivotTableSheetPath, err
+}
+
+// adjustRange adjust range, for example: adjust Sheet1!$E$31:$A$1 to Sheet1!$A$1:$E$31
+func (f *File) adjustRange(rangeStr string) (string, []int, error) {
+	if len(rangeStr) < 1 {
+		return "", []int{}, errors.New("parameter is required")
+	}
+	rng := strings.Split(rangeStr, "!")
+	if len(rng) != 2 {
+		return "", []int{}, errors.New("parameter is invalid")
+	}
+	trimRng := strings.Replace(rng[1], "$", "", -1)
+	coordinates, err := f.areaRefToCoordinates(trimRng)
+	if err != nil {
+		return rng[0], []int{}, err
+	}
+	x1, y1, x2, y2 := coordinates[0], coordinates[1], coordinates[2], coordinates[3]
+	if x1 == x2 && y1 == y2 {
+		return rng[0], []int{}, errors.New("parameter is invalid")
+	}
+
+	// Correct the coordinate area, such correct C1:B3 to B1:C3.
+	if x2 < x1 {
+		x1, x2 = x2, x1
+	}
+
+	if y2 < y1 {
+		y1, y2 = y2, y1
+	}
+	return rng[0], []int{x1, y1, x2, y2}, nil
+}
+
+// getPivotFieldsOrder provides a function to get order list of pivot table
+// fields.
+func (f *File) getPivotFieldsOrder(dataRange string) ([]string, error) {
+	order := []string{}
+	dataSheet, coordinates, err := f.adjustRange(dataRange)
+	if err != nil {
+		return order, fmt.Errorf("parameter 'DataRange' parsing error: %s", err.Error())
+	}
+	for col := coordinates[0]; col <= coordinates[2]; col++ {
+		coordinate, _ := CoordinatesToCellName(col, coordinates[1])
+		name, err := f.GetCellValue(dataSheet, coordinate)
+		if err != nil {
+			return order, err
+		}
+		order = append(order, name)
+	}
+	return order, nil
+}
+
+// addPivotCache provides a function to create a pivot cache by given properties.
+func (f *File) addPivotCache(pivotCacheID int, pivotCacheXML string, opt *PivotTableOption, ws *xlsxWorksheet) error {
+	// validate data range
+	dataSheet, coordinates, err := f.adjustRange(opt.DataRange)
+	if err != nil {
+		return fmt.Errorf("parameter 'DataRange' parsing error: %s", err.Error())
+	}
+	// data range has been checked
+	order, _ := f.getPivotFieldsOrder(opt.DataRange)
+	hcell, _ := CoordinatesToCellName(coordinates[0], coordinates[1])
+	vcell, _ := CoordinatesToCellName(coordinates[2], coordinates[3])
+	pc := xlsxPivotCacheDefinition{
+		SaveData:      false,
+		RefreshOnLoad: true,
+		CacheSource: &xlsxCacheSource{
+			Type: "worksheet",
+			WorksheetSource: &xlsxWorksheetSource{
+				Ref:   hcell + ":" + vcell,
+				Sheet: dataSheet,
+			},
+		},
+		CacheFields: &xlsxCacheFields{},
+	}
+	for _, name := range order {
+		pc.CacheFields.CacheField = append(pc.CacheFields.CacheField, &xlsxCacheField{
+			Name: name,
+			SharedItems: &xlsxSharedItems{
+				Count: 0,
+			},
+		})
+	}
+	pc.CacheFields.Count = len(pc.CacheFields.CacheField)
+	pivotCache, err := xml.Marshal(pc)
+	f.saveFileList(pivotCacheXML, pivotCache)
+	return err
+}
+
+// addPivotTable provides a function to create a pivot table by given pivot
+// table ID and properties.
+func (f *File) addPivotTable(cacheID, pivotTableID int, pivotTableXML string, opt *PivotTableOption) error {
+	// validate pivot table range
+	_, coordinates, err := f.adjustRange(opt.PivotTableRange)
+	if err != nil {
+		return fmt.Errorf("parameter 'PivotTableRange' parsing error: %s", err.Error())
+	}
+
+	hcell, _ := CoordinatesToCellName(coordinates[0], coordinates[1])
+	vcell, _ := CoordinatesToCellName(coordinates[2], coordinates[3])
+
+	pt := xlsxPivotTableDefinition{
+		Name:        fmt.Sprintf("Pivot Table%d", pivotTableID),
+		CacheID:     cacheID,
+		DataCaption: "Values",
+		Location: &xlsxLocation{
+			Ref:            hcell + ":" + vcell,
+			FirstDataCol:   1,
+			FirstDataRow:   1,
+			FirstHeaderRow: 1,
+		},
+		PivotFields: &xlsxPivotFields{},
+		RowItems: &xlsxRowItems{
+			Count: 1,
+			I: []*xlsxI{
+				{
+					[]*xlsxX{{}, {}},
+				},
+			},
+		},
+		ColItems: &xlsxColItems{
+			Count: 1,
+			I:     []*xlsxI{{}},
+		},
+		PivotTableStyleInfo: &xlsxPivotTableStyleInfo{
+			Name:           "PivotStyleLight16",
+			ShowRowHeaders: true,
+			ShowColHeaders: true,
+			ShowLastColumn: true,
+		},
+	}
+
+	// pivot fields
+	_ = f.addPivotFields(&pt, opt)
+
+	// count pivot fields
+	pt.PivotFields.Count = len(pt.PivotFields.PivotField)
+
+	// data range has been checked
+	_ = f.addPivotRowFields(&pt, opt)
+	_ = f.addPivotColFields(&pt, opt)
+	_ = f.addPivotPageFields(&pt, opt)
+	_ = f.addPivotDataFields(&pt, opt)
+
+	pivotTable, err := xml.Marshal(pt)
+	f.saveFileList(pivotTableXML, pivotTable)
+	return err
+}
+
+// addPivotRowFields provides a method to add row fields for pivot table by
+// given pivot table options.
+func (f *File) addPivotRowFields(pt *xlsxPivotTableDefinition, opt *PivotTableOption) error {
+	// row fields
+	rowFieldsIndex, err := f.getPivotFieldsIndex(opt.Rows, opt)
+	if err != nil {
+		return err
+	}
+	for _, fieldIdx := range rowFieldsIndex {
+		if pt.RowFields == nil {
+			pt.RowFields = &xlsxRowFields{}
+		}
+		pt.RowFields.Field = append(pt.RowFields.Field, &xlsxField{
+			X: fieldIdx,
+		})
+	}
+
+	// count row fields
+	if pt.RowFields != nil {
+		pt.RowFields.Count = len(pt.RowFields.Field)
+	}
+	return err
+}
+
+// addPivotPageFields provides a method to add page fields for pivot table by
+// given pivot table options.
+func (f *File) addPivotPageFields(pt *xlsxPivotTableDefinition, opt *PivotTableOption) error {
+	// page fields
+	pageFieldsIndex, err := f.getPivotFieldsIndex(opt.Filter, opt)
+	if err != nil {
+		return err
+	}
+	pageFieldsName := f.getPivotTableFieldsName(opt.Filter)
+	for idx, pageField := range pageFieldsIndex {
+		if pt.PageFields == nil {
+			pt.PageFields = &xlsxPageFields{}
+		}
+		pt.PageFields.PageField = append(pt.PageFields.PageField, &xlsxPageField{
+			Name: pageFieldsName[idx],
+			Fld:  pageField,
+		})
+	}
+
+	// count page fields
+	if pt.PageFields != nil {
+		pt.PageFields.Count = len(pt.PageFields.PageField)
+	}
+	return err
+}
+
+// addPivotDataFields provides a method to add data fields for pivot table by
+// given pivot table options.
+func (f *File) addPivotDataFields(pt *xlsxPivotTableDefinition, opt *PivotTableOption) error {
+	// data fields
+	dataFieldsIndex, err := f.getPivotFieldsIndex(opt.Data, opt)
+	if err != nil {
+		return err
+	}
+	dataFieldsSubtotals := f.getPivotTableFieldsSubtotal(opt.Data)
+	dataFieldsName := f.getPivotTableFieldsName(opt.Data)
+	for idx, dataField := range dataFieldsIndex {
+		if pt.DataFields == nil {
+			pt.DataFields = &xlsxDataFields{}
+		}
+		pt.DataFields.DataField = append(pt.DataFields.DataField, &xlsxDataField{
+			Name:     dataFieldsName[idx],
+			Fld:      dataField,
+			Subtotal: dataFieldsSubtotals[idx],
+		})
+	}
+
+	// count data fields
+	if pt.DataFields != nil {
+		pt.DataFields.Count = len(pt.DataFields.DataField)
+	}
+	return err
+}
+
+// inStrSlice provides a method to check if an element is present in an array,
+// and return the index of its location, otherwise return -1.
+func inStrSlice(a []string, x string) int {
+	for idx, n := range a {
+		if x == n {
+			return idx
+		}
+	}
+	return -1
+}
+
+// inPivotTableField provides a method to check if an element is present in
+// pivot table fields list, and return the index of its location, otherwise
+// return -1.
+func inPivotTableField(a []PivotTableField, x string) int {
+	for idx, n := range a {
+		if x == n.Data {
+			return idx
+		}
+	}
+	return -1
+}
+
+// addPivotColFields create pivot column fields by given pivot table
+// definition and option.
+func (f *File) addPivotColFields(pt *xlsxPivotTableDefinition, opt *PivotTableOption) error {
+	if len(opt.Columns) == 0 {
+		return nil
+	}
+
+	pt.ColFields = &xlsxColFields{}
+
+	// col fields
+	colFieldsIndex, err := f.getPivotFieldsIndex(opt.Columns, opt)
+	if err != nil {
+		return err
+	}
+	for _, fieldIdx := range colFieldsIndex {
+		pt.ColFields.Field = append(pt.ColFields.Field, &xlsxField{
+			X: fieldIdx,
+		})
+	}
+
+	// count col fields
+	pt.ColFields.Count = len(pt.ColFields.Field)
+	return err
+}
+
+// addPivotFields create pivot fields based on the column order of the first
+// row in the data region by given pivot table definition and option.
+func (f *File) addPivotFields(pt *xlsxPivotTableDefinition, opt *PivotTableOption) error {
+	order, err := f.getPivotFieldsOrder(opt.DataRange)
+	if err != nil {
+		return err
+	}
+	for _, name := range order {
+		if inPivotTableField(opt.Rows, name) != -1 {
+			pt.PivotFields.PivotField = append(pt.PivotFields.PivotField, &xlsxPivotField{
+				Axis: "axisRow",
+				Name: f.getPivotTableFieldName(name, opt.Rows),
+				Items: &xlsxItems{
+					Count: 1,
+					Item: []*xlsxItem{
+						{T: "default"},
+					},
+				},
+			})
+			continue
+		}
+		if inPivotTableField(opt.Filter, name) != -1 {
+			pt.PivotFields.PivotField = append(pt.PivotFields.PivotField, &xlsxPivotField{
+				Axis: "axisPage",
+				Name: f.getPivotTableFieldName(name, opt.Columns),
+				Items: &xlsxItems{
+					Count: 1,
+					Item: []*xlsxItem{
+						{T: "default"},
+					},
+				},
+			})
+			continue
+		}
+		if inPivotTableField(opt.Columns, name) != -1 {
+			pt.PivotFields.PivotField = append(pt.PivotFields.PivotField, &xlsxPivotField{
+				Axis: "axisCol",
+				Name: f.getPivotTableFieldName(name, opt.Columns),
+				Items: &xlsxItems{
+					Count: 1,
+					Item: []*xlsxItem{
+						{T: "default"},
+					},
+				},
+			})
+			continue
+		}
+		if inPivotTableField(opt.Data, name) != -1 {
+			pt.PivotFields.PivotField = append(pt.PivotFields.PivotField, &xlsxPivotField{
+				DataField: true,
+			})
+			continue
+		}
+		pt.PivotFields.PivotField = append(pt.PivotFields.PivotField, &xlsxPivotField{})
+	}
+	return err
+}
+
+// countPivotTables provides a function to get drawing files count storage in
+// the folder xl/pivotTables.
+func (f *File) countPivotTables() int {
+	count := 0
+	for k := range f.XLSX {
+		if strings.Contains(k, "xl/pivotTables/pivotTable") {
+			count++
+		}
+	}
+	return count
+}
+
+// countPivotCache provides a function to get drawing files count storage in
+// the folder xl/pivotCache.
+func (f *File) countPivotCache() int {
+	count := 0
+	for k := range f.XLSX {
+		if strings.Contains(k, "xl/pivotCache/pivotCacheDefinition") {
+			count++
+		}
+	}
+	return count
+}
+
+// getPivotFieldsIndex convert the column of the first row in the data region
+// to a sequential index by given fields and pivot option.
+func (f *File) getPivotFieldsIndex(fields []PivotTableField, opt *PivotTableOption) ([]int, error) {
+	pivotFieldsIndex := []int{}
+	orders, err := f.getPivotFieldsOrder(opt.DataRange)
+	if err != nil {
+		return pivotFieldsIndex, err
+	}
+	for _, field := range fields {
+		if pos := inStrSlice(orders, field.Data); pos != -1 {
+			pivotFieldsIndex = append(pivotFieldsIndex, pos)
+		}
+	}
+	return pivotFieldsIndex, nil
+}
+
+// getPivotTableFieldsSubtotal prepare fields subtotal by given pivot table fields.
+func (f *File) getPivotTableFieldsSubtotal(fields []PivotTableField) []string {
+	field := make([]string, len(fields))
+	enums := []string{"average", "count", "countNums", "max", "min", "product", "stdDev", "stdDevp", "sum", "var", "varp"}
+	inEnums := func(enums []string, val string) string {
+		for _, enum := range enums {
+			if strings.ToLower(enum) == strings.ToLower(val) {
+				return enum
+			}
+		}
+		return "sum"
+	}
+	for idx, fld := range fields {
+		field[idx] = inEnums(enums, fld.Subtotal)
+	}
+	return field
+}
+
+// getPivotTableFieldsName prepare fields name list by given pivot table
+// fields.
+func (f *File) getPivotTableFieldsName(fields []PivotTableField) []string {
+	field := make([]string, len(fields))
+	for idx, fld := range fields {
+		if len(fld.Name) > 255 {
+			field[idx] = fld.Name[0:255]
+			continue
+		}
+		field[idx] = fld.Name
+	}
+	return field
+}
+
+// getPivotTableFieldName prepare field name by given pivot table fields.
+func (f *File) getPivotTableFieldName(name string, fields []PivotTableField) string {
+	fieldsName := f.getPivotTableFieldsName(fields)
+	for idx, field := range fields {
+		if field.Data == name {
+			return fieldsName[idx]
+		}
+	}
+	return ""
+}
+
+// addWorkbookPivotCache add the association ID of the pivot cache in xl/workbook.xml.
+func (f *File) addWorkbookPivotCache(RID int) int {
+	wb := f.workbookReader()
+	if wb.PivotCaches == nil {
+		wb.PivotCaches = &xlsxPivotCaches{}
+	}
+	cacheID := 1
+	for _, pivotCache := range wb.PivotCaches.PivotCache {
+		if pivotCache.CacheID > cacheID {
+			cacheID = pivotCache.CacheID
+		}
+	}
+	cacheID++
+	wb.PivotCaches.PivotCache = append(wb.PivotCaches.PivotCache, xlsxPivotCache{
+		CacheID: cacheID,
+		RID:     fmt.Sprintf("rId%d", RID),
+	})
+	return cacheID
+}

+ 675 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/rows.go

@@ -0,0 +1,675 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"bytes"
+	"encoding/xml"
+	"errors"
+	"fmt"
+	"io"
+	"log"
+	"math"
+	"strconv"
+)
+
+// GetRows return all the rows in a sheet by given worksheet name (case
+// sensitive). For example:
+//
+//    rows, err := f.GetRows("Sheet1")
+//    if err != nil {
+//        fmt.Println(err)
+//        return
+//    }
+//    for _, row := range rows {
+//        for _, colCell := range row {
+//            fmt.Print(colCell, "\t")
+//        }
+//        fmt.Println()
+//    }
+//
+func (f *File) GetRows(sheet string) ([][]string, error) {
+	rows, err := f.Rows(sheet)
+	if err != nil {
+		return nil, err
+	}
+	results := make([][]string, 0, 64)
+	for rows.Next() {
+		row, err := rows.Columns()
+		if err != nil {
+			break
+		}
+		results = append(results, row)
+	}
+	return results, nil
+}
+
+// Rows defines an iterator to a sheet.
+type Rows struct {
+	err                        error
+	curRow, totalRow, stashRow int
+	sheet                      string
+	rows                       []xlsxRow
+	f                          *File
+	decoder                    *xml.Decoder
+}
+
+// Next will return true if find the next row element.
+func (rows *Rows) Next() bool {
+	rows.curRow++
+	return rows.curRow <= rows.totalRow
+}
+
+// Error will return the error when the error occurs.
+func (rows *Rows) Error() error {
+	return rows.err
+}
+
+// Columns return the current row's column values.
+func (rows *Rows) Columns() ([]string, error) {
+	var (
+		err          error
+		inElement    string
+		row, cellCol int
+		columns      []string
+	)
+
+	if rows.stashRow >= rows.curRow {
+		return columns, err
+	}
+
+	d := rows.f.sharedStringsReader()
+	for {
+		token, _ := rows.decoder.Token()
+		if token == nil {
+			break
+		}
+		switch startElement := token.(type) {
+		case xml.StartElement:
+			inElement = startElement.Name.Local
+			if inElement == "row" {
+				for _, attr := range startElement.Attr {
+					if attr.Name.Local == "r" {
+						row, err = strconv.Atoi(attr.Value)
+						if err != nil {
+							return columns, err
+						}
+						if row > rows.curRow {
+							rows.stashRow = row - 1
+							return columns, err
+						}
+					}
+				}
+			}
+			if inElement == "c" {
+				cellCol++
+				colCell := xlsxC{}
+				_ = rows.decoder.DecodeElement(&colCell, &startElement)
+				if colCell.R != "" {
+					cellCol, _, err = CellNameToCoordinates(colCell.R)
+					if err != nil {
+						return columns, err
+					}
+				}
+				blank := cellCol - len(columns)
+				val, _ := colCell.getValueFrom(rows.f, d)
+				columns = append(appendSpace(blank, columns), val)
+			}
+		case xml.EndElement:
+			inElement = startElement.Name.Local
+			if inElement == "row" {
+				return columns, err
+			}
+		}
+	}
+	return columns, err
+}
+
+// appendSpace append blank characters to slice by given length and source slice.
+func appendSpace(l int, s []string) []string {
+	for i := 1; i < l; i++ {
+		s = append(s, "")
+	}
+	return s
+}
+
+// ErrSheetNotExist defines an error of sheet is not exist
+type ErrSheetNotExist struct {
+	SheetName string
+}
+
+func (err ErrSheetNotExist) Error() string {
+	return fmt.Sprintf("sheet %s is not exist", string(err.SheetName))
+}
+
+// Rows returns a rows iterator, used for streaming reading data for a
+// worksheet with a large data. For example:
+//
+//    rows, err := f.Rows("Sheet1")
+//    if err != nil {
+//        fmt.Println(err)
+//        return
+//    }
+//    for rows.Next() {
+//        row, err := rows.Columns()
+//        if err != nil {
+//            fmt.Println(err)
+//        }
+//        for _, colCell := range row {
+//            fmt.Print(colCell, "\t")
+//        }
+//        fmt.Println()
+//    }
+//
+func (f *File) Rows(sheet string) (*Rows, error) {
+	name, ok := f.sheetMap[trimSheetName(sheet)]
+	if !ok {
+		return nil, ErrSheetNotExist{sheet}
+	}
+	if f.Sheet[name] != nil {
+		// flush data
+		output, _ := xml.Marshal(f.Sheet[name])
+		f.saveFileList(name, f.replaceNameSpaceBytes(name, output))
+	}
+	var (
+		err       error
+		inElement string
+		row       int
+		rows      Rows
+	)
+	decoder := f.xmlNewDecoder(bytes.NewReader(f.readXML(name)))
+	for {
+		token, _ := decoder.Token()
+		if token == nil {
+			break
+		}
+		switch startElement := token.(type) {
+		case xml.StartElement:
+			inElement = startElement.Name.Local
+			if inElement == "row" {
+				row++
+				for _, attr := range startElement.Attr {
+					if attr.Name.Local == "r" {
+						row, err = strconv.Atoi(attr.Value)
+						if err != nil {
+							return &rows, err
+						}
+					}
+				}
+				rows.totalRow = row
+			}
+		default:
+		}
+	}
+	rows.f = f
+	rows.sheet = name
+	rows.decoder = f.xmlNewDecoder(bytes.NewReader(f.readXML(name)))
+	return &rows, nil
+}
+
+// SetRowHeight provides a function to set the height of a single row. For
+// example, set the height of the first row in Sheet1:
+//
+//    err := f.SetRowHeight("Sheet1", 1, 50)
+//
+func (f *File) SetRowHeight(sheet string, row int, height float64) error {
+	if row < 1 {
+		return newInvalidRowNumberError(row)
+	}
+
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+
+	prepareSheetXML(xlsx, 0, row)
+
+	rowIdx := row - 1
+	xlsx.SheetData.Row[rowIdx].Ht = height
+	xlsx.SheetData.Row[rowIdx].CustomHeight = true
+	return nil
+}
+
+// getRowHeight provides a function to get row height in pixels by given sheet
+// name and row index.
+func (f *File) getRowHeight(sheet string, row int) int {
+	xlsx, _ := f.workSheetReader(sheet)
+	for i := range xlsx.SheetData.Row {
+		v := &xlsx.SheetData.Row[i]
+		if v.R == row+1 && v.Ht != 0 {
+			return int(convertRowHeightToPixels(v.Ht))
+		}
+	}
+	// Optimisation for when the row heights haven't changed.
+	return int(defaultRowHeightPixels)
+}
+
+// GetRowHeight provides a function to get row height by given worksheet name
+// and row index. For example, get the height of the first row in Sheet1:
+//
+//    height, err := f.GetRowHeight("Sheet1", 1)
+//
+func (f *File) GetRowHeight(sheet string, row int) (float64, error) {
+	if row < 1 {
+		return defaultRowHeightPixels, newInvalidRowNumberError(row)
+	}
+
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return defaultRowHeightPixels, err
+	}
+	if row > len(xlsx.SheetData.Row) {
+		return defaultRowHeightPixels, nil // it will be better to use 0, but we take care with BC
+	}
+	for _, v := range xlsx.SheetData.Row {
+		if v.R == row && v.Ht != 0 {
+			return v.Ht, nil
+		}
+	}
+	// Optimisation for when the row heights haven't changed.
+	return defaultRowHeightPixels, nil
+}
+
+// sharedStringsReader provides a function to get the pointer to the structure
+// after deserialization of xl/sharedStrings.xml.
+func (f *File) sharedStringsReader() *xlsxSST {
+	var err error
+
+	if f.SharedStrings == nil {
+		var sharedStrings xlsxSST
+		ss := f.readXML("xl/sharedStrings.xml")
+		if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(ss))).
+			Decode(&sharedStrings); err != nil && err != io.EOF {
+			log.Printf("xml decode error: %s", err)
+		}
+		if sharedStrings.UniqueCount == 0 {
+			sharedStrings.UniqueCount = sharedStrings.Count
+		}
+		f.SharedStrings = &sharedStrings
+		for i := range sharedStrings.SI {
+			if sharedStrings.SI[i].T != nil {
+				f.sharedStringsMap[sharedStrings.SI[i].T.Val] = i
+			}
+		}
+		f.addContentTypePart(0, "sharedStrings")
+		rels := f.relsReader("xl/_rels/workbook.xml.rels")
+		for _, rel := range rels.Relationships {
+			if rel.Target == "sharedStrings.xml" {
+				return f.SharedStrings
+			}
+		}
+		// Update xl/_rels/workbook.xml.rels
+		f.addRels("xl/_rels/workbook.xml.rels", SourceRelationshipSharedStrings, "sharedStrings.xml", "")
+	}
+
+	return f.SharedStrings
+}
+
+// getValueFrom return a value from a column/row cell, this function is
+// inteded to be used with for range on rows an argument with the xlsx opened
+// file.
+func (xlsx *xlsxC) getValueFrom(f *File, d *xlsxSST) (string, error) {
+	switch xlsx.T {
+	case "s":
+		if xlsx.V != "" {
+			xlsxSI := 0
+			xlsxSI, _ = strconv.Atoi(xlsx.V)
+			if len(d.SI) > xlsxSI {
+				return f.formattedValue(xlsx.S, d.SI[xlsxSI].String()), nil
+			}
+		}
+		return f.formattedValue(xlsx.S, xlsx.V), nil
+	case "str":
+		return f.formattedValue(xlsx.S, xlsx.V), nil
+	case "inlineStr":
+		if xlsx.IS != nil {
+			return f.formattedValue(xlsx.S, xlsx.IS.String()), nil
+		}
+		return f.formattedValue(xlsx.S, xlsx.V), nil
+	default:
+		return f.formattedValue(xlsx.S, xlsx.V), nil
+	}
+}
+
+// SetRowVisible provides a function to set visible of a single row by given
+// worksheet name and Excel row number. For example, hide row 2 in Sheet1:
+//
+//    err := f.SetRowVisible("Sheet1", 2, false)
+//
+func (f *File) SetRowVisible(sheet string, row int, visible bool) error {
+	if row < 1 {
+		return newInvalidRowNumberError(row)
+	}
+
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	prepareSheetXML(xlsx, 0, row)
+	xlsx.SheetData.Row[row-1].Hidden = !visible
+	return nil
+}
+
+// GetRowVisible provides a function to get visible of a single row by given
+// worksheet name and Excel row number. For example, get visible state of row
+// 2 in Sheet1:
+//
+//    visible, err := f.GetRowVisible("Sheet1", 2)
+//
+func (f *File) GetRowVisible(sheet string, row int) (bool, error) {
+	if row < 1 {
+		return false, newInvalidRowNumberError(row)
+	}
+
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return false, err
+	}
+	if row > len(xlsx.SheetData.Row) {
+		return false, nil
+	}
+	return !xlsx.SheetData.Row[row-1].Hidden, nil
+}
+
+// SetRowOutlineLevel provides a function to set outline level number of a
+// single row by given worksheet name and Excel row number. The value of
+// parameter 'level' is 1-7. For example, outline row 2 in Sheet1 to level 1:
+//
+//    err := f.SetRowOutlineLevel("Sheet1", 2, 1)
+//
+func (f *File) SetRowOutlineLevel(sheet string, row int, level uint8) error {
+	if row < 1 {
+		return newInvalidRowNumberError(row)
+	}
+	if level > 7 || level < 1 {
+		return errors.New("invalid outline level")
+	}
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	prepareSheetXML(xlsx, 0, row)
+	xlsx.SheetData.Row[row-1].OutlineLevel = level
+	return nil
+}
+
+// GetRowOutlineLevel provides a function to get outline level number of a
+// single row by given worksheet name and Excel row number. For example, get
+// outline number of row 2 in Sheet1:
+//
+//    level, err := f.GetRowOutlineLevel("Sheet1", 2)
+//
+func (f *File) GetRowOutlineLevel(sheet string, row int) (uint8, error) {
+	if row < 1 {
+		return 0, newInvalidRowNumberError(row)
+	}
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return 0, err
+	}
+	if row > len(xlsx.SheetData.Row) {
+		return 0, nil
+	}
+	return xlsx.SheetData.Row[row-1].OutlineLevel, nil
+}
+
+// RemoveRow provides a function to remove single row by given worksheet name
+// and Excel row number. For example, remove row 3 in Sheet1:
+//
+//    err := f.RemoveRow("Sheet1", 3)
+//
+// Use this method with caution, which will affect changes in references such
+// as formulas, charts, and so on. If there is any referenced value of the
+// worksheet, it will cause a file error when you open it. The excelize only
+// partially updates these references currently.
+func (f *File) RemoveRow(sheet string, row int) error {
+	if row < 1 {
+		return newInvalidRowNumberError(row)
+	}
+
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	if row > len(xlsx.SheetData.Row) {
+		return f.adjustHelper(sheet, rows, row, -1)
+	}
+	keep := 0
+	for rowIdx := 0; rowIdx < len(xlsx.SheetData.Row); rowIdx++ {
+		v := &xlsx.SheetData.Row[rowIdx]
+		if v.R != row {
+			xlsx.SheetData.Row[keep] = *v
+			keep++
+		}
+	}
+	xlsx.SheetData.Row = xlsx.SheetData.Row[:keep]
+	return f.adjustHelper(sheet, rows, row, -1)
+}
+
+// InsertRow provides a function to insert a new row after given Excel row
+// number starting from 1. For example, create a new row before row 3 in
+// Sheet1:
+//
+//    err := f.InsertRow("Sheet1", 3)
+//
+// Use this method with caution, which will affect changes in references such
+// as formulas, charts, and so on. If there is any referenced value of the
+// worksheet, it will cause a file error when you open it. The excelize only
+// partially updates these references currently.
+func (f *File) InsertRow(sheet string, row int) error {
+	if row < 1 {
+		return newInvalidRowNumberError(row)
+	}
+	return f.adjustHelper(sheet, rows, row, 1)
+}
+
+// DuplicateRow inserts a copy of specified row (by its Excel row number) below
+//
+//    err := f.DuplicateRow("Sheet1", 2)
+//
+// Use this method with caution, which will affect changes in references such
+// as formulas, charts, and so on. If there is any referenced value of the
+// worksheet, it will cause a file error when you open it. The excelize only
+// partially updates these references currently.
+func (f *File) DuplicateRow(sheet string, row int) error {
+	return f.DuplicateRowTo(sheet, row, row+1)
+}
+
+// DuplicateRowTo inserts a copy of specified row by it Excel number
+// to specified row position moving down exists rows after target position
+//
+//    err := f.DuplicateRowTo("Sheet1", 2, 7)
+//
+// Use this method with caution, which will affect changes in references such
+// as formulas, charts, and so on. If there is any referenced value of the
+// worksheet, it will cause a file error when you open it. The excelize only
+// partially updates these references currently.
+func (f *File) DuplicateRowTo(sheet string, row, row2 int) error {
+	if row < 1 {
+		return newInvalidRowNumberError(row)
+	}
+
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	if row > len(xlsx.SheetData.Row) || row2 < 1 || row == row2 {
+		return nil
+	}
+
+	var ok bool
+	var rowCopy xlsxRow
+
+	for i, r := range xlsx.SheetData.Row {
+		if r.R == row {
+			rowCopy = xlsx.SheetData.Row[i]
+			ok = true
+			break
+		}
+	}
+	if !ok {
+		return nil
+	}
+
+	if err := f.adjustHelper(sheet, rows, row2, 1); err != nil {
+		return err
+	}
+
+	idx2 := -1
+	for i, r := range xlsx.SheetData.Row {
+		if r.R == row2 {
+			idx2 = i
+			break
+		}
+	}
+	if idx2 == -1 && len(xlsx.SheetData.Row) >= row2 {
+		return nil
+	}
+
+	rowCopy.C = append(make([]xlsxC, 0, len(rowCopy.C)), rowCopy.C...)
+	f.ajustSingleRowDimensions(&rowCopy, row2)
+
+	if idx2 != -1 {
+		xlsx.SheetData.Row[idx2] = rowCopy
+	} else {
+		xlsx.SheetData.Row = append(xlsx.SheetData.Row, rowCopy)
+	}
+	return f.duplicateMergeCells(sheet, xlsx, row, row2)
+}
+
+// duplicateMergeCells merge cells in the destination row if there are single
+// row merged cells in the copied row.
+func (f *File) duplicateMergeCells(sheet string, xlsx *xlsxWorksheet, row, row2 int) error {
+	if xlsx.MergeCells == nil {
+		return nil
+	}
+	if row > row2 {
+		row++
+	}
+	for _, rng := range xlsx.MergeCells.Cells {
+		coordinates, err := f.areaRefToCoordinates(rng.Ref)
+		if err != nil {
+			return err
+		}
+		if coordinates[1] < row2 && row2 < coordinates[3] {
+			return nil
+		}
+	}
+	for i := 0; i < len(xlsx.MergeCells.Cells); i++ {
+		areaData := xlsx.MergeCells.Cells[i]
+		coordinates, _ := f.areaRefToCoordinates(areaData.Ref)
+		x1, y1, x2, y2 := coordinates[0], coordinates[1], coordinates[2], coordinates[3]
+		if y1 == y2 && y1 == row {
+			from, _ := CoordinatesToCellName(x1, row2)
+			to, _ := CoordinatesToCellName(x2, row2)
+			if err := f.MergeCell(sheet, from, to); err != nil {
+				return err
+			}
+			i++
+		}
+	}
+	return nil
+}
+
+// checkRow provides a function to check and fill each column element for all
+// rows and make that is continuous in a worksheet of XML. For example:
+//
+//    <row r="15" spans="1:22" x14ac:dyDescent="0.2">
+//        <c r="A15" s="2" />
+//        <c r="B15" s="2" />
+//        <c r="F15" s="1" />
+//        <c r="G15" s="1" />
+//    </row>
+//
+// in this case, we should to change it to
+//
+//    <row r="15" spans="1:22" x14ac:dyDescent="0.2">
+//        <c r="A15" s="2" />
+//        <c r="B15" s="2" />
+//        <c r="C15" s="2" />
+//        <c r="D15" s="2" />
+//        <c r="E15" s="2" />
+//        <c r="F15" s="1" />
+//        <c r="G15" s="1" />
+//    </row>
+//
+// Noteice: this method could be very slow for large spreadsheets (more than
+// 3000 rows one sheet).
+func checkRow(xlsx *xlsxWorksheet) error {
+	for rowIdx := range xlsx.SheetData.Row {
+		rowData := &xlsx.SheetData.Row[rowIdx]
+
+		colCount := len(rowData.C)
+		if colCount == 0 {
+			continue
+		}
+		// check and fill the cell without r attribute in a row element
+		rCount := 0
+		for idx, cell := range rowData.C {
+			rCount++
+			if cell.R != "" {
+				lastR, _, err := CellNameToCoordinates(cell.R)
+				if err != nil {
+					return err
+				}
+				if lastR > rCount {
+					rCount = lastR
+				}
+				continue
+			}
+			rowData.C[idx].R, _ = CoordinatesToCellName(rCount, rowIdx+1)
+		}
+		lastCol, _, err := CellNameToCoordinates(rowData.C[colCount-1].R)
+		if err != nil {
+			return err
+		}
+
+		if colCount < lastCol {
+			oldList := rowData.C
+			newlist := make([]xlsxC, 0, lastCol)
+
+			rowData.C = xlsx.SheetData.Row[rowIdx].C[:0]
+
+			for colIdx := 0; colIdx < lastCol; colIdx++ {
+				cellName, err := CoordinatesToCellName(colIdx+1, rowIdx+1)
+				if err != nil {
+					return err
+				}
+				newlist = append(newlist, xlsxC{R: cellName})
+			}
+
+			rowData.C = newlist
+
+			for colIdx := range oldList {
+				colData := &oldList[colIdx]
+				colNum, _, err := CellNameToCoordinates(colData.R)
+				if err != nil {
+					return err
+				}
+				xlsx.SheetData.Row[rowIdx].C[colNum-1] = *colData
+			}
+		}
+	}
+	return nil
+}
+
+// convertRowHeightToPixels provides a function to convert the height of a
+// cell from user's units to pixels. If the height hasn't been set by the user
+// we use the default value. If the row is hidden it has a value of zero.
+func convertRowHeightToPixels(height float64) float64 {
+	var pixels float64
+	if height == 0 {
+		return pixels
+	}
+	pixels = math.Ceil(4.0 / 3.0 * height)
+	return pixels
+}

+ 462 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/shape.go

@@ -0,0 +1,462 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"encoding/json"
+	"strconv"
+	"strings"
+)
+
+// parseFormatShapeSet provides a function to parse the format settings of the
+// shape with default value.
+func parseFormatShapeSet(formatSet string) (*formatShape, error) {
+	format := formatShape{
+		Width:  160,
+		Height: 160,
+		Format: formatPicture{
+			FPrintsWithSheet: true,
+			FLocksWithSheet:  false,
+			NoChangeAspect:   false,
+			OffsetX:          0,
+			OffsetY:          0,
+			XScale:           1.0,
+			YScale:           1.0,
+		},
+	}
+	err := json.Unmarshal([]byte(formatSet), &format)
+	return &format, err
+}
+
+// AddShape provides the method to add shape in a sheet by given worksheet
+// index, shape format set (such as offset, scale, aspect ratio setting and
+// print settings) and properties set. For example, add text box (rect shape)
+// in Sheet1:
+//
+//    err := f.AddShape("Sheet1", "G6", `{"type":"rect","color":{"line":"#4286F4","fill":"#8eb9ff"},"paragraph":[{"text":"Rectangle Shape","font":{"bold":true,"italic":true,"family":"Times New Roman","size":36,"color":"#777777","underline":"sng"}}],"width":180,"height": 90}`)
+//
+// The following shows the type of shape supported by excelize:
+//
+//    accentBorderCallout1 (Callout 1 with Border and Accent Shape)
+//    accentBorderCallout2 (Callout 2 with Border and Accent Shape)
+//    accentBorderCallout3 (Callout 3 with Border and Accent Shape)
+//    accentCallout1 (Callout 1 Shape)
+//    accentCallout2 (Callout 2 Shape)
+//    accentCallout3 (Callout 3 Shape)
+//    actionButtonBackPrevious (Back or Previous Button Shape)
+//    actionButtonBeginning (Beginning Button Shape)
+//    actionButtonBlank (Blank Button Shape)
+//    actionButtonDocument (Document Button Shape)
+//    actionButtonEnd (End Button Shape)
+//    actionButtonForwardNext (Forward or Next Button Shape)
+//    actionButtonHelp (Help Button Shape)
+//    actionButtonHome (Home Button Shape)
+//    actionButtonInformation (Information Button Shape)
+//    actionButtonMovie (Movie Button Shape)
+//    actionButtonReturn (Return Button Shape)
+//    actionButtonSound (Sound Button Shape)
+//    arc (Curved Arc Shape)
+//    bentArrow (Bent Arrow Shape)
+//    bentConnector2 (Bent Connector 2 Shape)
+//    bentConnector3 (Bent Connector 3 Shape)
+//    bentConnector4 (Bent Connector 4 Shape)
+//    bentConnector5 (Bent Connector 5 Shape)
+//    bentUpArrow (Bent Up Arrow Shape)
+//    bevel (Bevel Shape)
+//    blockArc (Block Arc Shape)
+//    borderCallout1 (Callout 1 with Border Shape)
+//    borderCallout2 (Callout 2 with Border Shape)
+//    borderCallout3 (Callout 3 with Border Shape)
+//    bracePair (Brace Pair Shape)
+//    bracketPair (Bracket Pair Shape)
+//    callout1 (Callout 1 Shape)
+//    callout2 (Callout 2 Shape)
+//    callout3 (Callout 3 Shape)
+//    can (Can Shape)
+//    chartPlus (Chart Plus Shape)
+//    chartStar (Chart Star Shape)
+//    chartX (Chart X Shape)
+//    chevron (Chevron Shape)
+//    chord (Chord Shape)
+//    circularArrow (Circular Arrow Shape)
+//    cloud (Cloud Shape)
+//    cloudCallout (Callout Cloud Shape)
+//    corner (Corner Shape)
+//    cornerTabs (Corner Tabs Shape)
+//    cube (Cube Shape)
+//    curvedConnector2 (Curved Connector 2 Shape)
+//    curvedConnector3 (Curved Connector 3 Shape)
+//    curvedConnector4 (Curved Connector 4 Shape)
+//    curvedConnector5 (Curved Connector 5 Shape)
+//    curvedDownArrow (Curved Down Arrow Shape)
+//    curvedLeftArrow (Curved Left Arrow Shape)
+//    curvedRightArrow (Curved Right Arrow Shape)
+//    curvedUpArrow (Curved Up Arrow Shape)
+//    decagon (Decagon Shape)
+//    diagStripe (Diagonal Stripe Shape)
+//    diamond (Diamond Shape)
+//    dodecagon (Dodecagon Shape)
+//    donut (Donut Shape)
+//    doubleWave (Double Wave Shape)
+//    downArrow (Down Arrow Shape)
+//    downArrowCallout (Callout Down Arrow Shape)
+//    ellipse (Ellipse Shape)
+//    ellipseRibbon (Ellipse Ribbon Shape)
+//    ellipseRibbon2 (Ellipse Ribbon 2 Shape)
+//    flowChartAlternateProcess (Alternate Process Flow Shape)
+//    flowChartCollate (Collate Flow Shape)
+//    flowChartConnector (Connector Flow Shape)
+//    flowChartDecision (Decision Flow Shape)
+//    flowChartDelay (Delay Flow Shape)
+//    flowChartDisplay (Display Flow Shape)
+//    flowChartDocument (Document Flow Shape)
+//    flowChartExtract (Extract Flow Shape)
+//    flowChartInputOutput (Input Output Flow Shape)
+//    flowChartInternalStorage (Internal Storage Flow Shape)
+//    flowChartMagneticDisk (Magnetic Disk Flow Shape)
+//    flowChartMagneticDrum (Magnetic Drum Flow Shape)
+//    flowChartMagneticTape (Magnetic Tape Flow Shape)
+//    flowChartManualInput (Manual Input Flow Shape)
+//    flowChartManualOperation (Manual Operation Flow Shape)
+//    flowChartMerge (Merge Flow Shape)
+//    flowChartMultidocument (Multi-Document Flow Shape)
+//    flowChartOfflineStorage (Offline Storage Flow Shape)
+//    flowChartOffpageConnector (Off-Page Connector Flow Shape)
+//    flowChartOnlineStorage (Online Storage Flow Shape)
+//    flowChartOr (Or Flow Shape)
+//    flowChartPredefinedProcess (Predefined Process Flow Shape)
+//    flowChartPreparation (Preparation Flow Shape)
+//    flowChartProcess (Process Flow Shape)
+//    flowChartPunchedCard (Punched Card Flow Shape)
+//    flowChartPunchedTape (Punched Tape Flow Shape)
+//    flowChartSort (Sort Flow Shape)
+//    flowChartSummingJunction (Summing Junction Flow Shape)
+//    flowChartTerminator (Terminator Flow Shape)
+//    foldedCorner (Folded Corner Shape)
+//    frame (Frame Shape)
+//    funnel (Funnel Shape)
+//    gear6 (Gear 6 Shape)
+//    gear9 (Gear 9 Shape)
+//    halfFrame (Half Frame Shape)
+//    heart (Heart Shape)
+//    heptagon (Heptagon Shape)
+//    hexagon (Hexagon Shape)
+//    homePlate (Home Plate Shape)
+//    horizontalScroll (Horizontal Scroll Shape)
+//    irregularSeal1 (Irregular Seal 1 Shape)
+//    irregularSeal2 (Irregular Seal 2 Shape)
+//    leftArrow (Left Arrow Shape)
+//    leftArrowCallout (Callout Left Arrow Shape)
+//    leftBrace (Left Brace Shape)
+//    leftBracket (Left Bracket Shape)
+//    leftCircularArrow (Left Circular Arrow Shape)
+//    leftRightArrow (Left Right Arrow Shape)
+//    leftRightArrowCallout (Callout Left Right Arrow Shape)
+//    leftRightCircularArrow (Left Right Circular Arrow Shape)
+//    leftRightRibbon (Left Right Ribbon Shape)
+//    leftRightUpArrow (Left Right Up Arrow Shape)
+//    leftUpArrow (Left Up Arrow Shape)
+//    lightningBolt (Lightning Bolt Shape)
+//    line (Line Shape)
+//    lineInv (Line Inverse Shape)
+//    mathDivide (Divide Math Shape)
+//    mathEqual (Equal Math Shape)
+//    mathMinus (Minus Math Shape)
+//    mathMultiply (Multiply Math Shape)
+//    mathNotEqual (Not Equal Math Shape)
+//    mathPlus (Plus Math Shape)
+//    moon (Moon Shape)
+//    nonIsoscelesTrapezoid (Non-Isosceles Trapezoid Shape)
+//    noSmoking (No Smoking Shape)
+//    notchedRightArrow (Notched Right Arrow Shape)
+//    octagon (Octagon Shape)
+//    parallelogram (Parallelogram Shape)
+//    pentagon (Pentagon Shape)
+//    pie (Pie Shape)
+//    pieWedge (Pie Wedge Shape)
+//    plaque (Plaque Shape)
+//    plaqueTabs (Plaque Tabs Shape)
+//    plus (Plus Shape)
+//    quadArrow (Quad-Arrow Shape)
+//    quadArrowCallout (Callout Quad-Arrow Shape)
+//    rect (Rectangle Shape)
+//    ribbon (Ribbon Shape)
+//    ribbon2 (Ribbon 2 Shape)
+//    rightArrow (Right Arrow Shape)
+//    rightArrowCallout (Callout Right Arrow Shape)
+//    rightBrace (Right Brace Shape)
+//    rightBracket (Right Bracket Shape)
+//    round1Rect (One Round Corner Rectangle Shape)
+//    round2DiagRect (Two Diagonal Round Corner Rectangle Shape)
+//    round2SameRect (Two Same-side Round Corner Rectangle Shape)
+//    roundRect (Round Corner Rectangle Shape)
+//    rtTriangle (Right Triangle Shape)
+//    smileyFace (Smiley Face Shape)
+//    snip1Rect (One Snip Corner Rectangle Shape)
+//    snip2DiagRect (Two Diagonal Snip Corner Rectangle Shape)
+//    snip2SameRect (Two Same-side Snip Corner Rectangle Shape)
+//    snipRoundRect (One Snip One Round Corner Rectangle Shape)
+//    squareTabs (Square Tabs Shape)
+//    star10 (Ten Pointed Star Shape)
+//    star12 (Twelve Pointed Star Shape)
+//    star16 (Sixteen Pointed Star Shape)
+//    star24 (Twenty Four Pointed Star Shape)
+//    star32 (Thirty Two Pointed Star Shape)
+//    star4 (Four Pointed Star Shape)
+//    star5 (Five Pointed Star Shape)
+//    star6 (Six Pointed Star Shape)
+//    star7 (Seven Pointed Star Shape)
+//    star8 (Eight Pointed Star Shape)
+//    straightConnector1 (Straight Connector 1 Shape)
+//    stripedRightArrow (Striped Right Arrow Shape)
+//    sun (Sun Shape)
+//    swooshArrow (Swoosh Arrow Shape)
+//    teardrop (Teardrop Shape)
+//    trapezoid (Trapezoid Shape)
+//    triangle (Triangle Shape)
+//    upArrow (Up Arrow Shape)
+//    upArrowCallout (Callout Up Arrow Shape)
+//    upDownArrow (Up Down Arrow Shape)
+//    upDownArrowCallout (Callout Up Down Arrow Shape)
+//    uturnArrow (U-Turn Arrow Shape)
+//    verticalScroll (Vertical Scroll Shape)
+//    wave (Wave Shape)
+//    wedgeEllipseCallout (Callout Wedge Ellipse Shape)
+//    wedgeRectCallout (Callout Wedge Rectangle Shape)
+//    wedgeRoundRectCallout (Callout Wedge Round Rectangle Shape)
+//
+// The following shows the type of text underline supported by excelize:
+//
+//    none
+//    words
+//    sng
+//    dbl
+//    heavy
+//    dotted
+//    dottedHeavy
+//    dash
+//    dashHeavy
+//    dashLong
+//    dashLongHeavy
+//    dotDash
+//    dotDashHeavy
+//    dotDotDash
+//    dotDotDashHeavy
+//    wavy
+//    wavyHeavy
+//    wavyDbl
+//
+func (f *File) AddShape(sheet, cell, format string) error {
+	formatSet, err := parseFormatShapeSet(format)
+	if err != nil {
+		return err
+	}
+	// Read sheet data.
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	// Add first shape for given sheet, create xl/drawings/ and xl/drawings/_rels/ folder.
+	drawingID := f.countDrawings() + 1
+	drawingXML := "xl/drawings/drawing" + strconv.Itoa(drawingID) + ".xml"
+	sheetRelationshipsDrawingXML := "../drawings/drawing" + strconv.Itoa(drawingID) + ".xml"
+
+	if xlsx.Drawing != nil {
+		// The worksheet already has a shape or chart relationships, use the relationships drawing ../drawings/drawing%d.xml.
+		sheetRelationshipsDrawingXML = f.getSheetRelationshipsTargetByID(sheet, xlsx.Drawing.RID)
+		drawingID, _ = strconv.Atoi(strings.TrimSuffix(strings.TrimPrefix(sheetRelationshipsDrawingXML, "../drawings/drawing"), ".xml"))
+		drawingXML = strings.Replace(sheetRelationshipsDrawingXML, "..", "xl", -1)
+	} else {
+		// Add first shape for given sheet.
+		sheetRels := "xl/worksheets/_rels/" + strings.TrimPrefix(f.sheetMap[trimSheetName(sheet)], "xl/worksheets/") + ".rels"
+		rID := f.addRels(sheetRels, SourceRelationshipDrawingML, sheetRelationshipsDrawingXML, "")
+		f.addSheetDrawing(sheet, rID)
+		f.addSheetNameSpace(sheet, SourceRelationship)
+	}
+	err = f.addDrawingShape(sheet, drawingXML, cell, formatSet)
+	if err != nil {
+		return err
+	}
+	f.addContentTypePart(drawingID, "drawings")
+	return err
+}
+
+// addDrawingShape provides a function to add preset geometry by given sheet,
+// drawingXMLand format sets.
+func (f *File) addDrawingShape(sheet, drawingXML, cell string, formatSet *formatShape) error {
+	fromCol, fromRow, err := CellNameToCoordinates(cell)
+	if err != nil {
+		return err
+	}
+	colIdx := fromCol - 1
+	rowIdx := fromRow - 1
+
+	textUnderlineType := map[string]bool{
+		"none":            true,
+		"words":           true,
+		"sng":             true,
+		"dbl":             true,
+		"heavy":           true,
+		"dotted":          true,
+		"dottedHeavy":     true,
+		"dash":            true,
+		"dashHeavy":       true,
+		"dashLong":        true,
+		"dashLongHeavy":   true,
+		"dotDash":         true,
+		"dotDashHeavy":    true,
+		"dotDotDash":      true,
+		"dotDotDashHeavy": true,
+		"wavy":            true,
+		"wavyHeavy":       true,
+		"wavyDbl":         true,
+	}
+
+	width := int(float64(formatSet.Width) * formatSet.Format.XScale)
+	height := int(float64(formatSet.Height) * formatSet.Format.YScale)
+
+	colStart, rowStart, _, _, colEnd, rowEnd, x2, y2 :=
+		f.positionObjectPixels(sheet, colIdx, rowIdx, formatSet.Format.OffsetX, formatSet.Format.OffsetY,
+			width, height)
+	content, cNvPrID := f.drawingParser(drawingXML)
+	twoCellAnchor := xdrCellAnchor{}
+	twoCellAnchor.EditAs = formatSet.Format.Positioning
+	from := xlsxFrom{}
+	from.Col = colStart
+	from.ColOff = formatSet.Format.OffsetX * EMU
+	from.Row = rowStart
+	from.RowOff = formatSet.Format.OffsetY * EMU
+	to := xlsxTo{}
+	to.Col = colEnd
+	to.ColOff = x2 * EMU
+	to.Row = rowEnd
+	to.RowOff = y2 * EMU
+	twoCellAnchor.From = &from
+	twoCellAnchor.To = &to
+	shape := xdrSp{
+		NvSpPr: &xdrNvSpPr{
+			CNvPr: &xlsxCNvPr{
+				ID:   cNvPrID,
+				Name: "Shape " + strconv.Itoa(cNvPrID),
+			},
+			CNvSpPr: &xdrCNvSpPr{
+				TxBox: true,
+			},
+		},
+		SpPr: &xlsxSpPr{
+			PrstGeom: xlsxPrstGeom{
+				Prst: formatSet.Type,
+			},
+		},
+		Style: &xdrStyle{
+			LnRef:     setShapeRef(formatSet.Color.Line, 2),
+			FillRef:   setShapeRef(formatSet.Color.Fill, 1),
+			EffectRef: setShapeRef(formatSet.Color.Effect, 0),
+			FontRef: &aFontRef{
+				Idx: "minor",
+				SchemeClr: &attrValString{
+					Val: stringPtr("tx1"),
+				},
+			},
+		},
+		TxBody: &xdrTxBody{
+			BodyPr: &aBodyPr{
+				VertOverflow: "clip",
+				HorzOverflow: "clip",
+				Wrap:         "none",
+				RtlCol:       false,
+				Anchor:       "t",
+			},
+		},
+	}
+	if len(formatSet.Paragraph) < 1 {
+		formatSet.Paragraph = []formatShapeParagraph{
+			{
+				Font: Font{
+					Bold:      false,
+					Italic:    false,
+					Underline: "none",
+					Family:    f.GetDefaultFont(),
+					Size:      11,
+					Color:     "#000000",
+				},
+				Text: " ",
+			},
+		}
+	}
+	for _, p := range formatSet.Paragraph {
+		u := p.Font.Underline
+		_, ok := textUnderlineType[u]
+		if !ok {
+			u = "none"
+		}
+		text := p.Text
+		if text == "" {
+			text = " "
+		}
+		paragraph := &aP{
+			R: &aR{
+				RPr: aRPr{
+					I:       p.Font.Italic,
+					B:       p.Font.Bold,
+					Lang:    "en-US",
+					AltLang: "en-US",
+					U:       u,
+					Sz:      p.Font.Size * 100,
+					Latin:   &aLatin{Typeface: p.Font.Family},
+				},
+				T: text,
+			},
+			EndParaRPr: &aEndParaRPr{
+				Lang: "en-US",
+			},
+		}
+		srgbClr := strings.Replace(strings.ToUpper(p.Font.Color), "#", "", -1)
+		if len(srgbClr) == 6 {
+			paragraph.R.RPr.SolidFill = &aSolidFill{
+				SrgbClr: &attrValString{
+					Val: stringPtr(srgbClr),
+				},
+			}
+		}
+		shape.TxBody.P = append(shape.TxBody.P, paragraph)
+	}
+	twoCellAnchor.Sp = &shape
+	twoCellAnchor.ClientData = &xdrClientData{
+		FLocksWithSheet:  formatSet.Format.FLocksWithSheet,
+		FPrintsWithSheet: formatSet.Format.FPrintsWithSheet,
+	}
+	content.TwoCellAnchor = append(content.TwoCellAnchor, &twoCellAnchor)
+	f.Drawings[drawingXML] = content
+	return err
+}
+
+// setShapeRef provides a function to set color with hex model by given actual
+// color value.
+func setShapeRef(color string, i int) *aRef {
+	if color == "" {
+		return &aRef{
+			Idx: 0,
+			ScrgbClr: &aScrgbClr{
+				R: 0,
+				G: 0,
+				B: 0,
+			},
+		}
+	}
+	return &aRef{
+		Idx: i,
+		SrgbClr: &attrValString{
+			Val: stringPtr(strings.Replace(strings.ToUpper(color), "#", "", -1)),
+		},
+	}
+}

+ 1661 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/sheet.go

@@ -0,0 +1,1661 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"bytes"
+	"encoding/json"
+	"encoding/xml"
+	"errors"
+	"fmt"
+	"io"
+	"io/ioutil"
+	"log"
+	"os"
+	"path"
+	"reflect"
+	"regexp"
+	"strconv"
+	"strings"
+	"unicode/utf8"
+
+	"github.com/mohae/deepcopy"
+)
+
+// NewSheet provides function to create a new sheet by given worksheet name.
+// When creating a new spreadsheet file, the default worksheet will be
+// created. Returns the number of sheets in the workbook (file) after
+// appending the new sheet.
+func (f *File) NewSheet(name string) int {
+	// Check if the worksheet already exists
+	if f.GetSheetIndex(name) != -1 {
+		return f.SheetCount
+	}
+	f.DeleteSheet(name)
+	f.SheetCount++
+	wb := f.workbookReader()
+	sheetID := 0
+	for _, v := range wb.Sheets.Sheet {
+		if v.SheetID > sheetID {
+			sheetID = v.SheetID
+		}
+	}
+	sheetID++
+	// Update docProps/app.xml
+	f.setAppXML()
+	// Update [Content_Types].xml
+	f.setContentTypes("/xl/worksheets/sheet"+strconv.Itoa(sheetID)+".xml", ContentTypeSpreadSheetMLWorksheet)
+	// Create new sheet /xl/worksheets/sheet%d.xml
+	f.setSheet(sheetID, name)
+	// Update xl/_rels/workbook.xml.rels
+	rID := f.addRels("xl/_rels/workbook.xml.rels", SourceRelationshipWorkSheet, fmt.Sprintf("worksheets/sheet%d.xml", sheetID), "")
+	// Update xl/workbook.xml
+	f.setWorkbook(name, sheetID, rID)
+	return f.GetSheetIndex(name)
+}
+
+// contentTypesReader provides a function to get the pointer to the
+// [Content_Types].xml structure after deserialization.
+func (f *File) contentTypesReader() *xlsxTypes {
+	var err error
+
+	if f.ContentTypes == nil {
+		f.ContentTypes = new(xlsxTypes)
+		if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML("[Content_Types].xml")))).
+			Decode(f.ContentTypes); err != nil && err != io.EOF {
+			log.Printf("xml decode error: %s", err)
+		}
+	}
+
+	return f.ContentTypes
+}
+
+// contentTypesWriter provides a function to save [Content_Types].xml after
+// serialize structure.
+func (f *File) contentTypesWriter() {
+	if f.ContentTypes != nil {
+		output, _ := xml.Marshal(f.ContentTypes)
+		f.saveFileList("[Content_Types].xml", output)
+	}
+}
+
+// workbookReader provides a function to get the pointer to the xl/workbook.xml
+// structure after deserialization.
+func (f *File) workbookReader() *xlsxWorkbook {
+	var err error
+	if f.WorkBook == nil {
+		f.WorkBook = new(xlsxWorkbook)
+		if _, ok := f.xmlAttr["xl/workbook.xml"]; !ok {
+			d := f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML("xl/workbook.xml"))))
+			f.xmlAttr["xl/workbook.xml"] = append(f.xmlAttr["xl/workbook.xml"], getRootElement(d)...)
+			f.addNameSpaces("xl/workbook.xml", SourceRelationship)
+		}
+		if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML("xl/workbook.xml")))).
+			Decode(f.WorkBook); err != nil && err != io.EOF {
+			log.Printf("xml decode error: %s", err)
+		}
+	}
+	return f.WorkBook
+}
+
+// workBookWriter provides a function to save xl/workbook.xml after serialize
+// structure.
+func (f *File) workBookWriter() {
+	if f.WorkBook != nil {
+		output, _ := xml.Marshal(f.WorkBook)
+		f.saveFileList("xl/workbook.xml", replaceRelationshipsBytes(f.replaceNameSpaceBytes("xl/workbook.xml", output)))
+	}
+}
+
+// workSheetWriter provides a function to save xl/worksheets/sheet%d.xml after
+// serialize structure.
+func (f *File) workSheetWriter() {
+	for p, sheet := range f.Sheet {
+		if sheet != nil {
+			for k, v := range sheet.SheetData.Row {
+				f.Sheet[p].SheetData.Row[k].C = trimCell(v.C)
+			}
+			output, _ := xml.Marshal(sheet)
+			f.saveFileList(p, replaceRelationshipsBytes(f.replaceNameSpaceBytes(p, output)))
+			ok := f.checked[p]
+			if ok {
+				delete(f.Sheet, p)
+				f.checked[p] = false
+			}
+		}
+	}
+}
+
+// trimCell provides a function to trim blank cells which created by fillColumns.
+func trimCell(column []xlsxC) []xlsxC {
+	rowFull := true
+	for i := range column {
+		rowFull = column[i].hasValue() && rowFull
+	}
+	if rowFull {
+		return column
+	}
+	col := make([]xlsxC, len(column))
+	i := 0
+	for _, c := range column {
+		if c.hasValue() {
+			col[i] = c
+			i++
+		}
+	}
+	return col[0:i]
+}
+
+// setContentTypes provides a function to read and update property of contents
+// type of the spreadsheet.
+func (f *File) setContentTypes(partName, contentType string) {
+	content := f.contentTypesReader()
+	content.Overrides = append(content.Overrides, xlsxOverride{
+		PartName:    partName,
+		ContentType: contentType,
+	})
+}
+
+// setSheet provides a function to update sheet property by given index.
+func (f *File) setSheet(index int, name string) {
+	xlsx := xlsxWorksheet{
+		Dimension: &xlsxDimension{Ref: "A1"},
+		SheetViews: &xlsxSheetViews{
+			SheetView: []xlsxSheetView{{WorkbookViewID: 0}},
+		},
+	}
+	path := "xl/worksheets/sheet" + strconv.Itoa(index) + ".xml"
+	f.sheetMap[trimSheetName(name)] = path
+	f.Sheet[path] = &xlsx
+	f.xmlAttr[path] = append(f.xmlAttr[path], NameSpaceSpreadSheet)
+}
+
+// setWorkbook update workbook property of the spreadsheet. Maximum 31
+// characters are allowed in sheet title.
+func (f *File) setWorkbook(name string, sheetID, rid int) {
+	content := f.workbookReader()
+	content.Sheets.Sheet = append(content.Sheets.Sheet, xlsxSheet{
+		Name:    trimSheetName(name),
+		SheetID: sheetID,
+		ID:      "rId" + strconv.Itoa(rid),
+	})
+}
+
+// relsWriter provides a function to save relationships after
+// serialize structure.
+func (f *File) relsWriter() {
+	for path, rel := range f.Relationships {
+		if rel != nil {
+			output, _ := xml.Marshal(rel)
+			if strings.HasPrefix(path, "xl/worksheets/sheet/rels/sheet") {
+				output = f.replaceNameSpaceBytes(path, output)
+			}
+			f.saveFileList(path, replaceRelationshipsBytes(output))
+		}
+	}
+}
+
+// setAppXML update docProps/app.xml file of XML.
+func (f *File) setAppXML() {
+	f.saveFileList("docProps/app.xml", []byte(templateDocpropsApp))
+}
+
+// replaceRelationshipsBytes; Some tools that read spreadsheet files have very
+// strict requirements about the structure of the input XML. This function is
+// a horrible hack to fix that after the XML marshalling is completed.
+func replaceRelationshipsBytes(content []byte) []byte {
+	oldXmlns := []byte(`xmlns:relationships="http://schemas.openxmlformats.org/officeDocument/2006/relationships" relationships`)
+	newXmlns := []byte("r")
+	return bytesReplace(content, oldXmlns, newXmlns, -1)
+}
+
+// SetActiveSheet provides a function to set the default active sheet of the
+// workbook by a given index. Note that the active index is different from the
+// ID returned by function GetSheetMap(). It should be greater or equal to 0
+// and less than the total worksheet numbers.
+func (f *File) SetActiveSheet(index int) {
+	if index < 0 {
+		index = 0
+	}
+	wb := f.workbookReader()
+	for activeTab := range wb.Sheets.Sheet {
+		if activeTab == index {
+			if wb.BookViews == nil {
+				wb.BookViews = &xlsxBookViews{}
+			}
+			if len(wb.BookViews.WorkBookView) > 0 {
+				wb.BookViews.WorkBookView[0].ActiveTab = activeTab
+			} else {
+				wb.BookViews.WorkBookView = append(wb.BookViews.WorkBookView, xlsxWorkBookView{
+					ActiveTab: activeTab,
+				})
+			}
+		}
+	}
+	for idx, name := range f.GetSheetList() {
+		xlsx, err := f.workSheetReader(name)
+		if err != nil {
+			// Chartsheet or dialogsheet
+			return
+		}
+		if xlsx.SheetViews == nil {
+			xlsx.SheetViews = &xlsxSheetViews{
+				SheetView: []xlsxSheetView{{WorkbookViewID: 0}},
+			}
+		}
+		if len(xlsx.SheetViews.SheetView) > 0 {
+			xlsx.SheetViews.SheetView[0].TabSelected = false
+		}
+		if index == idx {
+			if len(xlsx.SheetViews.SheetView) > 0 {
+				xlsx.SheetViews.SheetView[0].TabSelected = true
+			} else {
+				xlsx.SheetViews.SheetView = append(xlsx.SheetViews.SheetView, xlsxSheetView{
+					TabSelected: true,
+				})
+			}
+		}
+	}
+}
+
+// GetActiveSheetIndex provides a function to get active sheet index of the
+// spreadsheet. If not found the active sheet will be return integer 0.
+func (f *File) GetActiveSheetIndex() (index int) {
+	var sheetID = f.getActiveSheetID()
+	wb := f.workbookReader()
+	if wb != nil {
+		for idx, sheet := range wb.Sheets.Sheet {
+			if sheet.SheetID == sheetID {
+				index = idx
+			}
+		}
+	}
+	return
+}
+
+// getActiveSheetID provides a function to get active sheet index of the
+// spreadsheet. If not found the active sheet will be return integer 0.
+func (f *File) getActiveSheetID() int {
+	wb := f.workbookReader()
+	if wb != nil {
+		if wb.BookViews != nil && len(wb.BookViews.WorkBookView) > 0 {
+			activeTab := wb.BookViews.WorkBookView[0].ActiveTab
+			if len(wb.Sheets.Sheet) > activeTab && wb.Sheets.Sheet[activeTab].SheetID != 0 {
+				return wb.Sheets.Sheet[activeTab].SheetID
+			}
+		}
+		if len(wb.Sheets.Sheet) >= 1 {
+			return wb.Sheets.Sheet[0].SheetID
+		}
+	}
+	return 0
+}
+
+// SetSheetName provides a function to set the worksheet name by given old and
+// new worksheet names. Maximum 31 characters are allowed in sheet title and
+// this function only changes the name of the sheet and will not update the
+// sheet name in the formula or reference associated with the cell. So there
+// may be problem formula error or reference missing.
+func (f *File) SetSheetName(oldName, newName string) {
+	oldName = trimSheetName(oldName)
+	newName = trimSheetName(newName)
+	content := f.workbookReader()
+	for k, v := range content.Sheets.Sheet {
+		if v.Name == oldName {
+			content.Sheets.Sheet[k].Name = newName
+			f.sheetMap[newName] = f.sheetMap[oldName]
+			delete(f.sheetMap, oldName)
+		}
+	}
+}
+
+// getSheetNameByID provides a function to get worksheet name of the
+// spreadsheet by given worksheet ID. If given sheet ID is invalid, will
+// return an empty string.
+func (f *File) getSheetNameByID(ID int) string {
+	wb := f.workbookReader()
+	if wb == nil || ID < 1 {
+		return ""
+	}
+	for _, sheet := range wb.Sheets.Sheet {
+		if ID == sheet.SheetID {
+			return sheet.Name
+		}
+	}
+	return ""
+}
+
+// GetSheetName provides a function to get the sheet name of the workbook by
+// the given sheet index. If the given sheet index is invalid, it will return
+// an empty string.
+func (f *File) GetSheetName(index int) (name string) {
+	for idx, sheet := range f.GetSheetList() {
+		if idx == index {
+			name = sheet
+		}
+	}
+	return
+}
+
+// getSheetID provides a function to get worksheet ID of the spreadsheet by
+// given sheet name. If given worksheet name is invalid, will return an
+// integer type value -1.
+func (f *File) getSheetID(name string) int {
+	var ID = -1
+	for sheetID, sheet := range f.GetSheetMap() {
+		if sheet == trimSheetName(name) {
+			ID = sheetID
+		}
+	}
+	return ID
+}
+
+// GetSheetIndex provides a function to get a sheet index of the workbook by
+// the given sheet name. If the given sheet name is invalid, it will return an
+// integer type value 0.
+func (f *File) GetSheetIndex(name string) int {
+	var idx = -1
+	for index, sheet := range f.GetSheetList() {
+		if sheet == trimSheetName(name) {
+			idx = index
+		}
+	}
+	return idx
+}
+
+// GetSheetMap provides a function to get worksheets, chart sheets, dialog
+// sheets ID and name map of the workbook. For example:
+//
+//    f, err := excelize.OpenFile("Book1.xlsx")
+//    if err != nil {
+//        return
+//    }
+//    for index, name := range f.GetSheetMap() {
+//        fmt.Println(index, name)
+//    }
+//
+func (f *File) GetSheetMap() map[int]string {
+	wb := f.workbookReader()
+	sheetMap := map[int]string{}
+	if wb != nil {
+		for _, sheet := range wb.Sheets.Sheet {
+			sheetMap[sheet.SheetID] = sheet.Name
+		}
+	}
+	return sheetMap
+}
+
+// GetSheetList provides a function to get worksheets, chart sheets, and
+// dialog sheets name list of the workbook.
+func (f *File) GetSheetList() (list []string) {
+	wb := f.workbookReader()
+	if wb != nil {
+		for _, sheet := range wb.Sheets.Sheet {
+			list = append(list, sheet.Name)
+		}
+	}
+	return
+}
+
+// getSheetMap provides a function to get worksheet name and XML file path map
+// of XLSX.
+func (f *File) getSheetMap() map[string]string {
+	content := f.workbookReader()
+	rels := f.relsReader("xl/_rels/workbook.xml.rels")
+	maps := map[string]string{}
+	for _, v := range content.Sheets.Sheet {
+		for _, rel := range rels.Relationships {
+			if rel.ID == v.ID {
+				// Construct a target XML as xl/worksheets/sheet%d by split path, compatible with different types of relative paths in workbook.xml.rels, for example: worksheets/sheet%d.xml and /xl/worksheets/sheet%d.xml
+				pathInfo := strings.Split(rel.Target, "/")
+				pathInfoLen := len(pathInfo)
+				if pathInfoLen > 1 {
+					maps[v.Name] = fmt.Sprintf("xl/%s", strings.Join(pathInfo[pathInfoLen-2:], "/"))
+				}
+			}
+		}
+	}
+	return maps
+}
+
+// SetSheetBackground provides a function to set background picture by given
+// worksheet name and file path.
+func (f *File) SetSheetBackground(sheet, picture string) error {
+	var err error
+	// Check picture exists first.
+	if _, err = os.Stat(picture); os.IsNotExist(err) {
+		return err
+	}
+	ext, ok := supportImageTypes[path.Ext(picture)]
+	if !ok {
+		return errors.New("unsupported image extension")
+	}
+	file, _ := ioutil.ReadFile(picture)
+	name := f.addMedia(file, ext)
+	sheetRels := "xl/worksheets/_rels/" + strings.TrimPrefix(f.sheetMap[trimSheetName(sheet)], "xl/worksheets/") + ".rels"
+	rID := f.addRels(sheetRels, SourceRelationshipImage, strings.Replace(name, "xl", "..", 1), "")
+	f.addSheetPicture(sheet, rID)
+	f.addSheetNameSpace(sheet, SourceRelationship)
+	f.setContentTypePartImageExtensions()
+	return err
+}
+
+// DeleteSheet provides a function to delete worksheet in a workbook by given
+// worksheet name. Use this method with caution, which will affect changes in
+// references such as formulas, charts, and so on. If there is any referenced
+// value of the deleted worksheet, it will cause a file error when you open it.
+// This function will be invalid when only the one worksheet is left.
+func (f *File) DeleteSheet(name string) {
+	if f.SheetCount == 1 || f.GetSheetIndex(name) == -1 {
+		return
+	}
+	sheetName := trimSheetName(name)
+	wb := f.workbookReader()
+	wbRels := f.relsReader("xl/_rels/workbook.xml.rels")
+	for idx, sheet := range wb.Sheets.Sheet {
+		if sheet.Name == sheetName {
+			wb.Sheets.Sheet = append(wb.Sheets.Sheet[:idx], wb.Sheets.Sheet[idx+1:]...)
+			var sheetXML, rels string
+			if wbRels != nil {
+				for _, rel := range wbRels.Relationships {
+					if rel.ID == sheet.ID {
+						sheetXML = fmt.Sprintf("xl/%s", rel.Target)
+						pathInfo := strings.Split(rel.Target, "/")
+						if len(pathInfo) == 2 {
+							rels = fmt.Sprintf("xl/%s/_rels/%s.rels", pathInfo[0], pathInfo[1])
+						}
+					}
+				}
+			}
+			target := f.deleteSheetFromWorkbookRels(sheet.ID)
+			f.deleteSheetFromContentTypes(target)
+			f.deleteCalcChain(sheet.SheetID, "") // Delete CalcChain
+			delete(f.sheetMap, sheetName)
+			delete(f.XLSX, sheetXML)
+			delete(f.XLSX, rels)
+			delete(f.Relationships, rels)
+			delete(f.Sheet, sheetXML)
+			delete(f.xmlAttr, sheetXML)
+			f.SheetCount--
+		}
+	}
+	if wb.BookViews != nil {
+		for idx, bookView := range wb.BookViews.WorkBookView {
+			if bookView.ActiveTab >= f.SheetCount {
+				wb.BookViews.WorkBookView[idx].ActiveTab--
+			}
+		}
+	}
+	f.SetActiveSheet(len(f.GetSheetMap()))
+}
+
+// deleteSheetFromWorkbookRels provides a function to remove worksheet
+// relationships by given relationships ID in the file
+// xl/_rels/workbook.xml.rels.
+func (f *File) deleteSheetFromWorkbookRels(rID string) string {
+	content := f.relsReader("xl/_rels/workbook.xml.rels")
+	for k, v := range content.Relationships {
+		if v.ID == rID {
+			content.Relationships = append(content.Relationships[:k], content.Relationships[k+1:]...)
+			return v.Target
+		}
+	}
+	return ""
+}
+
+// deleteSheetFromContentTypes provides a function to remove worksheet
+// relationships by given target name in the file [Content_Types].xml.
+func (f *File) deleteSheetFromContentTypes(target string) {
+	content := f.contentTypesReader()
+	for k, v := range content.Overrides {
+		if v.PartName == "/xl/"+target {
+			content.Overrides = append(content.Overrides[:k], content.Overrides[k+1:]...)
+		}
+	}
+}
+
+// CopySheet provides a function to duplicate a worksheet by gave source and
+// target worksheet index. Note that currently doesn't support duplicate
+// workbooks that contain tables, charts or pictures. For Example:
+//
+//    // Sheet1 already exists...
+//    index := f.NewSheet("Sheet2")
+//    err := f.CopySheet(1, index)
+//    return err
+//
+func (f *File) CopySheet(from, to int) error {
+	if from < 0 || to < 0 || from == to || f.GetSheetName(from) == "" || f.GetSheetName(to) == "" {
+		return errors.New("invalid worksheet index")
+	}
+	return f.copySheet(from, to)
+}
+
+// copySheet provides a function to duplicate a worksheet by gave source and
+// target worksheet name.
+func (f *File) copySheet(from, to int) error {
+	fromSheet := f.GetSheetName(from)
+	sheet, err := f.workSheetReader(fromSheet)
+	if err != nil {
+		return err
+	}
+	worksheet := deepcopy.Copy(sheet).(*xlsxWorksheet)
+	toSheetID := strconv.Itoa(f.getSheetID(f.GetSheetName(to)))
+	path := "xl/worksheets/sheet" + toSheetID + ".xml"
+	if len(worksheet.SheetViews.SheetView) > 0 {
+		worksheet.SheetViews.SheetView[0].TabSelected = false
+	}
+	worksheet.Drawing = nil
+	worksheet.TableParts = nil
+	worksheet.PageSetUp = nil
+	f.Sheet[path] = worksheet
+	toRels := "xl/worksheets/_rels/sheet" + toSheetID + ".xml.rels"
+	fromRels := "xl/worksheets/_rels/sheet" + strconv.Itoa(f.getSheetID(fromSheet)) + ".xml.rels"
+	_, ok := f.XLSX[fromRels]
+	if ok {
+		f.XLSX[toRels] = f.XLSX[fromRels]
+	}
+	fromSheetXMLPath, _ := f.sheetMap[trimSheetName(fromSheet)]
+	fromSheetAttr, _ := f.xmlAttr[fromSheetXMLPath]
+	f.xmlAttr[path] = fromSheetAttr
+	return err
+}
+
+// SetSheetVisible provides a function to set worksheet visible by given worksheet
+// name. A workbook must contain at least one visible worksheet. If the given
+// worksheet has been activated, this setting will be invalidated. Sheet state
+// values as defined by https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.spreadsheet.sheetstatevalues
+//
+//    visible
+//    hidden
+//    veryHidden
+//
+// For example, hide Sheet1:
+//
+//    err := f.SetSheetVisible("Sheet1", false)
+//
+func (f *File) SetSheetVisible(name string, visible bool) error {
+	name = trimSheetName(name)
+	content := f.workbookReader()
+	if visible {
+		for k, v := range content.Sheets.Sheet {
+			if v.Name == name {
+				content.Sheets.Sheet[k].State = ""
+			}
+		}
+		return nil
+	}
+	count := 0
+	for _, v := range content.Sheets.Sheet {
+		if v.State != "hidden" {
+			count++
+		}
+	}
+	for k, v := range content.Sheets.Sheet {
+		xlsx, err := f.workSheetReader(v.Name)
+		if err != nil {
+			return err
+		}
+		tabSelected := false
+		if len(xlsx.SheetViews.SheetView) > 0 {
+			tabSelected = xlsx.SheetViews.SheetView[0].TabSelected
+		}
+		if v.Name == name && count > 1 && !tabSelected {
+			content.Sheets.Sheet[k].State = "hidden"
+		}
+	}
+	return nil
+}
+
+// parseFormatPanesSet provides a function to parse the panes settings.
+func parseFormatPanesSet(formatSet string) (*formatPanes, error) {
+	format := formatPanes{}
+	err := json.Unmarshal([]byte(formatSet), &format)
+	return &format, err
+}
+
+// SetPanes provides a function to create and remove freeze panes and split panes
+// by given worksheet name and panes format set.
+//
+// activePane defines the pane that is active. The possible values for this
+// attribute are defined in the following table:
+//
+//     Enumeration Value              | Description
+//    --------------------------------+-------------------------------------------------------------
+//     bottomLeft (Bottom Left Pane)  | Bottom left pane, when both vertical and horizontal
+//                                    | splits are applied.
+//                                    |
+//                                    | This value is also used when only a horizontal split has
+//                                    | been applied, dividing the pane into upper and lower
+//                                    | regions. In that case, this value specifies the bottom
+//                                    | pane.
+//                                    |
+//    bottomRight (Bottom Right Pane) | Bottom right pane, when both vertical and horizontal
+//                                    | splits are applied.
+//                                    |
+//    topLeft (Top Left Pane)         | Top left pane, when both vertical and horizontal splits
+//                                    | are applied.
+//                                    |
+//                                    | This value is also used when only a horizontal split has
+//                                    | been applied, dividing the pane into upper and lower
+//                                    | regions. In that case, this value specifies the top pane.
+//                                    |
+//                                    | This value is also used when only a vertical split has
+//                                    | been applied, dividing the pane into right and left
+//                                    | regions. In that case, this value specifies the left pane
+//                                    |
+//    topRight (Top Right Pane)       | Top right pane, when both vertical and horizontal
+//                                    | splits are applied.
+//                                    |
+//                                    | This value is also used when only a vertical split has
+//                                    | been applied, dividing the pane into right and left
+//                                    | regions. In that case, this value specifies the right
+//                                    | pane.
+//
+// Pane state type is restricted to the values supported currently listed in the following table:
+//
+//     Enumeration Value              | Description
+//    --------------------------------+-------------------------------------------------------------
+//     frozen (Frozen)                | Panes are frozen, but were not split being frozen. In
+//                                    | this state, when the panes are unfrozen again, a single
+//                                    | pane results, with no split.
+//                                    |
+//                                    | In this state, the split bars are not adjustable.
+//                                    |
+//     split (Split)                  | Panes are split, but not frozen. In this state, the split
+//                                    | bars are adjustable by the user.
+//
+// x_split (Horizontal Split Position): Horizontal position of the split, in
+// 1/20th of a point; 0 (zero) if none. If the pane is frozen, this value
+// indicates the number of columns visible in the top pane.
+//
+// y_split (Vertical Split Position): Vertical position of the split, in 1/20th
+// of a point; 0 (zero) if none. If the pane is frozen, this value indicates the
+// number of rows visible in the left pane. The possible values for this
+// attribute are defined by the W3C XML Schema double datatype.
+//
+// top_left_cell: Location of the top left visible cell in the bottom right pane
+// (when in Left-To-Right mode).
+//
+// sqref (Sequence of References): Range of the selection. Can be non-contiguous
+// set of ranges.
+//
+// An example of how to freeze column A in the Sheet1 and set the active cell on
+// Sheet1!K16:
+//
+//    f.SetPanes("Sheet1", `{"freeze":true,"split":false,"x_split":1,"y_split":0,"top_left_cell":"B1","active_pane":"topRight","panes":[{"sqref":"K16","active_cell":"K16","pane":"topRight"}]}`)
+//
+// An example of how to freeze rows 1 to 9 in the Sheet1 and set the active cell
+// ranges on Sheet1!A11:XFD11:
+//
+//    f.SetPanes("Sheet1", `{"freeze":true,"split":false,"x_split":0,"y_split":9,"top_left_cell":"A34","active_pane":"bottomLeft","panes":[{"sqref":"A11:XFD11","active_cell":"A11","pane":"bottomLeft"}]}`)
+//
+// An example of how to create split panes in the Sheet1 and set the active cell
+// on Sheet1!J60:
+//
+//    f.SetPanes("Sheet1", `{"freeze":false,"split":true,"x_split":3270,"y_split":1800,"top_left_cell":"N57","active_pane":"bottomLeft","panes":[{"sqref":"I36","active_cell":"I36"},{"sqref":"G33","active_cell":"G33","pane":"topRight"},{"sqref":"J60","active_cell":"J60","pane":"bottomLeft"},{"sqref":"O60","active_cell":"O60","pane":"bottomRight"}]}`)
+//
+// An example of how to unfreeze and remove all panes on Sheet1:
+//
+//    f.SetPanes("Sheet1", `{"freeze":false,"split":false}`)
+//
+func (f *File) SetPanes(sheet, panes string) error {
+	fs, _ := parseFormatPanesSet(panes)
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	p := &xlsxPane{
+		ActivePane:  fs.ActivePane,
+		TopLeftCell: fs.TopLeftCell,
+		XSplit:      float64(fs.XSplit),
+		YSplit:      float64(fs.YSplit),
+	}
+	if fs.Freeze {
+		p.State = "frozen"
+	}
+	xlsx.SheetViews.SheetView[len(xlsx.SheetViews.SheetView)-1].Pane = p
+	if !(fs.Freeze) && !(fs.Split) {
+		if len(xlsx.SheetViews.SheetView) > 0 {
+			xlsx.SheetViews.SheetView[len(xlsx.SheetViews.SheetView)-1].Pane = nil
+		}
+	}
+	s := []*xlsxSelection{}
+	for _, p := range fs.Panes {
+		s = append(s, &xlsxSelection{
+			ActiveCell: p.ActiveCell,
+			Pane:       p.Pane,
+			SQRef:      p.SQRef,
+		})
+	}
+	xlsx.SheetViews.SheetView[len(xlsx.SheetViews.SheetView)-1].Selection = s
+	return err
+}
+
+// GetSheetVisible provides a function to get worksheet visible by given worksheet
+// name. For example, get visible state of Sheet1:
+//
+//    f.GetSheetVisible("Sheet1")
+//
+func (f *File) GetSheetVisible(name string) bool {
+	content := f.workbookReader()
+	visible := false
+	for k, v := range content.Sheets.Sheet {
+		if v.Name == trimSheetName(name) {
+			if content.Sheets.Sheet[k].State == "" || content.Sheets.Sheet[k].State == "visible" {
+				visible = true
+			}
+		}
+	}
+	return visible
+}
+
+// SearchSheet provides a function to get coordinates by given worksheet name,
+// cell value, and regular expression. The function doesn't support searching
+// on the calculated result, formatted numbers and conditional lookup
+// currently. If it is a merged cell, it will return the coordinates of the
+// upper left corner of the merged area.
+//
+// An example of search the coordinates of the value of "100" on Sheet1:
+//
+//    result, err := f.SearchSheet("Sheet1", "100")
+//
+// An example of search the coordinates where the numerical value in the range
+// of "0-9" of Sheet1 is described:
+//
+//    result, err := f.SearchSheet("Sheet1", "[0-9]", true)
+//
+func (f *File) SearchSheet(sheet, value string, reg ...bool) ([]string, error) {
+	var (
+		regSearch bool
+		result    []string
+	)
+	for _, r := range reg {
+		regSearch = r
+	}
+	name, ok := f.sheetMap[trimSheetName(sheet)]
+	if !ok {
+		return result, ErrSheetNotExist{sheet}
+	}
+	if f.Sheet[name] != nil {
+		// flush data
+		output, _ := xml.Marshal(f.Sheet[name])
+		f.saveFileList(name, f.replaceNameSpaceBytes(name, output))
+	}
+	return f.searchSheet(name, value, regSearch)
+}
+
+// searchSheet provides a function to get coordinates by given worksheet name,
+// cell value, and regular expression.
+func (f *File) searchSheet(name, value string, regSearch bool) (result []string, err error) {
+	var (
+		cellName, inElement string
+		cellCol, row        int
+		d                   *xlsxSST
+	)
+
+	d = f.sharedStringsReader()
+	decoder := f.xmlNewDecoder(bytes.NewReader(f.readXML(name)))
+	for {
+		var token xml.Token
+		token, err = decoder.Token()
+		if err != nil || token == nil {
+			if err == io.EOF {
+				err = nil
+			}
+			break
+		}
+		switch startElement := token.(type) {
+		case xml.StartElement:
+			inElement = startElement.Name.Local
+			if inElement == "row" {
+				row, err = attrValToInt("r", startElement.Attr)
+				if err != nil {
+					return
+				}
+			}
+			if inElement == "c" {
+				colCell := xlsxC{}
+				_ = decoder.DecodeElement(&colCell, &startElement)
+				val, _ := colCell.getValueFrom(f, d)
+				if regSearch {
+					regex := regexp.MustCompile(value)
+					if !regex.MatchString(val) {
+						continue
+					}
+				} else {
+					if val != value {
+						continue
+					}
+				}
+				cellCol, _, err = CellNameToCoordinates(colCell.R)
+				if err != nil {
+					return result, err
+				}
+				cellName, err = CoordinatesToCellName(cellCol, row)
+				if err != nil {
+					return result, err
+				}
+				result = append(result, cellName)
+			}
+		default:
+		}
+	}
+	return
+}
+
+// attrValToInt provides a function to convert the local names to an integer
+// by given XML attributes and specified names.
+func attrValToInt(name string, attrs []xml.Attr) (val int, err error) {
+	for _, attr := range attrs {
+		if attr.Name.Local == name {
+			val, err = strconv.Atoi(attr.Value)
+			if err != nil {
+				return
+			}
+		}
+	}
+	return
+}
+
+// SetHeaderFooter provides a function to set headers and footers by given
+// worksheet name and the control characters.
+//
+// Headers and footers are specified using the following settings fields:
+//
+//     Fields           | Description
+//    ------------------+-----------------------------------------------------------
+//     AlignWithMargins | Align header footer margins with page margins
+//     DifferentFirst   | Different first-page header and footer indicator
+//     DifferentOddEven | Different odd and even page headers and footers indicator
+//     ScaleWithDoc     | Scale header and footer with document scaling
+//     OddFooter        | Odd Page Footer
+//     OddHeader        | Odd Header
+//     EvenFooter       | Even Page Footer
+//     EvenHeader       | Even Page Header
+//     FirstFooter      | First Page Footer
+//     FirstHeader      | First Page Header
+//
+// The following formatting codes can be used in 6 string type fields:
+// OddHeader, OddFooter, EvenHeader, EvenFooter, FirstFooter, FirstHeader
+//
+//     Formatting Code        | Description
+//    ------------------------+-------------------------------------------------------------------------
+//     &&                     | The character "&"
+//                            |
+//     &font-size             | Size of the text font, where font-size is a decimal font size in points
+//                            |
+//     &"font name,font type" | A text font-name string, font name, and a text font-type string,
+//                            | font type
+//                            |
+//     &"-,Regular"           | Regular text format. Toggles bold and italic modes to off
+//                            |
+//     &A                     | Current worksheet's tab name
+//                            |
+//     &B or &"-,Bold"        | Bold text format, from off to on, or vice versa. The default mode is off
+//                            |
+//     &D                     | Current date
+//                            |
+//     &C                     | Center section
+//                            |
+//     &E                     | Double-underline text format
+//                            |
+//     &F                     | Current workbook's file name
+//                            |
+//     &G                     | Drawing object as background
+//                            |
+//     &H                     | Shadow text format
+//                            |
+//     &I or &"-,Italic"      | Italic text format
+//                            |
+//     &K                     | Text font color
+//                            |
+//                            | An RGB Color is specified as RRGGBB
+//                            |
+//                            | A Theme Color is specified as TTSNNN where TT is the theme color Id,
+//                            | S is either "+" or "-" of the tint/shade value, and NNN is the
+//                            | tint/shade value
+//                            |
+//     &L                     | Left section
+//                            |
+//     &N                     | Total number of pages
+//                            |
+//     &O                     | Outline text format
+//                            |
+//     &P[[+|-]n]             | Without the optional suffix, the current page number in decimal
+//                            |
+//     &R                     | Right section
+//                            |
+//     &S                     | Strikethrough text format
+//                            |
+//     &T                     | Current time
+//                            |
+//     &U                     | Single-underline text format. If double-underline mode is on, the next
+//                            | occurrence in a section specifier toggles double-underline mode to off;
+//                            | otherwise, it toggles single-underline mode, from off to on, or vice
+//                            | versa. The default mode is off
+//                            |
+//     &X                     | Superscript text format
+//                            |
+//     &Y                     | Subscript text format
+//                            |
+//     &Z                     | Current workbook's file path
+//
+// For example:
+//
+//    err := f.SetHeaderFooter("Sheet1", &excelize.FormatHeaderFooter{
+//        DifferentFirst:   true,
+//        DifferentOddEven: true,
+//        OddHeader:        "&R&P",
+//        OddFooter:        "&C&F",
+//        EvenHeader:       "&L&P",
+//        EvenFooter:       "&L&D&R&T",
+//        FirstHeader:      `&CCenter &"-,Bold"Bold&"-,Regular"HeaderU+000A&D`,
+//    })
+//
+// This example shows:
+//
+// - The first page has its own header and footer
+//
+// - Odd and even-numbered pages have different headers and footers
+//
+// - Current page number in the right section of odd-page headers
+//
+// - Current workbook's file name in the center section of odd-page footers
+//
+// - Current page number in the left section of even-page headers
+//
+// - Current date in the left section and the current time in the right section
+// of even-page footers
+//
+// - The text "Center Bold Header" on the first line of the center section of
+// the first page, and the date on the second line of the center section of
+// that same page
+//
+// - No footer on the first page
+//
+func (f *File) SetHeaderFooter(sheet string, settings *FormatHeaderFooter) error {
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	if settings == nil {
+		xlsx.HeaderFooter = nil
+		return err
+	}
+
+	v := reflect.ValueOf(*settings)
+	// Check 6 string type fields: OddHeader, OddFooter, EvenHeader, EvenFooter,
+	// FirstFooter, FirstHeader
+	for i := 4; i < v.NumField()-1; i++ {
+		if v.Field(i).Len() >= 255 {
+			return fmt.Errorf("field %s must be less than 255 characters", v.Type().Field(i).Name)
+		}
+	}
+	xlsx.HeaderFooter = &xlsxHeaderFooter{
+		AlignWithMargins: settings.AlignWithMargins,
+		DifferentFirst:   settings.DifferentFirst,
+		DifferentOddEven: settings.DifferentOddEven,
+		ScaleWithDoc:     settings.ScaleWithDoc,
+		OddHeader:        settings.OddHeader,
+		OddFooter:        settings.OddFooter,
+		EvenHeader:       settings.EvenHeader,
+		EvenFooter:       settings.EvenFooter,
+		FirstFooter:      settings.FirstFooter,
+		FirstHeader:      settings.FirstHeader,
+	}
+	return err
+}
+
+// ProtectSheet provides a function to prevent other users from accidentally
+// or deliberately changing, moving, or deleting data in a worksheet. For
+// example, protect Sheet1 with protection settings:
+//
+//    err := f.ProtectSheet("Sheet1", &excelize.FormatSheetProtection{
+//        Password:      "password",
+//        EditScenarios: false,
+//    })
+//
+func (f *File) ProtectSheet(sheet string, settings *FormatSheetProtection) error {
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	if settings == nil {
+		settings = &FormatSheetProtection{
+			EditObjects:       true,
+			EditScenarios:     true,
+			SelectLockedCells: true,
+		}
+	}
+	xlsx.SheetProtection = &xlsxSheetProtection{
+		AutoFilter:          settings.AutoFilter,
+		DeleteColumns:       settings.DeleteColumns,
+		DeleteRows:          settings.DeleteRows,
+		FormatCells:         settings.FormatCells,
+		FormatColumns:       settings.FormatColumns,
+		FormatRows:          settings.FormatRows,
+		InsertColumns:       settings.InsertColumns,
+		InsertHyperlinks:    settings.InsertHyperlinks,
+		InsertRows:          settings.InsertRows,
+		Objects:             settings.EditObjects,
+		PivotTables:         settings.PivotTables,
+		Scenarios:           settings.EditScenarios,
+		SelectLockedCells:   settings.SelectLockedCells,
+		SelectUnlockedCells: settings.SelectUnlockedCells,
+		Sheet:               true,
+		Sort:                settings.Sort,
+	}
+	if settings.Password != "" {
+		xlsx.SheetProtection.Password = genSheetPasswd(settings.Password)
+	}
+	return err
+}
+
+// UnprotectSheet provides a function to unprotect an Excel worksheet.
+func (f *File) UnprotectSheet(sheet string) error {
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	xlsx.SheetProtection = nil
+	return err
+}
+
+// trimSheetName provides a function to trim invaild characters by given worksheet
+// name.
+func trimSheetName(name string) string {
+	if strings.ContainsAny(name, ":\\/?*[]") || utf8.RuneCountInString(name) > 31 {
+		r := make([]rune, 0, 31)
+		for _, v := range name {
+			switch v {
+			case 58, 92, 47, 63, 42, 91, 93: // replace :\/?*[]
+				continue
+			default:
+				r = append(r, v)
+			}
+			if len(r) == 31 {
+				break
+			}
+		}
+		name = string(r)
+	}
+	return name
+}
+
+// PageLayoutOption is an option of a page layout of a worksheet. See
+// SetPageLayout().
+type PageLayoutOption interface {
+	setPageLayout(layout *xlsxPageSetUp)
+}
+
+// PageLayoutOptionPtr is a writable PageLayoutOption. See GetPageLayout().
+type PageLayoutOptionPtr interface {
+	PageLayoutOption
+	getPageLayout(layout *xlsxPageSetUp)
+}
+
+type (
+	// PageLayoutOrientation defines the orientation of page layout for a
+	// worksheet.
+	PageLayoutOrientation string
+	// PageLayoutPaperSize defines the paper size of the worksheet
+	PageLayoutPaperSize int
+	// FitToHeight specified number of vertical pages to fit on
+	FitToHeight int
+	// FitToWidth specified number of horizontal pages to fit on
+	FitToWidth int
+)
+
+const (
+	// OrientationPortrait indicates page layout orientation id portrait.
+	OrientationPortrait = "portrait"
+	// OrientationLandscape indicates page layout orientation id landscape.
+	OrientationLandscape = "landscape"
+)
+
+// setPageLayout provides a method to set the orientation for the worksheet.
+func (o PageLayoutOrientation) setPageLayout(ps *xlsxPageSetUp) {
+	ps.Orientation = string(o)
+}
+
+// getPageLayout provides a method to get the orientation for the worksheet.
+func (o *PageLayoutOrientation) getPageLayout(ps *xlsxPageSetUp) {
+	// Excel default: portrait
+	if ps == nil || ps.Orientation == "" {
+		*o = OrientationPortrait
+		return
+	}
+	*o = PageLayoutOrientation(ps.Orientation)
+}
+
+// setPageLayout provides a method to set the paper size for the worksheet.
+func (p PageLayoutPaperSize) setPageLayout(ps *xlsxPageSetUp) {
+	ps.PaperSize = int(p)
+}
+
+// getPageLayout provides a method to get the paper size for the worksheet.
+func (p *PageLayoutPaperSize) getPageLayout(ps *xlsxPageSetUp) {
+	// Excel default: 1
+	if ps == nil || ps.PaperSize == 0 {
+		*p = 1
+		return
+	}
+	*p = PageLayoutPaperSize(ps.PaperSize)
+}
+
+// setPageLayout provides a method to set the fit to height for the worksheet.
+func (p FitToHeight) setPageLayout(ps *xlsxPageSetUp) {
+	if int(p) > 0 {
+		ps.FitToHeight = int(p)
+	}
+}
+
+// getPageLayout provides a method to get the fit to height for the worksheet.
+func (p *FitToHeight) getPageLayout(ps *xlsxPageSetUp) {
+	if ps == nil || ps.FitToHeight == 0 {
+		*p = 1
+		return
+	}
+	*p = FitToHeight(ps.FitToHeight)
+}
+
+// setPageLayout provides a method to set the fit to width for the worksheet.
+func (p FitToWidth) setPageLayout(ps *xlsxPageSetUp) {
+	if int(p) > 0 {
+		ps.FitToWidth = int(p)
+	}
+}
+
+// getPageLayout provides a method to get the fit to width for the worksheet.
+func (p *FitToWidth) getPageLayout(ps *xlsxPageSetUp) {
+	if ps == nil || ps.FitToWidth == 0 {
+		*p = 1
+		return
+	}
+	*p = FitToWidth(ps.FitToWidth)
+}
+
+// SetPageLayout provides a function to sets worksheet page layout.
+//
+// Available options:
+//   PageLayoutOrientation(string)
+//   PageLayoutPaperSize(int)
+//
+// The following shows the paper size sorted by excelize index number:
+//
+//     Index | Paper Size
+//    -------+-----------------------------------------------
+//       1   | Letter paper (8.5 in. by 11 in.)
+//       2   | Letter small paper (8.5 in. by 11 in.)
+//       3   | Tabloid paper (11 in. by 17 in.)
+//       4   | Ledger paper (17 in. by 11 in.)
+//       5   | Legal paper (8.5 in. by 14 in.)
+//       6   | Statement paper (5.5 in. by 8.5 in.)
+//       7   | Executive paper (7.25 in. by 10.5 in.)
+//       8   | A3 paper (297 mm by 420 mm)
+//       9   | A4 paper (210 mm by 297 mm)
+//       10  | A4 small paper (210 mm by 297 mm)
+//       11  | A5 paper (148 mm by 210 mm)
+//       12  | B4 paper (250 mm by 353 mm)
+//       13  | B5 paper (176 mm by 250 mm)
+//       14  | Folio paper (8.5 in. by 13 in.)
+//       15  | Quarto paper (215 mm by 275 mm)
+//       16  | Standard paper (10 in. by 14 in.)
+//       17  | Standard paper (11 in. by 17 in.)
+//       18  | Note paper (8.5 in. by 11 in.)
+//       19  | #9 envelope (3.875 in. by 8.875 in.)
+//       20  | #10 envelope (4.125 in. by 9.5 in.)
+//       21  | #11 envelope (4.5 in. by 10.375 in.)
+//       22  | #12 envelope (4.75 in. by 11 in.)
+//       23  | #14 envelope (5 in. by 11.5 in.)
+//       24  | C paper (17 in. by 22 in.)
+//       25  | D paper (22 in. by 34 in.)
+//       26  | E paper (34 in. by 44 in.)
+//       27  | DL envelope (110 mm by 220 mm)
+//       28  | C5 envelope (162 mm by 229 mm)
+//       29  | C3 envelope (324 mm by 458 mm)
+//       30  | C4 envelope (229 mm by 324 mm)
+//       31  | C6 envelope (114 mm by 162 mm)
+//       32  | C65 envelope (114 mm by 229 mm)
+//       33  | B4 envelope (250 mm by 353 mm)
+//       34  | B5 envelope (176 mm by 250 mm)
+//       35  | B6 envelope (176 mm by 125 mm)
+//       36  | Italy envelope (110 mm by 230 mm)
+//       37  | Monarch envelope (3.875 in. by 7.5 in.).
+//       38  | 6 3/4 envelope (3.625 in. by 6.5 in.)
+//       39  | US standard fanfold (14.875 in. by 11 in.)
+//       40  | German standard fanfold (8.5 in. by 12 in.)
+//       41  | German legal fanfold (8.5 in. by 13 in.)
+//       42  | ISO B4 (250 mm by 353 mm)
+//       43  | Japanese postcard (100 mm by 148 mm)
+//       44  | Standard paper (9 in. by 11 in.)
+//       45  | Standard paper (10 in. by 11 in.)
+//       46  | Standard paper (15 in. by 11 in.)
+//       47  | Invite envelope (220 mm by 220 mm)
+//       50  | Letter extra paper (9.275 in. by 12 in.)
+//       51  | Legal extra paper (9.275 in. by 15 in.)
+//       52  | Tabloid extra paper (11.69 in. by 18 in.)
+//       53  | A4 extra paper (236 mm by 322 mm)
+//       54  | Letter transverse paper (8.275 in. by 11 in.)
+//       55  | A4 transverse paper (210 mm by 297 mm)
+//       56  | Letter extra transverse paper (9.275 in. by 12 in.)
+//       57  | SuperA/SuperA/A4 paper (227 mm by 356 mm)
+//       58  | SuperB/SuperB/A3 paper (305 mm by 487 mm)
+//       59  | Letter plus paper (8.5 in. by 12.69 in.)
+//       60  | A4 plus paper (210 mm by 330 mm)
+//       61  | A5 transverse paper (148 mm by 210 mm)
+//       62  | JIS B5 transverse paper (182 mm by 257 mm)
+//       63  | A3 extra paper (322 mm by 445 mm)
+//       64  | A5 extra paper (174 mm by 235 mm)
+//       65  | ISO B5 extra paper (201 mm by 276 mm)
+//       66  | A2 paper (420 mm by 594 mm)
+//       67  | A3 transverse paper (297 mm by 420 mm)
+//       68  | A3 extra transverse paper (322 mm by 445 mm)
+//       69  | Japanese Double Postcard (200 mm x 148 mm)
+//       70  | A6 (105 mm x 148 mm)
+//       71  | Japanese Envelope Kaku #2
+//       72  | Japanese Envelope Kaku #3
+//       73  | Japanese Envelope Chou #3
+//       74  | Japanese Envelope Chou #4
+//       75  | Letter Rotated (11in x 8 1/2 11 in)
+//       76  | A3 Rotated (420 mm x 297 mm)
+//       77  | A4 Rotated (297 mm x 210 mm)
+//       78  | A5 Rotated (210 mm x 148 mm)
+//       79  | B4 (JIS) Rotated (364 mm x 257 mm)
+//       80  | B5 (JIS) Rotated (257 mm x 182 mm)
+//       81  | Japanese Postcard Rotated (148 mm x 100 mm)
+//       82  | Double Japanese Postcard Rotated (148 mm x 200 mm)
+//       83  | A6 Rotated (148 mm x 105 mm)
+//       84  | Japanese Envelope Kaku #2 Rotated
+//       85  | Japanese Envelope Kaku #3 Rotated
+//       86  | Japanese Envelope Chou #3 Rotated
+//       87  | Japanese Envelope Chou #4 Rotated
+//       88  | B6 (JIS) (128 mm x 182 mm)
+//       89  | B6 (JIS) Rotated (182 mm x 128 mm)
+//       90  | (12 in x 11 in)
+//       91  | Japanese Envelope You #4
+//       92  | Japanese Envelope You #4 Rotated
+//       93  | PRC 16K (146 mm x 215 mm)
+//       94  | PRC 32K (97 mm x 151 mm)
+//       95  | PRC 32K(Big) (97 mm x 151 mm)
+//       96  | PRC Envelope #1 (102 mm x 165 mm)
+//       97  | PRC Envelope #2 (102 mm x 176 mm)
+//       98  | PRC Envelope #3 (125 mm x 176 mm)
+//       99  | PRC Envelope #4 (110 mm x 208 mm)
+//       100 | PRC Envelope #5 (110 mm x 220 mm)
+//       101 | PRC Envelope #6 (120 mm x 230 mm)
+//       102 | PRC Envelope #7 (160 mm x 230 mm)
+//       103 | PRC Envelope #8 (120 mm x 309 mm)
+//       104 | PRC Envelope #9 (229 mm x 324 mm)
+//       105 | PRC Envelope #10 (324 mm x 458 mm)
+//       106 | PRC 16K Rotated
+//       107 | PRC 32K Rotated
+//       108 | PRC 32K(Big) Rotated
+//       109 | PRC Envelope #1 Rotated (165 mm x 102 mm)
+//       110 | PRC Envelope #2 Rotated (176 mm x 102 mm)
+//       111 | PRC Envelope #3 Rotated (176 mm x 125 mm)
+//       112 | PRC Envelope #4 Rotated (208 mm x 110 mm)
+//       113 | PRC Envelope #5 Rotated (220 mm x 110 mm)
+//       114 | PRC Envelope #6 Rotated (230 mm x 120 mm)
+//       115 | PRC Envelope #7 Rotated (230 mm x 160 mm)
+//       116 | PRC Envelope #8 Rotated (309 mm x 120 mm)
+//       117 | PRC Envelope #9 Rotated (324 mm x 229 mm)
+//       118 | PRC Envelope #10 Rotated (458 mm x 324 mm)
+//
+func (f *File) SetPageLayout(sheet string, opts ...PageLayoutOption) error {
+	s, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	ps := s.PageSetUp
+	if ps == nil {
+		ps = new(xlsxPageSetUp)
+		s.PageSetUp = ps
+	}
+
+	for _, opt := range opts {
+		opt.setPageLayout(ps)
+	}
+	return err
+}
+
+// GetPageLayout provides a function to gets worksheet page layout.
+//
+// Available options:
+//   PageLayoutOrientation(string)
+//   PageLayoutPaperSize(int)
+//   FitToHeight(int)
+//   FitToWidth(int)
+func (f *File) GetPageLayout(sheet string, opts ...PageLayoutOptionPtr) error {
+	s, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	ps := s.PageSetUp
+
+	for _, opt := range opts {
+		opt.getPageLayout(ps)
+	}
+	return err
+}
+
+// SetDefinedName provides a function to set the defined names of the workbook
+// or worksheet. If not specified scope, the default scope is workbook.
+// For example:
+//
+//    f.SetDefinedName(&excelize.DefinedName{
+//        Name:     "Amount",
+//        RefersTo: "Sheet1!$A$2:$D$5",
+//        Comment:  "defined name comment",
+//        Scope:    "Sheet2",
+//    })
+//
+func (f *File) SetDefinedName(definedName *DefinedName) error {
+	wb := f.workbookReader()
+	d := xlsxDefinedName{
+		Name:    definedName.Name,
+		Comment: definedName.Comment,
+		Data:    definedName.RefersTo,
+	}
+	if definedName.Scope != "" {
+		if sheetID := f.getSheetID(definedName.Scope); sheetID != 0 {
+			sheetID--
+			d.LocalSheetID = &sheetID
+		}
+	}
+	if wb.DefinedNames != nil {
+		for _, dn := range wb.DefinedNames.DefinedName {
+			var scope string
+			if dn.LocalSheetID != nil {
+				scope = f.getSheetNameByID(*dn.LocalSheetID + 1)
+			}
+			if scope == definedName.Scope && dn.Name == definedName.Name {
+				return errors.New("the same name already exists on the scope")
+			}
+		}
+		wb.DefinedNames.DefinedName = append(wb.DefinedNames.DefinedName, d)
+		return nil
+	}
+	wb.DefinedNames = &xlsxDefinedNames{
+		DefinedName: []xlsxDefinedName{d},
+	}
+	return nil
+}
+
+// DeleteDefinedName provides a function to delete the defined names of the
+// workbook or worksheet. If not specified scope, the default scope is
+// workbook. For example:
+//
+//    f.DeleteDefinedName(&excelize.DefinedName{
+//        Name:     "Amount",
+//        Scope:    "Sheet2",
+//    })
+//
+func (f *File) DeleteDefinedName(definedName *DefinedName) error {
+	wb := f.workbookReader()
+	if wb.DefinedNames != nil {
+		for idx, dn := range wb.DefinedNames.DefinedName {
+			var scope string
+			if dn.LocalSheetID != nil {
+				scope = f.getSheetNameByID(*dn.LocalSheetID + 1)
+			}
+			if scope == definedName.Scope && dn.Name == definedName.Name {
+				wb.DefinedNames.DefinedName = append(wb.DefinedNames.DefinedName[:idx], wb.DefinedNames.DefinedName[idx+1:]...)
+				return nil
+			}
+		}
+	}
+	return errors.New("no defined name on the scope")
+}
+
+// GetDefinedName provides a function to get the defined names of the workbook
+// or worksheet.
+func (f *File) GetDefinedName() []DefinedName {
+	var definedNames []DefinedName
+	wb := f.workbookReader()
+	if wb.DefinedNames != nil {
+		for _, dn := range wb.DefinedNames.DefinedName {
+			definedName := DefinedName{
+				Name:     dn.Name,
+				Comment:  dn.Comment,
+				RefersTo: dn.Data,
+				Scope:    "Workbook",
+			}
+			if dn.LocalSheetID != nil && *dn.LocalSheetID >= 0 {
+				definedName.Scope = f.getSheetNameByID(*dn.LocalSheetID + 1)
+			}
+			definedNames = append(definedNames, definedName)
+		}
+	}
+	return definedNames
+}
+
+// GroupSheets provides a function to group worksheets by given worksheets
+// name. Group worksheets must contain an active worksheet.
+func (f *File) GroupSheets(sheets []string) error {
+	// check an active worksheet in group worksheets
+	var inActiveSheet bool
+	activeSheet := f.GetActiveSheetIndex()
+	sheetMap := f.GetSheetList()
+	for idx, sheetName := range sheetMap {
+		for _, s := range sheets {
+			if s == sheetName && idx == activeSheet {
+				inActiveSheet = true
+			}
+		}
+	}
+	if !inActiveSheet {
+		return errors.New("group worksheet must contain an active worksheet")
+	}
+	// check worksheet exists
+	ws := []*xlsxWorksheet{}
+	for _, sheet := range sheets {
+		xlsx, err := f.workSheetReader(sheet)
+		if err != nil {
+			return err
+		}
+		ws = append(ws, xlsx)
+	}
+	for _, s := range ws {
+		sheetViews := s.SheetViews.SheetView
+		if len(sheetViews) > 0 {
+			for idx := range sheetViews {
+				s.SheetViews.SheetView[idx].TabSelected = true
+			}
+			continue
+		}
+	}
+	return nil
+}
+
+// UngroupSheets provides a function to ungroup worksheets.
+func (f *File) UngroupSheets() error {
+	activeSheet := f.GetActiveSheetIndex()
+	for index, sheet := range f.GetSheetList() {
+		if activeSheet == index {
+			continue
+		}
+		ws, _ := f.workSheetReader(sheet)
+		sheetViews := ws.SheetViews.SheetView
+		if len(sheetViews) > 0 {
+			for idx := range sheetViews {
+				ws.SheetViews.SheetView[idx].TabSelected = false
+			}
+		}
+	}
+	return nil
+}
+
+// InsertPageBreak create a page break to determine where the printed page
+// ends and where begins the next one by given worksheet name and axis, so the
+// content before the page break will be printed on one page and after the
+// page break on another.
+func (f *File) InsertPageBreak(sheet, cell string) (err error) {
+	var ws *xlsxWorksheet
+	var row, col int
+	var rowBrk, colBrk = -1, -1
+	if ws, err = f.workSheetReader(sheet); err != nil {
+		return
+	}
+	if col, row, err = CellNameToCoordinates(cell); err != nil {
+		return
+	}
+	col--
+	row--
+	if col == row && col == 0 {
+		return
+	}
+	if ws.RowBreaks == nil {
+		ws.RowBreaks = &xlsxBreaks{}
+	}
+	if ws.ColBreaks == nil {
+		ws.ColBreaks = &xlsxBreaks{}
+	}
+
+	for idx, brk := range ws.RowBreaks.Brk {
+		if brk.ID == row {
+			rowBrk = idx
+		}
+	}
+	for idx, brk := range ws.ColBreaks.Brk {
+		if brk.ID == col {
+			colBrk = idx
+		}
+	}
+
+	if row != 0 && rowBrk == -1 {
+		ws.RowBreaks.Brk = append(ws.RowBreaks.Brk, &xlsxBrk{
+			ID:  row,
+			Max: 16383,
+			Man: true,
+		})
+		ws.RowBreaks.ManualBreakCount++
+	}
+	if col != 0 && colBrk == -1 {
+		ws.ColBreaks.Brk = append(ws.ColBreaks.Brk, &xlsxBrk{
+			ID:  col,
+			Max: 1048575,
+			Man: true,
+		})
+		ws.ColBreaks.ManualBreakCount++
+	}
+	ws.RowBreaks.Count = len(ws.RowBreaks.Brk)
+	ws.ColBreaks.Count = len(ws.ColBreaks.Brk)
+	return
+}
+
+// RemovePageBreak remove a page break by given worksheet name and axis.
+func (f *File) RemovePageBreak(sheet, cell string) (err error) {
+	var ws *xlsxWorksheet
+	var row, col int
+	if ws, err = f.workSheetReader(sheet); err != nil {
+		return
+	}
+	if col, row, err = CellNameToCoordinates(cell); err != nil {
+		return
+	}
+	col--
+	row--
+	if col == row && col == 0 {
+		return
+	}
+	removeBrk := func(ID int, brks []*xlsxBrk) []*xlsxBrk {
+		for i, brk := range brks {
+			if brk.ID == ID {
+				brks = append(brks[:i], brks[i+1:]...)
+			}
+		}
+		return brks
+	}
+	if ws.RowBreaks == nil || ws.ColBreaks == nil {
+		return
+	}
+	rowBrks := len(ws.RowBreaks.Brk)
+	colBrks := len(ws.ColBreaks.Brk)
+	if rowBrks > 0 && rowBrks == colBrks {
+		ws.RowBreaks.Brk = removeBrk(row, ws.RowBreaks.Brk)
+		ws.ColBreaks.Brk = removeBrk(col, ws.ColBreaks.Brk)
+		ws.RowBreaks.Count = len(ws.RowBreaks.Brk)
+		ws.ColBreaks.Count = len(ws.ColBreaks.Brk)
+		ws.RowBreaks.ManualBreakCount--
+		ws.ColBreaks.ManualBreakCount--
+		return
+	}
+	if rowBrks > 0 && rowBrks > colBrks {
+		ws.RowBreaks.Brk = removeBrk(row, ws.RowBreaks.Brk)
+		ws.RowBreaks.Count = len(ws.RowBreaks.Brk)
+		ws.RowBreaks.ManualBreakCount--
+		return
+	}
+	if colBrks > 0 && colBrks > rowBrks {
+		ws.ColBreaks.Brk = removeBrk(col, ws.ColBreaks.Brk)
+		ws.ColBreaks.Count = len(ws.ColBreaks.Brk)
+		ws.ColBreaks.ManualBreakCount--
+	}
+	return
+}
+
+// relsReader provides a function to get the pointer to the structure
+// after deserialization of xl/worksheets/_rels/sheet%d.xml.rels.
+func (f *File) relsReader(path string) *xlsxRelationships {
+	var err error
+
+	if f.Relationships[path] == nil {
+		_, ok := f.XLSX[path]
+		if ok {
+			c := xlsxRelationships{}
+			if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML(path)))).
+				Decode(&c); err != nil && err != io.EOF {
+				log.Printf("xml decode error: %s", err)
+			}
+			f.Relationships[path] = &c
+		}
+	}
+
+	return f.Relationships[path]
+}
+
+// fillSheetData ensures there are enough rows, and columns in the chosen
+// row to accept data. Missing rows are backfilled and given their row number
+// Uses the last populated row as a hint for the size of the next row to add
+func prepareSheetXML(xlsx *xlsxWorksheet, col int, row int) {
+	rowCount := len(xlsx.SheetData.Row)
+	sizeHint := 0
+	if rowCount > 0 {
+		sizeHint = len(xlsx.SheetData.Row[rowCount-1].C)
+	}
+	if rowCount < row {
+		// append missing rows
+		for rowIdx := rowCount; rowIdx < row; rowIdx++ {
+			xlsx.SheetData.Row = append(xlsx.SheetData.Row, xlsxRow{R: rowIdx + 1, C: make([]xlsxC, 0, sizeHint)})
+		}
+	}
+	rowData := &xlsx.SheetData.Row[row-1]
+	fillColumns(rowData, col, row)
+}
+
+func fillColumns(rowData *xlsxRow, col, row int) {
+	cellCount := len(rowData.C)
+	if cellCount < col {
+		for colIdx := cellCount; colIdx < col; colIdx++ {
+			cellName, _ := CoordinatesToCellName(colIdx+1, row)
+			rowData.C = append(rowData.C, xlsxC{R: cellName})
+		}
+	}
+}
+
+func makeContiguousColumns(xlsx *xlsxWorksheet, fromRow, toRow, colCount int) {
+	for ; fromRow < toRow; fromRow++ {
+		rowData := &xlsx.SheetData.Row[fromRow-1]
+		fillColumns(rowData, colCount, fromRow)
+	}
+}

+ 554 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/sheetpr.go

@@ -0,0 +1,554 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+// SheetPrOption is an option of a view of a worksheet. See SetSheetPrOptions().
+type SheetPrOption interface {
+	setSheetPrOption(view *xlsxSheetPr)
+}
+
+// SheetPrOptionPtr is a writable SheetPrOption. See GetSheetPrOptions().
+type SheetPrOptionPtr interface {
+	SheetPrOption
+	getSheetPrOption(view *xlsxSheetPr)
+}
+
+type (
+	// CodeName is a SheetPrOption
+	CodeName string
+	// EnableFormatConditionsCalculation is a SheetPrOption
+	EnableFormatConditionsCalculation bool
+	// Published is a SheetPrOption
+	Published bool
+	// FitToPage is a SheetPrOption
+	FitToPage bool
+	// AutoPageBreaks is a SheetPrOption
+	AutoPageBreaks bool
+	// OutlineSummaryBelow is an outlinePr, within SheetPr option
+	OutlineSummaryBelow bool
+)
+
+// setSheetPrOption implements the SheetPrOption interface.
+func (o OutlineSummaryBelow) setSheetPrOption(pr *xlsxSheetPr) {
+	if pr.OutlinePr == nil {
+		pr.OutlinePr = new(xlsxOutlinePr)
+	}
+	pr.OutlinePr.SummaryBelow = bool(o)
+}
+
+// getSheetPrOption implements the SheetPrOptionPtr interface.
+func (o *OutlineSummaryBelow) getSheetPrOption(pr *xlsxSheetPr) {
+	// Excel default: true
+	if pr == nil || pr.OutlinePr == nil {
+		*o = true
+		return
+	}
+	*o = OutlineSummaryBelow(defaultTrue(&pr.OutlinePr.SummaryBelow))
+}
+
+// setSheetPrOption implements the SheetPrOption interface and specifies a
+// stable name of the sheet.
+func (o CodeName) setSheetPrOption(pr *xlsxSheetPr) {
+	pr.CodeName = string(o)
+}
+
+// getSheetPrOption implements the SheetPrOptionPtr interface and get the
+// stable name of the sheet.
+func (o *CodeName) getSheetPrOption(pr *xlsxSheetPr) {
+	if pr == nil {
+		*o = ""
+		return
+	}
+	*o = CodeName(pr.CodeName)
+}
+
+// setSheetPrOption implements the SheetPrOption interface and flag indicating
+// whether the conditional formatting calculations shall be evaluated.
+func (o EnableFormatConditionsCalculation) setSheetPrOption(pr *xlsxSheetPr) {
+	pr.EnableFormatConditionsCalculation = boolPtr(bool(o))
+}
+
+// getSheetPrOption implements the SheetPrOptionPtr interface and get the
+// settings of whether the conditional formatting calculations shall be
+// evaluated.
+func (o *EnableFormatConditionsCalculation) getSheetPrOption(pr *xlsxSheetPr) {
+	if pr == nil {
+		*o = true
+		return
+	}
+	*o = EnableFormatConditionsCalculation(defaultTrue(pr.EnableFormatConditionsCalculation))
+}
+
+// setSheetPrOption implements the SheetPrOption interface and flag indicating
+// whether the worksheet is published.
+func (o Published) setSheetPrOption(pr *xlsxSheetPr) {
+	pr.Published = boolPtr(bool(o))
+}
+
+// getSheetPrOption implements the SheetPrOptionPtr interface and get the
+// settings of whether the worksheet is published.
+func (o *Published) getSheetPrOption(pr *xlsxSheetPr) {
+	if pr == nil {
+		*o = true
+		return
+	}
+	*o = Published(defaultTrue(pr.Published))
+}
+
+// setSheetPrOption implements the SheetPrOption interface.
+func (o FitToPage) setSheetPrOption(pr *xlsxSheetPr) {
+	if pr.PageSetUpPr == nil {
+		if !o {
+			return
+		}
+		pr.PageSetUpPr = new(xlsxPageSetUpPr)
+	}
+	pr.PageSetUpPr.FitToPage = bool(o)
+}
+
+// getSheetPrOption implements the SheetPrOptionPtr interface.
+func (o *FitToPage) getSheetPrOption(pr *xlsxSheetPr) {
+	// Excel default: false
+	if pr == nil || pr.PageSetUpPr == nil {
+		*o = false
+		return
+	}
+	*o = FitToPage(pr.PageSetUpPr.FitToPage)
+}
+
+// setSheetPrOption implements the SheetPrOption interface.
+func (o AutoPageBreaks) setSheetPrOption(pr *xlsxSheetPr) {
+	if pr.PageSetUpPr == nil {
+		if !o {
+			return
+		}
+		pr.PageSetUpPr = new(xlsxPageSetUpPr)
+	}
+	pr.PageSetUpPr.AutoPageBreaks = bool(o)
+}
+
+// getSheetPrOption implements the SheetPrOptionPtr interface.
+func (o *AutoPageBreaks) getSheetPrOption(pr *xlsxSheetPr) {
+	// Excel default: false
+	if pr == nil || pr.PageSetUpPr == nil {
+		*o = false
+		return
+	}
+	*o = AutoPageBreaks(pr.PageSetUpPr.AutoPageBreaks)
+}
+
+// SetSheetPrOptions provides a function to sets worksheet properties.
+//
+// Available options:
+//   CodeName(string)
+//   EnableFormatConditionsCalculation(bool)
+//   Published(bool)
+//   FitToPage(bool)
+//   AutoPageBreaks(bool)
+//   OutlineSummaryBelow(bool)
+func (f *File) SetSheetPrOptions(name string, opts ...SheetPrOption) error {
+	sheet, err := f.workSheetReader(name)
+	if err != nil {
+		return err
+	}
+	pr := sheet.SheetPr
+	if pr == nil {
+		pr = new(xlsxSheetPr)
+		sheet.SheetPr = pr
+	}
+
+	for _, opt := range opts {
+		opt.setSheetPrOption(pr)
+	}
+	return err
+}
+
+// GetSheetPrOptions provides a function to gets worksheet properties.
+//
+// Available options:
+//   CodeName(string)
+//   EnableFormatConditionsCalculation(bool)
+//   Published(bool)
+//   FitToPage(bool)
+//   AutoPageBreaks(bool)
+//   OutlineSummaryBelow(bool)
+func (f *File) GetSheetPrOptions(name string, opts ...SheetPrOptionPtr) error {
+	sheet, err := f.workSheetReader(name)
+	if err != nil {
+		return err
+	}
+	pr := sheet.SheetPr
+
+	for _, opt := range opts {
+		opt.getSheetPrOption(pr)
+	}
+	return err
+}
+
+type (
+	// PageMarginBottom specifies the bottom margin for the page.
+	PageMarginBottom float64
+	// PageMarginFooter specifies the footer margin for the page.
+	PageMarginFooter float64
+	// PageMarginHeader specifies the header margin for the page.
+	PageMarginHeader float64
+	// PageMarginLeft specifies the left margin for the page.
+	PageMarginLeft float64
+	// PageMarginRight specifies the right margin for the page.
+	PageMarginRight float64
+	// PageMarginTop specifies the top margin for the page.
+	PageMarginTop float64
+)
+
+// setPageMargins provides a method to set the bottom margin for the worksheet.
+func (p PageMarginBottom) setPageMargins(pm *xlsxPageMargins) {
+	pm.Bottom = float64(p)
+}
+
+// setPageMargins provides a method to get the bottom margin for the worksheet.
+func (p *PageMarginBottom) getPageMargins(pm *xlsxPageMargins) {
+	// Excel default: 0.75
+	if pm == nil || pm.Bottom == 0 {
+		*p = 0.75
+		return
+	}
+	*p = PageMarginBottom(pm.Bottom)
+}
+
+// setPageMargins provides a method to set the footer margin for the worksheet.
+func (p PageMarginFooter) setPageMargins(pm *xlsxPageMargins) {
+	pm.Footer = float64(p)
+}
+
+// setPageMargins provides a method to get the footer margin for the worksheet.
+func (p *PageMarginFooter) getPageMargins(pm *xlsxPageMargins) {
+	// Excel default: 0.3
+	if pm == nil || pm.Footer == 0 {
+		*p = 0.3
+		return
+	}
+	*p = PageMarginFooter(pm.Footer)
+}
+
+// setPageMargins provides a method to set the header margin for the worksheet.
+func (p PageMarginHeader) setPageMargins(pm *xlsxPageMargins) {
+	pm.Header = float64(p)
+}
+
+// setPageMargins provides a method to get the header margin for the worksheet.
+func (p *PageMarginHeader) getPageMargins(pm *xlsxPageMargins) {
+	// Excel default: 0.3
+	if pm == nil || pm.Header == 0 {
+		*p = 0.3
+		return
+	}
+	*p = PageMarginHeader(pm.Header)
+}
+
+// setPageMargins provides a method to set the left margin for the worksheet.
+func (p PageMarginLeft) setPageMargins(pm *xlsxPageMargins) {
+	pm.Left = float64(p)
+}
+
+// setPageMargins provides a method to get the left margin for the worksheet.
+func (p *PageMarginLeft) getPageMargins(pm *xlsxPageMargins) {
+	// Excel default: 0.7
+	if pm == nil || pm.Left == 0 {
+		*p = 0.7
+		return
+	}
+	*p = PageMarginLeft(pm.Left)
+}
+
+// setPageMargins provides a method to set the right margin for the worksheet.
+func (p PageMarginRight) setPageMargins(pm *xlsxPageMargins) {
+	pm.Right = float64(p)
+}
+
+// setPageMargins provides a method to get the right margin for the worksheet.
+func (p *PageMarginRight) getPageMargins(pm *xlsxPageMargins) {
+	// Excel default: 0.7
+	if pm == nil || pm.Right == 0 {
+		*p = 0.7
+		return
+	}
+	*p = PageMarginRight(pm.Right)
+}
+
+// setPageMargins provides a method to set the top margin for the worksheet.
+func (p PageMarginTop) setPageMargins(pm *xlsxPageMargins) {
+	pm.Top = float64(p)
+}
+
+// setPageMargins provides a method to get the top margin for the worksheet.
+func (p *PageMarginTop) getPageMargins(pm *xlsxPageMargins) {
+	// Excel default: 0.75
+	if pm == nil || pm.Top == 0 {
+		*p = 0.75
+		return
+	}
+	*p = PageMarginTop(pm.Top)
+}
+
+// PageMarginsOptions is an option of a page margin of a worksheet. See
+// SetPageMargins().
+type PageMarginsOptions interface {
+	setPageMargins(layout *xlsxPageMargins)
+}
+
+// PageMarginsOptionsPtr is a writable PageMarginsOptions. See
+// GetPageMargins().
+type PageMarginsOptionsPtr interface {
+	PageMarginsOptions
+	getPageMargins(layout *xlsxPageMargins)
+}
+
+// SetPageMargins provides a function to set worksheet page margins.
+//
+// Available options:
+//   PageMarginBottom(float64)
+//   PageMarginFooter(float64)
+//   PageMarginHeader(float64)
+//   PageMarginLeft(float64)
+//   PageMarginRight(float64)
+//   PageMarginTop(float64)
+func (f *File) SetPageMargins(sheet string, opts ...PageMarginsOptions) error {
+	s, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	pm := s.PageMargins
+	if pm == nil {
+		pm = new(xlsxPageMargins)
+		s.PageMargins = pm
+	}
+
+	for _, opt := range opts {
+		opt.setPageMargins(pm)
+	}
+	return err
+}
+
+// GetPageMargins provides a function to get worksheet page margins.
+//
+// Available options:
+//   PageMarginBottom(float64)
+//   PageMarginFooter(float64)
+//   PageMarginHeader(float64)
+//   PageMarginLeft(float64)
+//   PageMarginRight(float64)
+//   PageMarginTop(float64)
+func (f *File) GetPageMargins(sheet string, opts ...PageMarginsOptionsPtr) error {
+	s, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	pm := s.PageMargins
+
+	for _, opt := range opts {
+		opt.getPageMargins(pm)
+	}
+	return err
+}
+
+// SheetFormatPrOptions is an option of the formatting properties of a
+// worksheet. See SetSheetFormatPr().
+type SheetFormatPrOptions interface {
+	setSheetFormatPr(formatPr *xlsxSheetFormatPr)
+}
+
+// SheetFormatPrOptionsPtr is a writable SheetFormatPrOptions. See
+// GetSheetFormatPr().
+type SheetFormatPrOptionsPtr interface {
+	SheetFormatPrOptions
+	getSheetFormatPr(formatPr *xlsxSheetFormatPr)
+}
+
+type (
+	// BaseColWidth specifies the number of characters of the maximum digit width
+	// of the normal style's font. This value does not include margin padding or
+	// extra padding for gridlines. It is only the number of characters.
+	BaseColWidth uint8
+	// DefaultColWidth specifies the default column width measured as the number
+	// of characters of the maximum digit width of the normal style's font.
+	DefaultColWidth float64
+	// DefaultRowHeight specifies the default row height measured in point size.
+	// Optimization so we don't have to write the height on all rows. This can be
+	// written out if most rows have custom height, to achieve the optimization.
+	DefaultRowHeight float64
+	// CustomHeight specifies the custom height.
+	CustomHeight bool
+	// ZeroHeight specifies if rows are hidden.
+	ZeroHeight bool
+	// ThickTop specifies if rows have a thick top border by default.
+	ThickTop bool
+	// ThickBottom specifies if rows have a thick bottom border by default.
+	ThickBottom bool
+)
+
+// setSheetFormatPr provides a method to set the number of characters of the
+// maximum digit width of the normal style's font.
+func (p BaseColWidth) setSheetFormatPr(fp *xlsxSheetFormatPr) {
+	fp.BaseColWidth = uint8(p)
+}
+
+// setSheetFormatPr provides a method to set the number of characters of the
+// maximum digit width of the normal style's font.
+func (p *BaseColWidth) getSheetFormatPr(fp *xlsxSheetFormatPr) {
+	if fp == nil {
+		*p = 0
+		return
+	}
+	*p = BaseColWidth(fp.BaseColWidth)
+}
+
+// setSheetFormatPr provides a method to set the default column width measured
+// as the number of characters of the maximum digit width of the normal
+// style's font.
+func (p DefaultColWidth) setSheetFormatPr(fp *xlsxSheetFormatPr) {
+	fp.DefaultColWidth = float64(p)
+}
+
+// getSheetFormatPr provides a method to get the default column width measured
+// as the number of characters of the maximum digit width of the normal
+// style's font.
+func (p *DefaultColWidth) getSheetFormatPr(fp *xlsxSheetFormatPr) {
+	if fp == nil {
+		*p = 0
+		return
+	}
+	*p = DefaultColWidth(fp.DefaultColWidth)
+}
+
+// setSheetFormatPr provides a method to set the default row height measured
+// in point size.
+func (p DefaultRowHeight) setSheetFormatPr(fp *xlsxSheetFormatPr) {
+	fp.DefaultRowHeight = float64(p)
+}
+
+// getSheetFormatPr provides a method to get the default row height measured
+// in point size.
+func (p *DefaultRowHeight) getSheetFormatPr(fp *xlsxSheetFormatPr) {
+	if fp == nil {
+		*p = 15
+		return
+	}
+	*p = DefaultRowHeight(fp.DefaultRowHeight)
+}
+
+// setSheetFormatPr provides a method to set the custom height.
+func (p CustomHeight) setSheetFormatPr(fp *xlsxSheetFormatPr) {
+	fp.CustomHeight = bool(p)
+}
+
+// getSheetFormatPr provides a method to get the custom height.
+func (p *CustomHeight) getSheetFormatPr(fp *xlsxSheetFormatPr) {
+	if fp == nil {
+		*p = false
+		return
+	}
+	*p = CustomHeight(fp.CustomHeight)
+}
+
+// setSheetFormatPr provides a method to set if rows are hidden.
+func (p ZeroHeight) setSheetFormatPr(fp *xlsxSheetFormatPr) {
+	fp.ZeroHeight = bool(p)
+}
+
+// getSheetFormatPr provides a method to get if rows are hidden.
+func (p *ZeroHeight) getSheetFormatPr(fp *xlsxSheetFormatPr) {
+	if fp == nil {
+		*p = false
+		return
+	}
+	*p = ZeroHeight(fp.ZeroHeight)
+}
+
+// setSheetFormatPr provides a method to set if rows have a thick top border
+// by default.
+func (p ThickTop) setSheetFormatPr(fp *xlsxSheetFormatPr) {
+	fp.ThickTop = bool(p)
+}
+
+// getSheetFormatPr provides a method to get if rows have a thick top border
+// by default.
+func (p *ThickTop) getSheetFormatPr(fp *xlsxSheetFormatPr) {
+	if fp == nil {
+		*p = false
+		return
+	}
+	*p = ThickTop(fp.ThickTop)
+}
+
+// setSheetFormatPr provides a method to set if rows have a thick bottom
+// border by default.
+func (p ThickBottom) setSheetFormatPr(fp *xlsxSheetFormatPr) {
+	fp.ThickBottom = bool(p)
+}
+
+// setSheetFormatPr provides a method to set if rows have a thick bottom
+// border by default.
+func (p *ThickBottom) getSheetFormatPr(fp *xlsxSheetFormatPr) {
+	if fp == nil {
+		*p = false
+		return
+	}
+	*p = ThickBottom(fp.ThickBottom)
+}
+
+// SetSheetFormatPr provides a function to set worksheet formatting properties.
+//
+// Available options:
+//   BaseColWidth(uint8)
+//   DefaultColWidth(float64)
+//   DefaultRowHeight(float64)
+//   CustomHeight(bool)
+//   ZeroHeight(bool)
+//   ThickTop(bool)
+//   ThickBottom(bool)
+func (f *File) SetSheetFormatPr(sheet string, opts ...SheetFormatPrOptions) error {
+	s, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	fp := s.SheetFormatPr
+	if fp == nil {
+		fp = new(xlsxSheetFormatPr)
+		s.SheetFormatPr = fp
+	}
+	for _, opt := range opts {
+		opt.setSheetFormatPr(fp)
+	}
+	return err
+}
+
+// GetSheetFormatPr provides a function to get worksheet formatting properties.
+//
+// Available options:
+//   BaseColWidth(uint8)
+//   DefaultColWidth(float64)
+//   DefaultRowHeight(float64)
+//   CustomHeight(bool)
+//   ZeroHeight(bool)
+//   ThickTop(bool)
+//   ThickBottom(bool)
+func (f *File) GetSheetFormatPr(sheet string, opts ...SheetFormatPrOptionsPtr) error {
+	s, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	fp := s.SheetFormatPr
+	for _, opt := range opts {
+		opt.getSheetFormatPr(fp)
+	}
+	return err
+}

+ 217 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/sheetview.go

@@ -0,0 +1,217 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "fmt"
+
+// SheetViewOption is an option of a view of a worksheet. See
+// SetSheetViewOptions().
+type SheetViewOption interface {
+	setSheetViewOption(view *xlsxSheetView)
+}
+
+// SheetViewOptionPtr is a writable SheetViewOption. See
+// GetSheetViewOptions().
+type SheetViewOptionPtr interface {
+	SheetViewOption
+	getSheetViewOption(view *xlsxSheetView)
+}
+
+type (
+	// DefaultGridColor is a SheetViewOption. It specifies a flag indicating that
+	// the consuming application should use the default grid lines color (system
+	// dependent). Overrides any color specified in colorId.
+	DefaultGridColor bool
+	// RightToLeft is a SheetViewOption. It specifies a flag indicating whether
+	// the sheet is in 'right to left' display mode. When in this mode, Column A
+	// is on the far right, Column B ;is one column left of Column A, and so on.
+	// Also, information in cells is displayed in the Right to Left format.
+	RightToLeft bool
+	// ShowFormulas is a SheetViewOption. It specifies a flag indicating whether
+	// this sheet should display formulas.
+	ShowFormulas bool
+	// ShowGridLines is a SheetViewOption. It specifies a flag indicating whether
+	// this sheet should display gridlines.
+	ShowGridLines bool
+	// ShowRowColHeaders is a SheetViewOption. It specifies a flag indicating
+	// whether the sheet should display row and column headings.
+	ShowRowColHeaders bool
+	// ZoomScale is a SheetViewOption. It specifies a window zoom magnification
+	// for current view representing percent values. This attribute is restricted
+	// to values ranging from 10 to 400. Horizontal & Vertical scale together.
+	ZoomScale float64
+	// TopLeftCell is a SheetViewOption. It specifies a location of the top left
+	// visible cell Location of the top left visible cell in the bottom right
+	// pane (when in Left-to-Right mode).
+	TopLeftCell string
+	// ShowZeros is a SheetViewOption. It specifies a flag indicating
+	// whether to "show a zero in cells that have zero value".
+	// When using a formula to reference another cell which is empty, the referenced value becomes 0
+	// when the flag is true. (Default setting is true.)
+	ShowZeros bool
+
+	/* TODO
+	// ShowWhiteSpace is a SheetViewOption. It specifies a flag indicating
+	// whether page layout view shall display margins. False means do not display
+	// left, right, top (header), and bottom (footer) margins (even when there is
+	// data in the header or footer).
+	ShowWhiteSpace bool
+	// WindowProtection is a SheetViewOption.
+	WindowProtection bool
+	*/
+)
+
+// Defaults for each option are described in XML schema for CT_SheetView
+
+func (o TopLeftCell) setSheetViewOption(view *xlsxSheetView) {
+	view.TopLeftCell = string(o)
+}
+
+func (o *TopLeftCell) getSheetViewOption(view *xlsxSheetView) {
+	*o = TopLeftCell(string(view.TopLeftCell))
+}
+
+func (o DefaultGridColor) setSheetViewOption(view *xlsxSheetView) {
+	view.DefaultGridColor = boolPtr(bool(o))
+}
+
+func (o *DefaultGridColor) getSheetViewOption(view *xlsxSheetView) {
+	*o = DefaultGridColor(defaultTrue(view.DefaultGridColor)) // Excel default: true
+}
+
+func (o RightToLeft) setSheetViewOption(view *xlsxSheetView) {
+	view.RightToLeft = bool(o) // Excel default: false
+}
+
+func (o *RightToLeft) getSheetViewOption(view *xlsxSheetView) {
+	*o = RightToLeft(view.RightToLeft)
+}
+
+func (o ShowFormulas) setSheetViewOption(view *xlsxSheetView) {
+	view.ShowFormulas = bool(o) // Excel default: false
+}
+
+func (o *ShowFormulas) getSheetViewOption(view *xlsxSheetView) {
+	*o = ShowFormulas(view.ShowFormulas) // Excel default: false
+}
+
+func (o ShowGridLines) setSheetViewOption(view *xlsxSheetView) {
+	view.ShowGridLines = boolPtr(bool(o))
+}
+
+func (o *ShowGridLines) getSheetViewOption(view *xlsxSheetView) {
+	*o = ShowGridLines(defaultTrue(view.ShowGridLines)) // Excel default: true
+}
+
+func (o ShowZeros) setSheetViewOption(view *xlsxSheetView) {
+	view.ShowZeros = boolPtr(bool(o))
+}
+
+func (o *ShowZeros) getSheetViewOption(view *xlsxSheetView) {
+	*o = ShowZeros(defaultTrue(view.ShowZeros)) // Excel default: true
+}
+
+func (o ShowRowColHeaders) setSheetViewOption(view *xlsxSheetView) {
+	view.ShowRowColHeaders = boolPtr(bool(o))
+}
+
+func (o *ShowRowColHeaders) getSheetViewOption(view *xlsxSheetView) {
+	*o = ShowRowColHeaders(defaultTrue(view.ShowRowColHeaders)) // Excel default: true
+}
+
+func (o ZoomScale) setSheetViewOption(view *xlsxSheetView) {
+	// This attribute is restricted to values ranging from 10 to 400.
+	if float64(o) >= 10 && float64(o) <= 400 {
+		view.ZoomScale = float64(o)
+	}
+}
+
+func (o *ZoomScale) getSheetViewOption(view *xlsxSheetView) {
+	*o = ZoomScale(view.ZoomScale)
+}
+
+// getSheetView returns the SheetView object
+func (f *File) getSheetView(sheetName string, viewIndex int) (*xlsxSheetView, error) {
+	xlsx, err := f.workSheetReader(sheetName)
+	if err != nil {
+		return nil, err
+	}
+	if viewIndex < 0 {
+		if viewIndex < -len(xlsx.SheetViews.SheetView) {
+			return nil, fmt.Errorf("view index %d out of range", viewIndex)
+		}
+		viewIndex = len(xlsx.SheetViews.SheetView) + viewIndex
+	} else if viewIndex >= len(xlsx.SheetViews.SheetView) {
+		return nil, fmt.Errorf("view index %d out of range", viewIndex)
+	}
+
+	return &(xlsx.SheetViews.SheetView[viewIndex]), err
+}
+
+// SetSheetViewOptions sets sheet view options. The viewIndex may be negative
+// and if so is counted backward (-1 is the last view).
+//
+// Available options:
+//
+//    DefaultGridColor(bool)
+//    RightToLeft(bool)
+//    ShowFormulas(bool)
+//    ShowGridLines(bool)
+//    ShowRowColHeaders(bool)
+//    ZoomScale(float64)
+//    TopLeftCell(string)
+//
+// Example:
+//
+//    err = f.SetSheetViewOptions("Sheet1", -1, ShowGridLines(false))
+//
+func (f *File) SetSheetViewOptions(name string, viewIndex int, opts ...SheetViewOption) error {
+	view, err := f.getSheetView(name, viewIndex)
+	if err != nil {
+		return err
+	}
+
+	for _, opt := range opts {
+		opt.setSheetViewOption(view)
+	}
+	return nil
+}
+
+// GetSheetViewOptions gets the value of sheet view options. The viewIndex may
+// be negative and if so is counted backward (-1 is the last view).
+//
+// Available options:
+//
+//    DefaultGridColor(bool)
+//    RightToLeft(bool)
+//    ShowFormulas(bool)
+//    ShowGridLines(bool)
+//    ShowRowColHeaders(bool)
+//    ZoomScale(float64)
+//    TopLeftCell(string)
+//
+// Example:
+//
+//    var showGridLines excelize.ShowGridLines
+//    err = f.GetSheetViewOptions("Sheet1", -1, &showGridLines)
+//
+func (f *File) GetSheetViewOptions(name string, viewIndex int, opts ...SheetViewOptionPtr) error {
+	view, err := f.getSheetView(name, viewIndex)
+	if err != nil {
+		return err
+	}
+
+	for _, opt := range opts {
+		opt.getSheetViewOption(view)
+	}
+	return nil
+}

+ 544 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/sparkline.go

@@ -0,0 +1,544 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"encoding/xml"
+	"errors"
+	"io"
+	"strings"
+)
+
+// addSparklineGroupByStyle provides a function to create x14:sparklineGroups
+// element by given sparkline style ID.
+func (f *File) addSparklineGroupByStyle(ID int) *xlsxX14SparklineGroup {
+	groups := []*xlsxX14SparklineGroup{
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 4, Tint: -0.499984740745262},
+			ColorNegative: &xlsxTabColor{Theme: 5},
+			ColorMarkers:  &xlsxTabColor{Theme: 4, Tint: -0.499984740745262},
+			ColorFirst:    &xlsxTabColor{Theme: 4, Tint: 0.39997558519241921},
+			ColorLast:     &xlsxTabColor{Theme: 4, Tint: 0.39997558519241921},
+			ColorHigh:     &xlsxTabColor{Theme: 4},
+			ColorLow:      &xlsxTabColor{Theme: 4},
+		}, // 0
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 4, Tint: -0.499984740745262},
+			ColorNegative: &xlsxTabColor{Theme: 5},
+			ColorMarkers:  &xlsxTabColor{Theme: 4, Tint: -0.499984740745262},
+			ColorFirst:    &xlsxTabColor{Theme: 4, Tint: 0.39997558519241921},
+			ColorLast:     &xlsxTabColor{Theme: 4, Tint: 0.39997558519241921},
+			ColorHigh:     &xlsxTabColor{Theme: 4},
+			ColorLow:      &xlsxTabColor{Theme: 4},
+		}, // 1
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 5, Tint: -0.499984740745262},
+			ColorNegative: &xlsxTabColor{Theme: 6},
+			ColorMarkers:  &xlsxTabColor{Theme: 5, Tint: -0.499984740745262},
+			ColorFirst:    &xlsxTabColor{Theme: 5, Tint: 0.39997558519241921},
+			ColorLast:     &xlsxTabColor{Theme: 5, Tint: 0.39997558519241921},
+			ColorHigh:     &xlsxTabColor{Theme: 5},
+			ColorLow:      &xlsxTabColor{Theme: 5},
+		}, // 2
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 6, Tint: -0.499984740745262},
+			ColorNegative: &xlsxTabColor{Theme: 7},
+			ColorMarkers:  &xlsxTabColor{Theme: 6, Tint: -0.499984740745262},
+			ColorFirst:    &xlsxTabColor{Theme: 6, Tint: 0.39997558519241921},
+			ColorLast:     &xlsxTabColor{Theme: 6, Tint: 0.39997558519241921},
+			ColorHigh:     &xlsxTabColor{Theme: 6},
+			ColorLow:      &xlsxTabColor{Theme: 6},
+		}, // 3
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 7, Tint: -0.499984740745262},
+			ColorNegative: &xlsxTabColor{Theme: 8},
+			ColorMarkers:  &xlsxTabColor{Theme: 7, Tint: -0.499984740745262},
+			ColorFirst:    &xlsxTabColor{Theme: 7, Tint: 0.39997558519241921},
+			ColorLast:     &xlsxTabColor{Theme: 7, Tint: 0.39997558519241921},
+			ColorHigh:     &xlsxTabColor{Theme: 7},
+			ColorLow:      &xlsxTabColor{Theme: 7},
+		}, // 4
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 8, Tint: -0.499984740745262},
+			ColorNegative: &xlsxTabColor{Theme: 9},
+			ColorMarkers:  &xlsxTabColor{Theme: 8, Tint: -0.499984740745262},
+			ColorFirst:    &xlsxTabColor{Theme: 8, Tint: 0.39997558519241921},
+			ColorLast:     &xlsxTabColor{Theme: 8, Tint: 0.39997558519241921},
+			ColorHigh:     &xlsxTabColor{Theme: 8},
+			ColorLow:      &xlsxTabColor{Theme: 8},
+		}, // 5
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 9, Tint: -0.499984740745262},
+			ColorNegative: &xlsxTabColor{Theme: 4},
+			ColorMarkers:  &xlsxTabColor{Theme: 9, Tint: -0.499984740745262},
+			ColorFirst:    &xlsxTabColor{Theme: 9, Tint: 0.39997558519241921},
+			ColorLast:     &xlsxTabColor{Theme: 9, Tint: 0.39997558519241921},
+			ColorHigh:     &xlsxTabColor{Theme: 9},
+			ColorLow:      &xlsxTabColor{Theme: 9},
+		}, // 6
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 4, Tint: -0.249977111117893},
+			ColorNegative: &xlsxTabColor{Theme: 5},
+			ColorMarkers:  &xlsxTabColor{Theme: 5, Tint: -0.249977111117893},
+			ColorFirst:    &xlsxTabColor{Theme: 5, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 5, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 5},
+			ColorLow:      &xlsxTabColor{Theme: 5},
+		}, // 7
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 5, Tint: -0.249977111117893},
+			ColorNegative: &xlsxTabColor{Theme: 6},
+			ColorMarkers:  &xlsxTabColor{Theme: 6, Tint: -0.249977111117893},
+			ColorFirst:    &xlsxTabColor{Theme: 6, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 6, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 6, Tint: -0.249977111117893},
+			ColorLow:      &xlsxTabColor{Theme: 6, Tint: -0.249977111117893},
+		}, // 8
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 6, Tint: -0.249977111117893},
+			ColorNegative: &xlsxTabColor{Theme: 7},
+			ColorMarkers:  &xlsxTabColor{Theme: 7, Tint: -0.249977111117893},
+			ColorFirst:    &xlsxTabColor{Theme: 7, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 7, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 7, Tint: -0.249977111117893},
+			ColorLow:      &xlsxTabColor{Theme: 7, Tint: -0.249977111117893},
+		}, // 9
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 7, Tint: -0.249977111117893},
+			ColorNegative: &xlsxTabColor{Theme: 8},
+			ColorMarkers:  &xlsxTabColor{Theme: 8, Tint: -0.249977111117893},
+			ColorFirst:    &xlsxTabColor{Theme: 8, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 8, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 8, Tint: -0.249977111117893},
+			ColorLow:      &xlsxTabColor{Theme: 8, Tint: -0.249977111117893},
+		}, // 10
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 8, Tint: -0.249977111117893},
+			ColorNegative: &xlsxTabColor{Theme: 9},
+			ColorMarkers:  &xlsxTabColor{Theme: 9, Tint: -0.249977111117893},
+			ColorFirst:    &xlsxTabColor{Theme: 9, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 9, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 9, Tint: -0.249977111117893},
+			ColorLow:      &xlsxTabColor{Theme: 9, Tint: -0.249977111117893},
+		}, // 11
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 9, Tint: -0.249977111117893},
+			ColorNegative: &xlsxTabColor{Theme: 4},
+			ColorMarkers:  &xlsxTabColor{Theme: 4, Tint: -0.249977111117893},
+			ColorFirst:    &xlsxTabColor{Theme: 4, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 4, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 4, Tint: -0.249977111117893},
+			ColorLow:      &xlsxTabColor{Theme: 4, Tint: -0.249977111117893},
+		}, // 12
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 4},
+			ColorNegative: &xlsxTabColor{Theme: 5},
+			ColorMarkers:  &xlsxTabColor{Theme: 4, Tint: -0.249977111117893},
+			ColorFirst:    &xlsxTabColor{Theme: 4, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 4, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 4, Tint: -0.249977111117893},
+			ColorLow:      &xlsxTabColor{Theme: 4, Tint: -0.249977111117893},
+		}, // 13
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 5},
+			ColorNegative: &xlsxTabColor{Theme: 6},
+			ColorMarkers:  &xlsxTabColor{Theme: 5, Tint: -0.249977111117893},
+			ColorFirst:    &xlsxTabColor{Theme: 5, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 5, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 5, Tint: -0.249977111117893},
+			ColorLow:      &xlsxTabColor{Theme: 5, Tint: -0.249977111117893},
+		}, // 14
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 6},
+			ColorNegative: &xlsxTabColor{Theme: 7},
+			ColorMarkers:  &xlsxTabColor{Theme: 6, Tint: -0.249977111117893},
+			ColorFirst:    &xlsxTabColor{Theme: 6, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 6, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 6, Tint: -0.249977111117893},
+			ColorLow:      &xlsxTabColor{Theme: 6, Tint: -0.249977111117893},
+		}, // 15
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 7},
+			ColorNegative: &xlsxTabColor{Theme: 8},
+			ColorMarkers:  &xlsxTabColor{Theme: 7, Tint: -0.249977111117893},
+			ColorFirst:    &xlsxTabColor{Theme: 7, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 7, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 7, Tint: -0.249977111117893},
+			ColorLow:      &xlsxTabColor{Theme: 7, Tint: -0.249977111117893},
+		}, // 16
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 8},
+			ColorNegative: &xlsxTabColor{Theme: 9},
+			ColorMarkers:  &xlsxTabColor{Theme: 8, Tint: -0.249977111117893},
+			ColorFirst:    &xlsxTabColor{Theme: 8, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 8, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 8, Tint: -0.249977111117893},
+			ColorLow:      &xlsxTabColor{Theme: 8, Tint: -0.249977111117893},
+		}, // 17
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 9},
+			ColorNegative: &xlsxTabColor{Theme: 4},
+			ColorMarkers:  &xlsxTabColor{Theme: 9, Tint: -0.249977111117893},
+			ColorFirst:    &xlsxTabColor{Theme: 9, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 9, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 9, Tint: -0.249977111117893},
+			ColorLow:      &xlsxTabColor{Theme: 9, Tint: -0.249977111117893},
+		}, // 18
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 4, Tint: 0.39997558519241921},
+			ColorNegative: &xlsxTabColor{Theme: 0, Tint: -0.499984740745262},
+			ColorMarkers:  &xlsxTabColor{Theme: 4, Tint: 0.79998168889431442},
+			ColorFirst:    &xlsxTabColor{Theme: 4, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 4, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 4, Tint: -0.499984740745262},
+			ColorLow:      &xlsxTabColor{Theme: 4, Tint: -0.499984740745262},
+		}, // 19
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 5, Tint: 0.39997558519241921},
+			ColorNegative: &xlsxTabColor{Theme: 0, Tint: -0.499984740745262},
+			ColorMarkers:  &xlsxTabColor{Theme: 5, Tint: 0.79998168889431442},
+			ColorFirst:    &xlsxTabColor{Theme: 5, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 5, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 5, Tint: -0.499984740745262},
+			ColorLow:      &xlsxTabColor{Theme: 5, Tint: -0.499984740745262},
+		}, // 20
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 6, Tint: 0.39997558519241921},
+			ColorNegative: &xlsxTabColor{Theme: 0, Tint: -0.499984740745262},
+			ColorMarkers:  &xlsxTabColor{Theme: 6, Tint: 0.79998168889431442},
+			ColorFirst:    &xlsxTabColor{Theme: 6, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 6, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 6, Tint: -0.499984740745262},
+			ColorLow:      &xlsxTabColor{Theme: 6, Tint: -0.499984740745262},
+		}, // 21
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 7, Tint: 0.39997558519241921},
+			ColorNegative: &xlsxTabColor{Theme: 0, Tint: -0.499984740745262},
+			ColorMarkers:  &xlsxTabColor{Theme: 7, Tint: 0.79998168889431442},
+			ColorFirst:    &xlsxTabColor{Theme: 7, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 7, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 7, Tint: -0.499984740745262},
+			ColorLow:      &xlsxTabColor{Theme: 7, Tint: -0.499984740745262},
+		}, // 22
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 8, Tint: 0.39997558519241921},
+			ColorNegative: &xlsxTabColor{Theme: 0, Tint: -0.499984740745262},
+			ColorMarkers:  &xlsxTabColor{Theme: 8, Tint: 0.79998168889431442},
+			ColorFirst:    &xlsxTabColor{Theme: 8, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 8, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 8, Tint: -0.499984740745262},
+			ColorLow:      &xlsxTabColor{Theme: 8, Tint: -0.499984740745262},
+		}, // 23
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 9, Tint: 0.39997558519241921},
+			ColorNegative: &xlsxTabColor{Theme: 0, Tint: -0.499984740745262},
+			ColorMarkers:  &xlsxTabColor{Theme: 9, Tint: 0.79998168889431442},
+			ColorFirst:    &xlsxTabColor{Theme: 9, Tint: -0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 9, Tint: -0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 9, Tint: -0.499984740745262},
+			ColorLow:      &xlsxTabColor{Theme: 9, Tint: -0.499984740745262},
+		}, // 24
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 1, Tint: 0.499984740745262},
+			ColorNegative: &xlsxTabColor{Theme: 1, Tint: 0.249977111117893},
+			ColorMarkers:  &xlsxTabColor{Theme: 1, Tint: 0.249977111117893},
+			ColorFirst:    &xlsxTabColor{Theme: 1, Tint: 0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 1, Tint: 0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 1, Tint: 0.249977111117893},
+			ColorLow:      &xlsxTabColor{Theme: 1, Tint: 0.249977111117893},
+		}, // 25
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 1, Tint: 0.34998626667073579},
+			ColorNegative: &xlsxTabColor{Theme: 0, Tint: 0.249977111117893},
+			ColorMarkers:  &xlsxTabColor{Theme: 0, Tint: 0.249977111117893},
+			ColorFirst:    &xlsxTabColor{Theme: 0, Tint: 0.249977111117893},
+			ColorLast:     &xlsxTabColor{Theme: 0, Tint: 0.249977111117893},
+			ColorHigh:     &xlsxTabColor{Theme: 0, Tint: 0.249977111117893},
+			ColorLow:      &xlsxTabColor{Theme: 0, Tint: 0.249977111117893},
+		}, // 26
+		{
+			ColorSeries:   &xlsxTabColor{RGB: "FF323232"},
+			ColorNegative: &xlsxTabColor{RGB: "FFD00000"},
+			ColorMarkers:  &xlsxTabColor{RGB: "FFD00000"},
+			ColorFirst:    &xlsxTabColor{RGB: "FFD00000"},
+			ColorLast:     &xlsxTabColor{RGB: "FFD00000"},
+			ColorHigh:     &xlsxTabColor{RGB: "FFD00000"},
+			ColorLow:      &xlsxTabColor{RGB: "FFD00000"},
+		}, // 27
+		{
+			ColorSeries:   &xlsxTabColor{RGB: "FF000000"},
+			ColorNegative: &xlsxTabColor{RGB: "FF0070C0"},
+			ColorMarkers:  &xlsxTabColor{RGB: "FF0070C0"},
+			ColorFirst:    &xlsxTabColor{RGB: "FF0070C0"},
+			ColorLast:     &xlsxTabColor{RGB: "FF0070C0"},
+			ColorHigh:     &xlsxTabColor{RGB: "FF0070C0"},
+			ColorLow:      &xlsxTabColor{RGB: "FF0070C0"},
+		}, // 28
+		{
+			ColorSeries:   &xlsxTabColor{RGB: "FF376092"},
+			ColorNegative: &xlsxTabColor{RGB: "FFD00000"},
+			ColorMarkers:  &xlsxTabColor{RGB: "FFD00000"},
+			ColorFirst:    &xlsxTabColor{RGB: "FFD00000"},
+			ColorLast:     &xlsxTabColor{RGB: "FFD00000"},
+			ColorHigh:     &xlsxTabColor{RGB: "FFD00000"},
+			ColorLow:      &xlsxTabColor{RGB: "FFD00000"},
+		}, // 29
+		{
+			ColorSeries:   &xlsxTabColor{RGB: "FF0070C0"},
+			ColorNegative: &xlsxTabColor{RGB: "FF000000"},
+			ColorMarkers:  &xlsxTabColor{RGB: "FF000000"},
+			ColorFirst:    &xlsxTabColor{RGB: "FF000000"},
+			ColorLast:     &xlsxTabColor{RGB: "FF000000"},
+			ColorHigh:     &xlsxTabColor{RGB: "FF000000"},
+			ColorLow:      &xlsxTabColor{RGB: "FF000000"},
+		}, // 30
+		{
+			ColorSeries:   &xlsxTabColor{RGB: "FF5F5F5F"},
+			ColorNegative: &xlsxTabColor{RGB: "FFFFB620"},
+			ColorMarkers:  &xlsxTabColor{RGB: "FFD70077"},
+			ColorFirst:    &xlsxTabColor{RGB: "FF5687C2"},
+			ColorLast:     &xlsxTabColor{RGB: "FF359CEB"},
+			ColorHigh:     &xlsxTabColor{RGB: "FF56BE79"},
+			ColorLow:      &xlsxTabColor{RGB: "FFFF5055"},
+		}, // 31
+		{
+			ColorSeries:   &xlsxTabColor{RGB: "FF5687C2"},
+			ColorNegative: &xlsxTabColor{RGB: "FFFFB620"},
+			ColorMarkers:  &xlsxTabColor{RGB: "FFD70077"},
+			ColorFirst:    &xlsxTabColor{RGB: "FF777777"},
+			ColorLast:     &xlsxTabColor{RGB: "FF359CEB"},
+			ColorHigh:     &xlsxTabColor{RGB: "FF56BE79"},
+			ColorLow:      &xlsxTabColor{RGB: "FFFF5055"},
+		}, // 32
+		{
+			ColorSeries:   &xlsxTabColor{RGB: "FFC6EFCE"},
+			ColorNegative: &xlsxTabColor{RGB: "FFFFC7CE"},
+			ColorMarkers:  &xlsxTabColor{RGB: "FF8CADD6"},
+			ColorFirst:    &xlsxTabColor{RGB: "FFFFDC47"},
+			ColorLast:     &xlsxTabColor{RGB: "FFFFEB9C"},
+			ColorHigh:     &xlsxTabColor{RGB: "FF60D276"},
+			ColorLow:      &xlsxTabColor{RGB: "FFFF5367"},
+		}, // 33
+		{
+			ColorSeries:   &xlsxTabColor{RGB: "FF00B050"},
+			ColorNegative: &xlsxTabColor{RGB: "FFFF0000"},
+			ColorMarkers:  &xlsxTabColor{RGB: "FF0070C0"},
+			ColorFirst:    &xlsxTabColor{RGB: "FFFFC000"},
+			ColorLast:     &xlsxTabColor{RGB: "FFFFC000"},
+			ColorHigh:     &xlsxTabColor{RGB: "FF00B050"},
+			ColorLow:      &xlsxTabColor{RGB: "FFFF0000"},
+		}, // 34
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 3},
+			ColorNegative: &xlsxTabColor{Theme: 9},
+			ColorMarkers:  &xlsxTabColor{Theme: 8},
+			ColorFirst:    &xlsxTabColor{Theme: 4},
+			ColorLast:     &xlsxTabColor{Theme: 5},
+			ColorHigh:     &xlsxTabColor{Theme: 6},
+			ColorLow:      &xlsxTabColor{Theme: 7},
+		}, // 35
+		{
+			ColorSeries:   &xlsxTabColor{Theme: 1},
+			ColorNegative: &xlsxTabColor{Theme: 9},
+			ColorMarkers:  &xlsxTabColor{Theme: 8},
+			ColorFirst:    &xlsxTabColor{Theme: 4},
+			ColorLast:     &xlsxTabColor{Theme: 5},
+			ColorHigh:     &xlsxTabColor{Theme: 6},
+			ColorLow:      &xlsxTabColor{Theme: 7},
+		}, // 36
+	}
+	return groups[ID]
+}
+
+// AddSparkline provides a function to add sparklines to the worksheet by
+// given formatting options. Sparklines are small charts that fit in a single
+// cell and are used to show trends in data. Sparklines are a feature of Excel
+// 2010 and later only. You can write them to an XLSX file that can be read by
+// Excel 2007 but they won't be displayed. For example, add a grouped
+// sparkline. Changes are applied to all three:
+//
+//    err := f.AddSparkline("Sheet1", &excelize.SparklineOption{
+//        Location: []string{"A1", "A2", "A3"},
+//        Range:    []string{"Sheet2!A1:J1", "Sheet2!A2:J2", "Sheet2!A3:J3"},
+//        Markers:  true,
+//    })
+//
+// The following shows the formatting options of sparkline supported by excelize:
+//
+//     Parameter | Description
+//    -----------+--------------------------------------------
+//     Location  | Required, must have the same number with 'Range' parameter
+//     Range     | Required, must have the same number with 'Location' parameter
+//     Type      | Enumeration value: line, column, win_loss
+//     Style     | Value range: 0 - 35
+//     Hight     | Toggle sparkline high points
+//     Low       | Toggle sparkline low points
+//     First     | Toggle sparkline first points
+//     Last      | Toggle sparkline last points
+//     Negative  | Toggle sparkline negative points
+//     Markers   | Toggle sparkline markers
+//     ColorAxis | An RGB Color is specified as RRGGBB
+//     Axis      | Show sparkline axis
+//
+func (f *File) AddSparkline(sheet string, opt *SparklineOption) (err error) {
+	var (
+		ws                             *xlsxWorksheet
+		sparkType                      string
+		sparkTypes                     map[string]string
+		specifiedSparkTypes            string
+		ok                             bool
+		group                          *xlsxX14SparklineGroup
+		groups                         *xlsxX14SparklineGroups
+		sparklineGroupsBytes, extBytes []byte
+	)
+
+	// parameter validation
+	if ws, err = f.parseFormatAddSparklineSet(sheet, opt); err != nil {
+		return
+	}
+	// Handle the sparkline type
+	sparkType = "line"
+	sparkTypes = map[string]string{"line": "line", "column": "column", "win_loss": "stacked"}
+	if opt.Type != "" {
+		if specifiedSparkTypes, ok = sparkTypes[opt.Type]; !ok {
+			err = errors.New("parameter 'Type' must be 'line', 'column' or 'win_loss'")
+			return
+		}
+		sparkType = specifiedSparkTypes
+	}
+	group = f.addSparklineGroupByStyle(opt.Style)
+	group.Type = sparkType
+	group.ColorAxis = &xlsxColor{RGB: "FF000000"}
+	group.DisplayEmptyCellsAs = "gap"
+	group.High = opt.High
+	group.Low = opt.Low
+	group.First = opt.First
+	group.Last = opt.Last
+	group.Negative = opt.Negative
+	group.DisplayXAxis = opt.Axis
+	group.Markers = opt.Markers
+	if opt.SeriesColor != "" {
+		group.ColorSeries = &xlsxTabColor{
+			RGB: getPaletteColor(opt.SeriesColor),
+		}
+	}
+	if opt.Reverse {
+		group.RightToLeft = opt.Reverse
+	}
+	f.addSparkline(opt, group)
+	if ws.ExtLst.Ext != "" { // append mode ext
+		if err = f.appendSparkline(ws, group, groups); err != nil {
+			return
+		}
+	} else {
+		groups = &xlsxX14SparklineGroups{
+			XMLNSXM:         NameSpaceSpreadSheetExcel2006Main,
+			SparklineGroups: []*xlsxX14SparklineGroup{group},
+		}
+		if sparklineGroupsBytes, err = xml.Marshal(groups); err != nil {
+			return
+		}
+		if extBytes, err = xml.Marshal(&xlsxWorksheetExt{
+			URI:     ExtURISparklineGroups,
+			Content: string(sparklineGroupsBytes),
+		}); err != nil {
+			return
+		}
+		ws.ExtLst.Ext = string(extBytes)
+	}
+	f.addSheetNameSpace(sheet, NameSpaceSpreadSheetX14)
+	return
+}
+
+// parseFormatAddSparklineSet provides a function to validate sparkline
+// properties.
+func (f *File) parseFormatAddSparklineSet(sheet string, opt *SparklineOption) (*xlsxWorksheet, error) {
+	ws, err := f.workSheetReader(sheet)
+	if err != nil {
+		return ws, err
+	}
+	if opt == nil {
+		return ws, errors.New("parameter is required")
+	}
+	if len(opt.Location) < 1 {
+		return ws, errors.New("parameter 'Location' is required")
+	}
+	if len(opt.Range) < 1 {
+		return ws, errors.New("parameter 'Range' is required")
+	}
+	// The ranges and locations must match.\
+	if len(opt.Location) != len(opt.Range) {
+		return ws, errors.New(`must have the same number of 'Location' and 'Range' parameters`)
+	}
+	if opt.Style < 0 || opt.Style > 35 {
+		return ws, errors.New("parameter 'Style' must betweent 0-35")
+	}
+	if ws.ExtLst == nil {
+		ws.ExtLst = &xlsxExtLst{}
+	}
+	return ws, err
+}
+
+// addSparkline provides a function to create a sparkline in a sparkline group
+// by given properties.
+func (f *File) addSparkline(opt *SparklineOption, group *xlsxX14SparklineGroup) {
+	for idx, location := range opt.Location {
+		group.Sparklines.Sparkline = append(group.Sparklines.Sparkline, &xlsxX14Sparkline{
+			F:     opt.Range[idx],
+			Sqref: location,
+		})
+	}
+}
+
+// appendSparkline provides a function to append sparkline to sparkline
+// groups.
+func (f *File) appendSparkline(ws *xlsxWorksheet, group *xlsxX14SparklineGroup, groups *xlsxX14SparklineGroups) (err error) {
+	var (
+		idx                                                    int
+		decodeExtLst                                           *decodeWorksheetExt
+		decodeSparklineGroups                                  *decodeX14SparklineGroups
+		ext                                                    *xlsxWorksheetExt
+		sparklineGroupsBytes, sparklineGroupBytes, extLstBytes []byte
+	)
+	decodeExtLst = new(decodeWorksheetExt)
+	if err = f.xmlNewDecoder(strings.NewReader("<extLst>" + ws.ExtLst.Ext + "</extLst>")).
+		Decode(decodeExtLst); err != nil && err != io.EOF {
+		return
+	}
+	for idx, ext = range decodeExtLst.Ext {
+		if ext.URI == ExtURISparklineGroups {
+			decodeSparklineGroups = new(decodeX14SparklineGroups)
+			if err = f.xmlNewDecoder(strings.NewReader(ext.Content)).
+				Decode(decodeSparklineGroups); err != nil && err != io.EOF {
+				return
+			}
+			if sparklineGroupBytes, err = xml.Marshal(group); err != nil {
+				return
+			}
+			groups = &xlsxX14SparklineGroups{
+				XMLNSXM: NameSpaceSpreadSheetExcel2006Main,
+				Content: decodeSparklineGroups.Content + string(sparklineGroupBytes),
+			}
+			if sparklineGroupsBytes, err = xml.Marshal(groups); err != nil {
+				return
+			}
+			decodeExtLst.Ext[idx].Content = string(sparklineGroupsBytes)
+		}
+	}
+	if extLstBytes, err = xml.Marshal(decodeExtLst); err != nil {
+		return
+	}
+	ws.ExtLst = &xlsxExtLst{
+		Ext: strings.TrimSuffix(strings.TrimPrefix(string(extLstBytes), "<extLst>"), "</extLst>"),
+	}
+	return
+}

+ 517 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/stream.go

@@ -0,0 +1,517 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"bytes"
+	"encoding/xml"
+	"fmt"
+	"io"
+	"io/ioutil"
+	"os"
+	"reflect"
+	"strconv"
+	"strings"
+	"time"
+)
+
+// StreamWriter defined the type of stream writer.
+type StreamWriter struct {
+	File       *File
+	Sheet      string
+	SheetID    int
+	worksheet  *xlsxWorksheet
+	rawData    bufferedWriter
+	tableParts string
+}
+
+// NewStreamWriter return stream writer struct by given worksheet name for
+// generate new worksheet with large amounts of data. Note that after set
+// rows, you must call the 'Flush' method to end the streaming writing
+// process and ensure that the order of line numbers is ascending. For
+// example, set data for worksheet of size 102400 rows x 50 columns with
+// numbers and style:
+//
+//    file := excelize.NewFile()
+//    streamWriter, err := file.NewStreamWriter("Sheet1")
+//    if err != nil {
+//        fmt.Println(err)
+//    }
+//    styleID, err := file.NewStyle(`{"font":{"color":"#777777"}}`)
+//    if err != nil {
+//        fmt.Println(err)
+//    }
+//    if err := streamWriter.SetRow("A1", []interface{}{excelize.Cell{StyleID: styleID, Value: "Data"}}); err != nil {
+//        fmt.Println(err)
+//    }
+//    for rowID := 2; rowID <= 102400; rowID++ {
+//        row := make([]interface{}, 50)
+//        for colID := 0; colID < 50; colID++ {
+//            row[colID] = rand.Intn(640000)
+//        }
+//        cell, _ := excelize.CoordinatesToCellName(1, rowID)
+//        if err := streamWriter.SetRow(cell, row); err != nil {
+//            fmt.Println(err)
+//        }
+//    }
+//    if err := streamWriter.Flush(); err != nil {
+//        fmt.Println(err)
+//    }
+//    if err := file.SaveAs("Book1.xlsx"); err != nil {
+//        fmt.Println(err)
+//    }
+//
+func (f *File) NewStreamWriter(sheet string) (*StreamWriter, error) {
+	sheetID := f.getSheetID(sheet)
+	if sheetID == -1 {
+		return nil, fmt.Errorf("sheet %s is not exist", sheet)
+	}
+	sw := &StreamWriter{
+		File:    f,
+		Sheet:   sheet,
+		SheetID: sheetID,
+	}
+	var err error
+	sw.worksheet, err = f.workSheetReader(sheet)
+	if err != nil {
+		return nil, err
+	}
+	sw.rawData.WriteString(XMLHeader + `<worksheet` + templateNamespaceIDMap)
+	bulkAppendFields(&sw.rawData, sw.worksheet, 1, 5)
+	sw.rawData.WriteString(`<sheetData>`)
+	return sw, err
+}
+
+// AddTable creates an Excel table for the StreamWriter using the given
+// coordinate area and format set. For example, create a table of A1:D5:
+//
+//    err := sw.AddTable("A1", "D5", ``)
+//
+// Create a table of F2:H6 with format set:
+//
+//    err := sw.AddTable("F2", "H6", `{"table_name":"table","table_style":"TableStyleMedium2","show_first_column":true,"show_last_column":true,"show_row_stripes":false,"show_column_stripes":true}`)
+//
+// Note that the table must be at least two lines including the header. The
+// header cells must contain strings and must be unique.
+//
+// Currently only one table is allowed for a StreamWriter. AddTable must be
+// called after the rows are written but before Flush.
+//
+// See File.AddTable for details on the table format.
+func (sw *StreamWriter) AddTable(hcell, vcell, format string) error {
+	formatSet, err := parseFormatTableSet(format)
+	if err != nil {
+		return err
+	}
+
+	coordinates, err := areaRangeToCoordinates(hcell, vcell)
+	if err != nil {
+		return err
+	}
+	_ = sortCoordinates(coordinates)
+
+	// Correct the minimum number of rows, the table at least two lines.
+	if coordinates[1] == coordinates[3] {
+		coordinates[3]++
+	}
+
+	// Correct table reference coordinate area, such correct C1:B3 to B1:C3.
+	ref, err := sw.File.coordinatesToAreaRef(coordinates)
+	if err != nil {
+		return err
+	}
+
+	// create table columns using the first row
+	tableHeaders, err := sw.getRowValues(coordinates[1], coordinates[0], coordinates[2])
+	if err != nil {
+		return err
+	}
+	tableColumn := make([]*xlsxTableColumn, len(tableHeaders))
+	for i, name := range tableHeaders {
+		tableColumn[i] = &xlsxTableColumn{
+			ID:   i + 1,
+			Name: name,
+		}
+	}
+
+	tableID := sw.File.countTables() + 1
+
+	name := formatSet.TableName
+	if name == "" {
+		name = "Table" + strconv.Itoa(tableID)
+	}
+
+	table := xlsxTable{
+		XMLNS:       NameSpaceSpreadSheet.Value,
+		ID:          tableID,
+		Name:        name,
+		DisplayName: name,
+		Ref:         ref,
+		AutoFilter: &xlsxAutoFilter{
+			Ref: ref,
+		},
+		TableColumns: &xlsxTableColumns{
+			Count:       len(tableColumn),
+			TableColumn: tableColumn,
+		},
+		TableStyleInfo: &xlsxTableStyleInfo{
+			Name:              formatSet.TableStyle,
+			ShowFirstColumn:   formatSet.ShowFirstColumn,
+			ShowLastColumn:    formatSet.ShowLastColumn,
+			ShowRowStripes:    formatSet.ShowRowStripes,
+			ShowColumnStripes: formatSet.ShowColumnStripes,
+		},
+	}
+
+	sheetRelationshipsTableXML := "../tables/table" + strconv.Itoa(tableID) + ".xml"
+	tableXML := strings.Replace(sheetRelationshipsTableXML, "..", "xl", -1)
+
+	// Add first table for given sheet.
+	sheetPath, _ := sw.File.sheetMap[trimSheetName(sw.Sheet)]
+	sheetRels := "xl/worksheets/_rels/" + strings.TrimPrefix(sheetPath, "xl/worksheets/") + ".rels"
+	rID := sw.File.addRels(sheetRels, SourceRelationshipTable, sheetRelationshipsTableXML, "")
+
+	sw.tableParts = fmt.Sprintf(`<tableParts count="1"><tablePart r:id="rId%d"></tablePart></tableParts>`, rID)
+
+	sw.File.addContentTypePart(tableID, "table")
+
+	b, _ := xml.Marshal(table)
+	sw.File.saveFileList(tableXML, b)
+	return nil
+}
+
+// Extract values from a row in the StreamWriter.
+func (sw *StreamWriter) getRowValues(hrow, hcol, vcol int) (res []string, err error) {
+	res = make([]string, vcol-hcol+1)
+
+	r, err := sw.rawData.Reader()
+	if err != nil {
+		return nil, err
+	}
+
+	dec := sw.File.xmlNewDecoder(r)
+	for {
+		token, err := dec.Token()
+		if err == io.EOF {
+			return res, nil
+		}
+		if err != nil {
+			return nil, err
+		}
+		startElement, ok := getRowElement(token, hrow)
+		if !ok {
+			continue
+		}
+		// decode cells
+		var row xlsxRow
+		if err := dec.DecodeElement(&row, &startElement); err != nil {
+			return nil, err
+		}
+		for _, c := range row.C {
+			col, _, err := CellNameToCoordinates(c.R)
+			if err != nil {
+				return nil, err
+			}
+			if col < hcol || col > vcol {
+				continue
+			}
+			res[col-hcol] = c.V
+		}
+		return res, nil
+	}
+}
+
+// Check if the token is an XLSX row with the matching row number.
+func getRowElement(token xml.Token, hrow int) (startElement xml.StartElement, ok bool) {
+	startElement, ok = token.(xml.StartElement)
+	if !ok {
+		return
+	}
+	ok = startElement.Name.Local == "row"
+	if !ok {
+		return
+	}
+	ok = false
+	for _, attr := range startElement.Attr {
+		if attr.Name.Local != "r" {
+			continue
+		}
+		row, _ := strconv.Atoi(attr.Value)
+		if row == hrow {
+			ok = true
+			return
+		}
+	}
+	return
+}
+
+// Cell can be used directly in StreamWriter.SetRow to specify a style and
+// a value.
+type Cell struct {
+	StyleID int
+	Value   interface{}
+}
+
+// SetRow writes an array to stream rows by giving a worksheet name, starting
+// coordinate and a pointer to an array of values. Note that you must call the
+// 'Flush' method to end the streaming writing process.
+//
+// As a special case, if Cell is used as a value, then the Cell.StyleID will be
+// applied to that cell.
+func (sw *StreamWriter) SetRow(axis string, values []interface{}) error {
+	col, row, err := CellNameToCoordinates(axis)
+	if err != nil {
+		return err
+	}
+
+	fmt.Fprintf(&sw.rawData, `<row r="%d">`, row)
+	for i, val := range values {
+		axis, err := CoordinatesToCellName(col+i, row)
+		if err != nil {
+			return err
+		}
+		c := xlsxC{R: axis}
+		if v, ok := val.(Cell); ok {
+			c.S = v.StyleID
+			val = v.Value
+		} else if v, ok := val.(*Cell); ok && v != nil {
+			c.S = v.StyleID
+			val = v.Value
+		}
+		if err = setCellValFunc(&c, val); err != nil {
+			sw.rawData.WriteString(`</row>`)
+			return err
+		}
+		writeCell(&sw.rawData, c)
+	}
+	sw.rawData.WriteString(`</row>`)
+	return sw.rawData.Sync()
+}
+
+// setCellValFunc provides a function to set value of a cell.
+func setCellValFunc(c *xlsxC, val interface{}) (err error) {
+	switch val := val.(type) {
+	case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:
+		err = setCellIntFunc(c, val)
+	case float32:
+		c.T, c.V = setCellFloat(float64(val), -1, 32)
+	case float64:
+		c.T, c.V = setCellFloat(val, -1, 64)
+	case string:
+		c.T, c.V, c.XMLSpace = setCellStr(val)
+	case []byte:
+		c.T, c.V, c.XMLSpace = setCellStr(string(val))
+	case time.Duration:
+		c.T, c.V = setCellDuration(val)
+	case time.Time:
+		c.T, c.V, _, err = setCellTime(val)
+	case bool:
+		c.T, c.V = setCellBool(val)
+	case nil:
+		c.T, c.V, c.XMLSpace = setCellStr("")
+	default:
+		c.T, c.V, c.XMLSpace = setCellStr(fmt.Sprint(val))
+	}
+	return err
+}
+
+// setCellIntFunc is a wrapper of SetCellInt.
+func setCellIntFunc(c *xlsxC, val interface{}) (err error) {
+	switch val := val.(type) {
+	case int:
+		c.T, c.V = setCellInt(val)
+	case int8:
+		c.T, c.V = setCellInt(int(val))
+	case int16:
+		c.T, c.V = setCellInt(int(val))
+	case int32:
+		c.T, c.V = setCellInt(int(val))
+	case int64:
+		c.T, c.V = setCellInt(int(val))
+	case uint:
+		c.T, c.V = setCellInt(int(val))
+	case uint8:
+		c.T, c.V = setCellInt(int(val))
+	case uint16:
+		c.T, c.V = setCellInt(int(val))
+	case uint32:
+		c.T, c.V = setCellInt(int(val))
+	case uint64:
+		c.T, c.V = setCellInt(int(val))
+	default:
+	}
+	return
+}
+
+func writeCell(buf *bufferedWriter, c xlsxC) {
+	buf.WriteString(`<c`)
+	if c.XMLSpace.Value != "" {
+		fmt.Fprintf(buf, ` xml:%s="%s"`, c.XMLSpace.Name.Local, c.XMLSpace.Value)
+	}
+	fmt.Fprintf(buf, ` r="%s"`, c.R)
+	if c.S != 0 {
+		fmt.Fprintf(buf, ` s="%d"`, c.S)
+	}
+	if c.T != "" {
+		fmt.Fprintf(buf, ` t="%s"`, c.T)
+	}
+	buf.WriteString(`>`)
+	if c.V != "" {
+		buf.WriteString(`<v>`)
+		xml.EscapeText(buf, []byte(c.V))
+		buf.WriteString(`</v>`)
+	}
+	buf.WriteString(`</c>`)
+}
+
+// Flush ending the streaming writing process.
+func (sw *StreamWriter) Flush() error {
+	sw.rawData.WriteString(`</sheetData>`)
+	bulkAppendFields(&sw.rawData, sw.worksheet, 7, 37)
+	sw.rawData.WriteString(sw.tableParts)
+	bulkAppendFields(&sw.rawData, sw.worksheet, 39, 39)
+	sw.rawData.WriteString(`</worksheet>`)
+	if err := sw.rawData.Flush(); err != nil {
+		return err
+	}
+
+	sheetXML := fmt.Sprintf("xl/worksheets/sheet%d.xml", sw.SheetID)
+	delete(sw.File.Sheet, sheetXML)
+	delete(sw.File.checked, sheetXML)
+
+	defer sw.rawData.Close()
+	b, err := sw.rawData.Bytes()
+	if err != nil {
+		return err
+	}
+	sw.File.XLSX[sheetXML] = b
+	return nil
+}
+
+// bulkAppendFields bulk-appends fields in a worksheet by specified field
+// names order range.
+func bulkAppendFields(w io.Writer, ws *xlsxWorksheet, from, to int) {
+	s := reflect.ValueOf(ws).Elem()
+	enc := xml.NewEncoder(w)
+	for i := 0; i < s.NumField(); i++ {
+		if from <= i && i <= to {
+			enc.Encode(s.Field(i).Interface())
+		}
+	}
+}
+
+// bufferedWriter uses a temp file to store an extended buffer. Writes are
+// always made to an in-memory buffer, which will always succeed. The buffer
+// is written to the temp file with Sync, which may return an error.
+// Therefore, Sync should be periodically called and the error checked.
+type bufferedWriter struct {
+	tmp *os.File
+	buf bytes.Buffer
+}
+
+// Write to the in-memory buffer. The err is always nil.
+func (bw *bufferedWriter) Write(p []byte) (n int, err error) {
+	return bw.buf.Write(p)
+}
+
+// WriteString wites to the in-memory buffer. The err is always nil.
+func (bw *bufferedWriter) WriteString(p string) (n int, err error) {
+	return bw.buf.WriteString(p)
+}
+
+// Reader provides read-access to the underlying buffer/file.
+func (bw *bufferedWriter) Reader() (io.Reader, error) {
+	if bw.tmp == nil {
+		return bytes.NewReader(bw.buf.Bytes()), nil
+	}
+	if err := bw.Flush(); err != nil {
+		return nil, err
+	}
+	fi, err := bw.tmp.Stat()
+	if err != nil {
+		return nil, err
+	}
+	// os.File.ReadAt does not affect the cursor position and is safe to use here
+	return io.NewSectionReader(bw.tmp, 0, fi.Size()), nil
+}
+
+// Bytes returns the entire content of the bufferedWriter. If a temp file is
+// used, Bytes will efficiently allocate a buffer to prevent re-allocations.
+func (bw *bufferedWriter) Bytes() ([]byte, error) {
+	if bw.tmp == nil {
+		return bw.buf.Bytes(), nil
+	}
+
+	if err := bw.Flush(); err != nil {
+		return nil, err
+	}
+
+	var buf bytes.Buffer
+	if fi, err := bw.tmp.Stat(); err == nil {
+		if size := fi.Size() + bytes.MinRead; size > bytes.MinRead {
+			if int64(int(size)) == size {
+				buf.Grow(int(size))
+			} else {
+				return nil, bytes.ErrTooLarge
+			}
+		}
+	}
+
+	if _, err := bw.tmp.Seek(0, 0); err != nil {
+		return nil, err
+	}
+
+	_, err := buf.ReadFrom(bw.tmp)
+	return buf.Bytes(), err
+}
+
+// Sync will write the in-memory buffer to a temp file, if the in-memory
+// buffer has grown large enough. Any error will be returned.
+func (bw *bufferedWriter) Sync() (err error) {
+	// Try to use local storage
+	const chunk = 1 << 24
+	if bw.buf.Len() < chunk {
+		return nil
+	}
+	if bw.tmp == nil {
+		bw.tmp, err = ioutil.TempFile(os.TempDir(), "excelize-")
+		if err != nil {
+			// can not use local storage
+			return nil
+		}
+	}
+	return bw.Flush()
+}
+
+// Flush the entire in-memory buffer to the temp file, if a temp file is being
+// used.
+func (bw *bufferedWriter) Flush() error {
+	if bw.tmp == nil {
+		return nil
+	}
+	_, err := bw.buf.WriteTo(bw.tmp)
+	if err != nil {
+		return err
+	}
+	bw.buf.Reset()
+	return nil
+}
+
+// Close the underlying temp file and reset the in-memory buffer.
+func (bw *bufferedWriter) Close() error {
+	bw.buf.Reset()
+	if bw.tmp == nil {
+		return nil
+	}
+	defer os.Remove(bw.tmp.Name())
+	return bw.tmp.Close()
+}

+ 3073 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/styles.go

@@ -0,0 +1,3073 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"bytes"
+	"encoding/json"
+	"encoding/xml"
+	"errors"
+	"fmt"
+	"io"
+	"log"
+	"math"
+	"reflect"
+	"strconv"
+	"strings"
+)
+
+// Excel styles can reference number formats that are built-in, all of which
+// have an id less than 164. This is a possibly incomplete list comprised of
+// as many of them as I could find.
+var builtInNumFmt = map[int]string{
+	0:  "general",
+	1:  "0",
+	2:  "0.00",
+	3:  "#,##0",
+	4:  "#,##0.00",
+	9:  "0%",
+	10: "0.00%",
+	11: "0.00e+00",
+	12: "# ?/?",
+	13: "# ??/??",
+	14: "mm-dd-yy",
+	15: "d-mmm-yy",
+	16: "d-mmm",
+	17: "mmm-yy",
+	18: "h:mm am/pm",
+	19: "h:mm:ss am/pm",
+	20: "h:mm",
+	21: "h:mm:ss",
+	22: "m/d/yy h:mm",
+	37: "#,##0 ;(#,##0)",
+	38: "#,##0 ;[red](#,##0)",
+	39: "#,##0.00;(#,##0.00)",
+	40: "#,##0.00;[red](#,##0.00)",
+	41: `_(* #,##0_);_(* \(#,##0\);_(* "-"_);_(@_)`,
+	42: `_("$"* #,##0_);_("$* \(#,##0\);_("$"* "-"_);_(@_)`,
+	43: `_(* #,##0.00_);_(* \(#,##0.00\);_(* "-"??_);_(@_)`,
+	44: `_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)`,
+	45: "mm:ss",
+	46: "[h]:mm:ss",
+	47: "mmss.0",
+	48: "##0.0e+0",
+	49: "@",
+}
+
+// langNumFmt defined number format code (with unicode values provided for
+// language glyphs where they occur) in different language.
+var langNumFmt = map[string]map[int]string{
+	"zh-tw": {
+		27: "[$-404]e/m/d",
+		28: `[$-404]e"年"m"月"d"日"`,
+		29: `[$-404]e"年"m"月"d"日"`,
+		30: "m/d/yy",
+		31: `yyyy"年"m"月"d"日"`,
+		32: `hh"時"mm"分"`,
+		33: `hh"時"mm"分"ss"秒"`,
+		34: `上午/下午 hh"時"mm"分"`,
+		35: `上午/下午 hh"時"mm"分"ss"秒"`,
+		36: "[$-404]e/m/d",
+		50: "[$-404]e/m/d",
+		51: `[$-404]e"年"m"月"d"日"`,
+		52: `上午/下午 hh"時"mm"分"`,
+		53: `上午/下午 hh"時"mm"分"ss"秒"`,
+		54: `[$-404]e"年"m"月"d"日"`,
+		55: `上午/下午 hh"時"mm"分"`,
+		56: `上午/下午 hh"時"mm"分"ss"秒"`,
+		57: "[$-404]e/m/d",
+		58: `[$-404]e"年"m"月"d"日"`,
+	},
+	"zh-cn": {
+		27: `yyyy"年"m"月"`,
+		28: `m"月"d"日"`,
+		29: `m"月"d"日"`,
+		30: "m-d-yy",
+		31: `yyyy"年"m"月"d"日"`,
+		32: `h"时"mm"分"`,
+		33: `h"时"mm"分"ss"秒"`,
+		34: `上午/下午 h"时"mm"分"`,
+		35: `上午/下午 h"时"mm"分"ss"秒"`,
+		36: `yyyy"年"m"月"`,
+		50: `yyyy"年"m"月"`,
+		51: `m"月"d"日"`,
+		52: `yyyy"年"m"月"`,
+		53: `m"月"d"日"`,
+		54: `m"月"d"日"`,
+		55: `上午/下午 h"时"mm"分"`,
+		56: `上午/下午 h"时"mm"分"ss"秒"`,
+		57: `yyyy"年"m"月"`,
+		58: `m"月"d"日"`,
+	},
+	"zh-tw_unicode": {
+		27: "[$-404]e/m/d",
+		28: `[$-404]e"5E74"m"6708"d"65E5"`,
+		29: `[$-404]e"5E74"m"6708"d"65E5"`,
+		30: "m/d/yy",
+		31: `yyyy"5E74"m"6708"d"65E5"`,
+		32: `hh"6642"mm"5206"`,
+		33: `hh"6642"mm"5206"ss"79D2"`,
+		34: `4E0A5348/4E0B5348hh"6642"mm"5206"`,
+		35: `4E0A5348/4E0B5348hh"6642"mm"5206"ss"79D2"`,
+		36: "[$-404]e/m/d",
+		50: "[$-404]e/m/d",
+		51: `[$-404]e"5E74"m"6708"d"65E5"`,
+		52: `4E0A5348/4E0B5348hh"6642"mm"5206"`,
+		53: `4E0A5348/4E0B5348hh"6642"mm"5206"ss"79D2"`,
+		54: `[$-404]e"5E74"m"6708"d"65E5"`,
+		55: `4E0A5348/4E0B5348hh"6642"mm"5206"`,
+		56: `4E0A5348/4E0B5348hh"6642"mm"5206"ss"79D2"`,
+		57: "[$-404]e/m/d",
+		58: `[$-404]e"5E74"m"6708"d"65E5"`,
+	},
+	"zh-cn_unicode": {
+		27: `yyyy"5E74"m"6708"`,
+		28: `m"6708"d"65E5"`,
+		29: `m"6708"d"65E5"`,
+		30: "m-d-yy",
+		31: `yyyy"5E74"m"6708"d"65E5"`,
+		32: `h"65F6"mm"5206"`,
+		33: `h"65F6"mm"5206"ss"79D2"`,
+		34: `4E0A5348/4E0B5348h"65F6"mm"5206"`,
+		35: `4E0A5348/4E0B5348h"65F6"mm"5206"ss"79D2"`,
+		36: `yyyy"5E74"m"6708"`,
+		50: `yyyy"5E74"m"6708"`,
+		51: `m"6708"d"65E5"`,
+		52: `yyyy"5E74"m"6708"`,
+		53: `m"6708"d"65E5"`,
+		54: `m"6708"d"65E5"`,
+		55: `4E0A5348/4E0B5348h"65F6"mm"5206"`,
+		56: `4E0A5348/4E0B5348h"65F6"mm"5206"ss"79D2"`,
+		57: `yyyy"5E74"m"6708"`,
+		58: `m"6708"d"65E5"`,
+	},
+	"ja-jp": {
+		27: "[$-411]ge.m.d",
+		28: `[$-411]ggge"年"m"月"d"日"`,
+		29: `[$-411]ggge"年"m"月"d"日"`,
+		30: "m/d/yy",
+		31: `yyyy"年"m"月"d"日"`,
+		32: `h"時"mm"分"`,
+		33: `h"時"mm"分"ss"秒"`,
+		34: `yyyy"年"m"月"`,
+		35: `m"月"d"日"`,
+		36: "[$-411]ge.m.d",
+		50: "[$-411]ge.m.d",
+		51: `[$-411]ggge"年"m"月"d"日"`,
+		52: `yyyy"年"m"月"`,
+		53: `m"月"d"日"`,
+		54: `[$-411]ggge"年"m"月"d"日"`,
+		55: `yyyy"年"m"月"`,
+		56: `m"月"d"日"`,
+		57: "[$-411]ge.m.d",
+		58: `[$-411]ggge"年"m"月"d"日"`,
+	},
+	"ko-kr": {
+		27: `yyyy"年" mm"月" dd"日"`,
+		28: "mm-dd",
+		29: "mm-dd",
+		30: "mm-dd-yy",
+		31: `yyyy"년" mm"월" dd"일"`,
+		32: `h"시" mm"분"`,
+		33: `h"시" mm"분" ss"초"`,
+		34: `yyyy-mm-dd`,
+		35: `yyyy-mm-dd`,
+		36: `yyyy"年" mm"月" dd"日"`,
+		50: `yyyy"年" mm"月" dd"日"`,
+		51: "mm-dd",
+		52: "yyyy-mm-dd",
+		53: "yyyy-mm-dd",
+		54: "mm-dd",
+		55: "yyyy-mm-dd",
+		56: "yyyy-mm-dd",
+		57: `yyyy"年" mm"月" dd"日"`,
+		58: "mm-dd",
+	},
+	"ja-jp_unicode": {
+		27: "[$-411]ge.m.d",
+		28: `[$-411]ggge"5E74"m"6708"d"65E5"`,
+		29: `[$-411]ggge"5E74"m"6708"d"65E5"`,
+		30: "m/d/yy",
+		31: `yyyy"5E74"m"6708"d"65E5"`,
+		32: `h"6642"mm"5206"`,
+		33: `h"6642"mm"5206"ss"79D2"`,
+		34: `yyyy"5E74"m"6708"`,
+		35: `m"6708"d"65E5"`,
+		36: "[$-411]ge.m.d",
+		50: "[$-411]ge.m.d",
+		51: `[$-411]ggge"5E74"m"6708"d"65E5"`,
+		52: `yyyy"5E74"m"6708"`,
+		53: `m"6708"d"65E5"`,
+		54: `[$-411]ggge"5E74"m"6708"d"65E5"`,
+		55: `yyyy"5E74"m"6708"`,
+		56: `m"6708"d"65E5"`,
+		57: "[$-411]ge.m.d",
+		58: `[$-411]ggge"5E74"m"6708"d"65E5"`,
+	},
+	"ko-kr_unicode": {
+		27: `yyyy"5E74" mm"6708" dd"65E5"`,
+		28: "mm-dd",
+		29: "mm-dd",
+		30: "mm-dd-yy",
+		31: `yyyy"B144" mm"C6D4" dd"C77C"`,
+		32: `h"C2DC" mm"BD84"`,
+		33: `h"C2DC" mm"BD84" ss"CD08"`,
+		34: "yyyy-mm-dd",
+		35: "yyyy-mm-dd",
+		36: `yyyy"5E74" mm"6708" dd"65E5"`,
+		50: `yyyy"5E74" mm"6708" dd"65E5"`,
+		51: "mm-dd",
+		52: "yyyy-mm-dd",
+		53: "yyyy-mm-dd",
+		54: "mm-dd",
+		55: "yyyy-mm-dd",
+		56: "yyyy-mm-dd",
+		57: `yyyy"5E74" mm"6708" dd"65E5"`,
+		58: "mm-dd",
+	},
+	"th-th": {
+		59: "t0",
+		60: "t0.00",
+		61: "t#,##0",
+		62: "t#,##0.00",
+		67: "t0%",
+		68: "t0.00%",
+		69: "t# ?/?",
+		70: "t# ??/??",
+		71: "ว/ด/ปปปป",
+		72: "ว-ดดด-ปป",
+		73: "ว-ดดด",
+		74: "ดดด-ปป",
+		75: "ช:นน",
+		76: "ช:นน:ทท",
+		77: "ว/ด/ปปปป ช:นน",
+		78: "นน:ทท",
+		79: "[ช]:นน:ทท",
+		80: "นน:ทท.0",
+		81: "d/m/bb",
+	},
+	"th-th_unicode": {
+		59: "t0",
+		60: "t0.00",
+		61: "t#,##0",
+		62: "t#,##0.00",
+		67: "t0%",
+		68: "t0.00%",
+		69: "t# ?/?",
+		70: "t# ??/??",
+		71: "0E27/0E14/0E1B0E1B0E1B0E1B",
+		72: "0E27-0E140E140E14-0E1B0E1B",
+		73: "0E27-0E140E140E14",
+		74: "0E140E140E14-0E1B0E1B",
+		75: "0E0A:0E190E19",
+		76: "0E0A:0E190E19:0E170E17",
+		77: "0E27/0E14/0E1B0E1B0E1B0E1B 0E0A:0E190E19",
+		78: "0E190E19:0E170E17",
+		79: "[0E0A]:0E190E19:0E170E17",
+		80: "0E190E19:0E170E17.0",
+		81: "d/m/bb",
+	},
+}
+
+// currencyNumFmt defined the currency number format map.
+var currencyNumFmt = map[int]string{
+	164: `"CN¥",##0.00`,
+	165: "[$$-409]#,##0.00",
+	166: "[$$-45C]#,##0.00",
+	167: "[$$-1004]#,##0.00",
+	168: "[$$-404]#,##0.00",
+	169: "[$$-C09]#,##0.00",
+	170: "[$$-2809]#,##0.00",
+	171: "[$$-1009]#,##0.00",
+	172: "[$$-2009]#,##0.00",
+	173: "[$$-1409]#,##0.00",
+	174: "[$$-4809]#,##0.00",
+	175: "[$$-2C09]#,##0.00",
+	176: "[$$-2409]#,##0.00",
+	177: "[$$-1000]#,##0.00",
+	178: `#,##0.00\ [$$-C0C]`,
+	179: "[$$-475]#,##0.00",
+	180: "[$$-83E]#,##0.00",
+	181: `[$$-86B]\ #,##0.00`,
+	182: `[$$-340A]\ #,##0.00`,
+	183: "[$$-240A]#,##0.00",
+	184: `[$$-300A]\ #,##0.00`,
+	185: "[$$-440A]#,##0.00",
+	186: "[$$-80A]#,##0.00",
+	187: "[$$-500A]#,##0.00",
+	188: "[$$-540A]#,##0.00",
+	189: `[$$-380A]\ #,##0.00`,
+	190: "[$£-809]#,##0.00",
+	191: "[$£-491]#,##0.00",
+	192: "[$£-452]#,##0.00",
+	193: "[$¥-804]#,##0.00",
+	194: "[$¥-411]#,##0.00",
+	195: "[$¥-478]#,##0.00",
+	196: "[$¥-451]#,##0.00",
+	197: "[$¥-480]#,##0.00",
+	198: "#,##0.00\\ [$\u058F-42B]",
+	199: "[$\u060B-463]#,##0.00",
+	200: "[$\u060B-48C]#,##0.00",
+	201: "[$\u09F3-845]\\ #,##0.00",
+	202: "#,##0.00[$\u17DB-453]",
+	203: "[$\u20A1-140A]#,##0.00",
+	204: "[$\u20A6-468]\\ #,##0.00",
+	205: "[$\u20A6-470]\\ #,##0.00",
+	206: "[$\u20A9-412]#,##0.00",
+	207: "[$\u20AA-40D]\\ #,##0.00",
+	208: "#,##0.00\\ [$\u20AB-42A]",
+	209: "#,##0.00\\ [$\u20AC-42D]",
+	210: "#,##0.00\\ [$\u20AC-47E]",
+	211: "#,##0.00\\ [$\u20AC-403]",
+	212: "#,##0.00\\ [$\u20AC-483]",
+	213: "[$\u20AC-813]\\ #,##0.00",
+	214: "[$\u20AC-413]\\ #,##0.00",
+	215: "[$\u20AC-1809]#,##0.00",
+	216: "#,##0.00\\ [$\u20AC-425]",
+	217: "[$\u20AC-2]\\ #,##0.00",
+	218: "#,##0.00\\ [$\u20AC-1]",
+	219: "#,##0.00\\ [$\u20AC-40B]",
+	220: "#,##0.00\\ [$\u20AC-80C]",
+	221: "#,##0.00\\ [$\u20AC-40C]",
+	222: "#,##0.00\\ [$\u20AC-140C]",
+	223: "#,##0.00\\ [$\u20AC-180C]",
+	224: "[$\u20AC-200C]#,##0.00",
+	225: "#,##0.00\\ [$\u20AC-456]",
+	226: "#,##0.00\\ [$\u20AC-C07]",
+	227: "#,##0.00\\ [$\u20AC-407]",
+	228: "#,##0.00\\ [$\u20AC-1007]",
+	229: "#,##0.00\\ [$\u20AC-408]",
+	230: "#,##0.00\\ [$\u20AC-243B]",
+	231: "[$\u20AC-83C]#,##0.00",
+	232: "[$\u20AC-410]\\ #,##0.00",
+	233: "[$\u20AC-476]#,##0.00",
+	234: "#,##0.00\\ [$\u20AC-2C1A]",
+	235: "[$\u20AC-426]\\ #,##0.00",
+	236: "#,##0.00\\ [$\u20AC-427]",
+	237: "#,##0.00\\ [$\u20AC-82E]",
+	238: "#,##0.00\\ [$\u20AC-46E]",
+	239: "[$\u20AC-43A]#,##0.00",
+	240: "#,##0.00\\ [$\u20AC-C3B]",
+	241: "#,##0.00\\ [$\u20AC-482]",
+	242: "#,##0.00\\ [$\u20AC-816]",
+	243: "#,##0.00\\ [$\u20AC-301A]",
+	244: "#,##0.00\\ [$\u20AC-203B]",
+	245: "#,##0.00\\ [$\u20AC-41B]",
+	246: "#,##0.00\\ [$\u20AC-424]",
+	247: "#,##0.00\\ [$\u20AC-C0A]",
+	248: "#,##0.00\\ [$\u20AC-81D]",
+	249: "#,##0.00\\ [$\u20AC-484]",
+	250: "#,##0.00\\ [$\u20AC-42E]",
+	251: "[$\u20AC-462]\\ #,##0.00",
+	252: "#,##0.00\\ [$₭-454]",
+	253: "#,##0.00\\ [$₮-450]",
+	254: "[$\u20AE-C50]#,##0.00",
+	255: "[$\u20B1-3409]#,##0.00",
+	256: "[$\u20B1-464]#,##0.00",
+	257: "#,##0.00[$\u20B4-422]",
+	258: "[$\u20B8-43F]#,##0.00",
+	259: "[$\u20B9-460]#,##0.00",
+	260: "[$\u20B9-4009]\\ #,##0.00",
+	261: "[$\u20B9-447]\\ #,##0.00",
+	262: "[$\u20B9-439]\\ #,##0.00",
+	263: "[$\u20B9-44B]\\ #,##0.00",
+	264: "[$\u20B9-860]#,##0.00",
+	265: "[$\u20B9-457]\\ #,##0.00",
+	266: "[$\u20B9-458]#,##0.00",
+	267: "[$\u20B9-44E]\\ #,##0.00",
+	268: "[$\u20B9-861]#,##0.00",
+	269: "[$\u20B9-448]\\ #,##0.00",
+	270: "[$\u20B9-446]\\ #,##0.00",
+	271: "[$\u20B9-44F]\\ #,##0.00",
+	272: "[$\u20B9-459]#,##0.00",
+	273: "[$\u20B9-449]\\ #,##0.00",
+	274: "[$\u20B9-820]#,##0.00",
+	275: "#,##0.00\\ [$\u20BA-41F]",
+	276: "#,##0.00\\ [$\u20BC-42C]",
+	277: "#,##0.00\\ [$\u20BC-82C]",
+	278: "#,##0.00\\ [$\u20BD-419]",
+	279: "#,##0.00[$\u20BD-485]",
+	280: "#,##0.00\\ [$\u20BE-437]",
+	281: "[$B/.-180A]\\ #,##0.00",
+	282: "[$Br-472]#,##0.00",
+	283: "[$Br-477]#,##0.00",
+	284: "#,##0.00[$Br-473]",
+	285: "[$Bs-46B]\\ #,##0.00",
+	286: "[$Bs-400A]\\ #,##0.00",
+	287: "[$Bs.-200A]\\ #,##0.00",
+	288: "[$BWP-832]\\ #,##0.00",
+	289: "[$C$-4C0A]#,##0.00",
+	290: "[$CA$-85D]#,##0.00",
+	291: "[$CA$-47C]#,##0.00",
+	292: "[$CA$-45D]#,##0.00",
+	293: "[$CFA-340C]#,##0.00",
+	294: "[$CFA-280C]#,##0.00",
+	295: "#,##0.00\\ [$CFA-867]",
+	296: "#,##0.00\\ [$CFA-488]",
+	297: "#,##0.00\\ [$CHF-100C]",
+	298: "[$CHF-1407]\\ #,##0.00",
+	299: "[$CHF-807]\\ #,##0.00",
+	300: "[$CHF-810]\\ #,##0.00",
+	301: "[$CHF-417]\\ #,##0.00",
+	302: "[$CLP-47A]\\ #,##0.00",
+	303: "[$CN¥-850]#,##0.00",
+	304: "#,##0.00\\ [$DZD-85F]",
+	305: "[$FCFA-2C0C]#,##0.00",
+	306: "#,##0.00\\ [$Ft-40E]",
+	307: "[$G-3C0C]#,##0.00",
+	308: "[$Gs.-3C0A]\\ #,##0.00",
+	309: "[$GTQ-486]#,##0.00",
+	310: "[$HK$-C04]#,##0.00",
+	311: "[$HK$-3C09]#,##0.00",
+	312: "#,##0.00\\ [$HRK-41A]",
+	313: "[$IDR-3809]#,##0.00",
+	314: "[$IQD-492]#,##0.00",
+	315: "#,##0.00\\ [$ISK-40F]",
+	316: "[$K-455]#,##0.00",
+	317: "#,##0.00\\ [$K\u010D-405]",
+	318: "#,##0.00\\ [$KM-141A]",
+	319: "#,##0.00\\ [$KM-101A]",
+	320: "#,##0.00\\ [$KM-181A]",
+	321: "[$kr-438]\\ #,##0.00",
+	322: "[$kr-43B]\\ #,##0.00",
+	323: "#,##0.00\\ [$kr-83B]",
+	324: "[$kr-414]\\ #,##0.00",
+	325: "[$kr-814]\\ #,##0.00",
+	326: "#,##0.00\\ [$kr-41D]",
+	327: "[$kr.-406]\\ #,##0.00",
+	328: "[$kr.-46F]\\ #,##0.00",
+	329: "[$Ksh-441]#,##0.00",
+	330: "[$L-818]#,##0.00",
+	331: "[$L-819]#,##0.00",
+	332: "[$L-480A]\\ #,##0.00",
+	333: "#,##0.00\\ [$Lek\u00EB-41C]",
+	334: "[$MAD-45F]#,##0.00",
+	335: "[$MAD-380C]#,##0.00",
+	336: "#,##0.00\\ [$MAD-105F]",
+	337: "[$MOP$-1404]#,##0.00",
+	338: "#,##0.00\\ [$MVR-465]_-",
+	339: "#,##0.00[$Nfk-873]",
+	340: "[$NGN-466]#,##0.00",
+	341: "[$NGN-467]#,##0.00",
+	342: "[$NGN-469]#,##0.00",
+	343: "[$NGN-471]#,##0.00",
+	344: "[$NOK-103B]\\ #,##0.00",
+	345: "[$NOK-183B]\\ #,##0.00",
+	346: "[$NZ$-481]#,##0.00",
+	347: "[$PKR-859]\\ #,##0.00",
+	348: "[$PYG-474]#,##0.00",
+	349: "[$Q-100A]#,##0.00",
+	350: "[$R-436]\\ #,##0.00",
+	351: "[$R-1C09]\\ #,##0.00",
+	352: "[$R-435]\\ #,##0.00",
+	353: "[$R$-416]\\ #,##0.00",
+	354: "[$RD$-1C0A]#,##0.00",
+	355: "#,##0.00\\ [$RF-487]",
+	356: "[$RM-4409]#,##0.00",
+	357: "[$RM-43E]#,##0.00",
+	358: "#,##0.00\\ [$RON-418]",
+	359: "[$Rp-421]#,##0.00",
+	360: "[$Rs-420]#,##0.00_-",
+	361: "[$Rs.-849]\\ #,##0.00",
+	362: "#,##0.00\\ [$RSD-81A]",
+	363: "#,##0.00\\ [$RSD-C1A]",
+	364: "#,##0.00\\ [$RUB-46D]",
+	365: "#,##0.00\\ [$RUB-444]",
+	366: "[$S/.-C6B]\\ #,##0.00",
+	367: "[$S/.-280A]\\ #,##0.00",
+	368: "#,##0.00\\ [$SEK-143B]",
+	369: "#,##0.00\\ [$SEK-1C3B]",
+	370: "#,##0.00\\ [$so\u02BBm-443]",
+	371: "#,##0.00\\ [$so\u02BBm-843]",
+	372: "#,##0.00\\ [$SYP-45A]",
+	373: "[$THB-41E]#,##0.00",
+	374: "#,##0.00[$TMT-442]",
+	375: "[$US$-3009]#,##0.00",
+	376: "[$ZAR-46C]\\ #,##0.00",
+	377: "[$ZAR-430]#,##0.00",
+	378: "[$ZAR-431]#,##0.00",
+	379: "[$ZAR-432]\\ #,##0.00",
+	380: "[$ZAR-433]#,##0.00",
+	381: "[$ZAR-434]\\ #,##0.00",
+	382: "#,##0.00\\ [$z\u0142-415]",
+	383: "#,##0.00\\ [$\u0434\u0435\u043D-42F]",
+	384: "#,##0.00\\ [$КМ-201A]",
+	385: "#,##0.00\\ [$КМ-1C1A]",
+	386: "#,##0.00\\ [$\u043B\u0432.-402]",
+	387: "#,##0.00\\ [$р.-423]",
+	388: "#,##0.00\\ [$\u0441\u043E\u043C-440]",
+	389: "#,##0.00\\ [$\u0441\u043E\u043C-428]",
+	390: "[$\u062C.\u0645.-C01]\\ #,##0.00_-",
+	391: "[$\u062F.\u0623.-2C01]\\ #,##0.00_-",
+	392: "[$\u062F.\u0625.-3801]\\ #,##0.00_-",
+	393: "[$\u062F.\u0628.-3C01]\\ #,##0.00_-",
+	394: "[$\u062F.\u062A.-1C01]\\ #,##0.00_-",
+	395: "[$\u062F.\u062C.-1401]\\ #,##0.00_-",
+	396: "[$\u062F.\u0639.-801]\\ #,##0.00_-",
+	397: "[$\u062F.\u0643.-3401]\\ #,##0.00_-",
+	398: "[$\u062F.\u0644.-1001]#,##0.00_-",
+	399: "[$\u062F.\u0645.-1801]\\ #,##0.00_-",
+	400: "[$\u0631-846]\\ #,##0.00",
+	401: "[$\u0631.\u0633.-401]\\ #,##0.00_-",
+	402: "[$\u0631.\u0639.-2001]\\ #,##0.00_-",
+	403: "[$\u0631.\u0642.-4001]\\ #,##0.00_-",
+	404: "[$\u0631.\u064A.-2401]\\ #,##0.00_-",
+	405: "[$\u0631\u06CC\u0627\u0644-429]#,##0.00_-",
+	406: "[$\u0644.\u0633.-2801]\\ #,##0.00_-",
+	407: "[$\u0644.\u0644.-3001]\\ #,##0.00_-",
+	408: "[$\u1265\u122D-45E]#,##0.00",
+	409: "[$\u0930\u0942-461]#,##0.00",
+	410: "[$\u0DBB\u0DD4.-45B]\\ #,##0.00",
+	411: "[$ADP]\\ #,##0.00",
+	412: "[$AED]\\ #,##0.00",
+	413: "[$AFA]\\ #,##0.00",
+	414: "[$AFN]\\ #,##0.00",
+	415: "[$ALL]\\ #,##0.00",
+	416: "[$AMD]\\ #,##0.00",
+	417: "[$ANG]\\ #,##0.00",
+	418: "[$AOA]\\ #,##0.00",
+	419: "[$ARS]\\ #,##0.00",
+	420: "[$ATS]\\ #,##0.00",
+	421: "[$AUD]\\ #,##0.00",
+	422: "[$AWG]\\ #,##0.00",
+	423: "[$AZM]\\ #,##0.00",
+	424: "[$AZN]\\ #,##0.00",
+	425: "[$BAM]\\ #,##0.00",
+	426: "[$BBD]\\ #,##0.00",
+	427: "[$BDT]\\ #,##0.00",
+	428: "[$BEF]\\ #,##0.00",
+	429: "[$BGL]\\ #,##0.00",
+	430: "[$BGN]\\ #,##0.00",
+	431: "[$BHD]\\ #,##0.00",
+	432: "[$BIF]\\ #,##0.00",
+	433: "[$BMD]\\ #,##0.00",
+	434: "[$BND]\\ #,##0.00",
+	435: "[$BOB]\\ #,##0.00",
+	436: "[$BOV]\\ #,##0.00",
+	437: "[$BRL]\\ #,##0.00",
+	438: "[$BSD]\\ #,##0.00",
+	439: "[$BTN]\\ #,##0.00",
+	440: "[$BWP]\\ #,##0.00",
+	441: "[$BYR]\\ #,##0.00",
+	442: "[$BZD]\\ #,##0.00",
+	443: "[$CAD]\\ #,##0.00",
+	444: "[$CDF]\\ #,##0.00",
+	445: "[$CHE]\\ #,##0.00",
+	446: "[$CHF]\\ #,##0.00",
+	447: "[$CHW]\\ #,##0.00",
+	448: "[$CLF]\\ #,##0.00",
+	449: "[$CLP]\\ #,##0.00",
+	450: "[$CNY]\\ #,##0.00",
+	451: "[$COP]\\ #,##0.00",
+	452: "[$COU]\\ #,##0.00",
+	453: "[$CRC]\\ #,##0.00",
+	454: "[$CSD]\\ #,##0.00",
+	455: "[$CUC]\\ #,##0.00",
+	456: "[$CVE]\\ #,##0.00",
+	457: "[$CYP]\\ #,##0.00",
+	458: "[$CZK]\\ #,##0.00",
+	459: "[$DEM]\\ #,##0.00",
+	460: "[$DJF]\\ #,##0.00",
+	461: "[$DKK]\\ #,##0.00",
+	462: "[$DOP]\\ #,##0.00",
+	463: "[$DZD]\\ #,##0.00",
+	464: "[$ECS]\\ #,##0.00",
+	465: "[$ECV]\\ #,##0.00",
+	466: "[$EEK]\\ #,##0.00",
+	467: "[$EGP]\\ #,##0.00",
+	468: "[$ERN]\\ #,##0.00",
+	469: "[$ESP]\\ #,##0.00",
+	470: "[$ETB]\\ #,##0.00",
+	471: "[$EUR]\\ #,##0.00",
+	472: "[$FIM]\\ #,##0.00",
+	473: "[$FJD]\\ #,##0.00",
+	474: "[$FKP]\\ #,##0.00",
+	475: "[$FRF]\\ #,##0.00",
+	476: "[$GBP]\\ #,##0.00",
+	477: "[$GEL]\\ #,##0.00",
+	478: "[$GHC]\\ #,##0.00",
+	479: "[$GHS]\\ #,##0.00",
+	480: "[$GIP]\\ #,##0.00",
+	481: "[$GMD]\\ #,##0.00",
+	482: "[$GNF]\\ #,##0.00",
+	483: "[$GRD]\\ #,##0.00",
+	484: "[$GTQ]\\ #,##0.00",
+	485: "[$GYD]\\ #,##0.00",
+	486: "[$HKD]\\ #,##0.00",
+	487: "[$HNL]\\ #,##0.00",
+	488: "[$HRK]\\ #,##0.00",
+	489: "[$HTG]\\ #,##0.00",
+	490: "[$HUF]\\ #,##0.00",
+	491: "[$IDR]\\ #,##0.00",
+	492: "[$IEP]\\ #,##0.00",
+	493: "[$ILS]\\ #,##0.00",
+	494: "[$INR]\\ #,##0.00",
+	495: "[$IQD]\\ #,##0.00",
+	496: "[$IRR]\\ #,##0.00",
+	497: "[$ISK]\\ #,##0.00",
+	498: "[$ITL]\\ #,##0.00",
+	499: "[$JMD]\\ #,##0.00",
+	500: "[$JOD]\\ #,##0.00",
+	501: "[$JPY]\\ #,##0.00",
+	502: "[$KAF]\\ #,##0.00",
+	503: "[$KES]\\ #,##0.00",
+	504: "[$KGS]\\ #,##0.00",
+	505: "[$KHR]\\ #,##0.00",
+	506: "[$KMF]\\ #,##0.00",
+	507: "[$KPW]\\ #,##0.00",
+	508: "[$KRW]\\ #,##0.00",
+	509: "[$KWD]\\ #,##0.00",
+	510: "[$KYD]\\ #,##0.00",
+	511: "[$KZT]\\ #,##0.00",
+	512: "[$LAK]\\ #,##0.00",
+	513: "[$LBP]\\ #,##0.00",
+	514: "[$LKR]\\ #,##0.00",
+	515: "[$LRD]\\ #,##0.00",
+	516: "[$LSL]\\ #,##0.00",
+	517: "[$LTL]\\ #,##0.00",
+	518: "[$LUF]\\ #,##0.00",
+	519: "[$LVL]\\ #,##0.00",
+	520: "[$LYD]\\ #,##0.00",
+	521: "[$MAD]\\ #,##0.00",
+	522: "[$MDL]\\ #,##0.00",
+	523: "[$MGA]\\ #,##0.00",
+	524: "[$MGF]\\ #,##0.00",
+	525: "[$MKD]\\ #,##0.00",
+	526: "[$MMK]\\ #,##0.00",
+	527: "[$MNT]\\ #,##0.00",
+	528: "[$MOP]\\ #,##0.00",
+	529: "[$MRO]\\ #,##0.00",
+	530: "[$MTL]\\ #,##0.00",
+	531: "[$MUR]\\ #,##0.00",
+	532: "[$MVR]\\ #,##0.00",
+	533: "[$MWK]\\ #,##0.00",
+	534: "[$MXN]\\ #,##0.00",
+	535: "[$MXV]\\ #,##0.00",
+	536: "[$MYR]\\ #,##0.00",
+	537: "[$MZM]\\ #,##0.00",
+	538: "[$MZN]\\ #,##0.00",
+	539: "[$NAD]\\ #,##0.00",
+	540: "[$NGN]\\ #,##0.00",
+	541: "[$NIO]\\ #,##0.00",
+	542: "[$NLG]\\ #,##0.00",
+	543: "[$NOK]\\ #,##0.00",
+	544: "[$NPR]\\ #,##0.00",
+	545: "[$NTD]\\ #,##0.00",
+	546: "[$NZD]\\ #,##0.00",
+	547: "[$OMR]\\ #,##0.00",
+	548: "[$PAB]\\ #,##0.00",
+	549: "[$PEN]\\ #,##0.00",
+	550: "[$PGK]\\ #,##0.00",
+	551: "[$PHP]\\ #,##0.00",
+	552: "[$PKR]\\ #,##0.00",
+	553: "[$PLN]\\ #,##0.00",
+	554: "[$PTE]\\ #,##0.00",
+	555: "[$PYG]\\ #,##0.00",
+	556: "[$QAR]\\ #,##0.00",
+	557: "[$ROL]\\ #,##0.00",
+	558: "[$RON]\\ #,##0.00",
+	559: "[$RSD]\\ #,##0.00",
+	560: "[$RUB]\\ #,##0.00",
+	561: "[$RUR]\\ #,##0.00",
+	562: "[$RWF]\\ #,##0.00",
+	563: "[$SAR]\\ #,##0.00",
+	564: "[$SBD]\\ #,##0.00",
+	565: "[$SCR]\\ #,##0.00",
+	566: "[$SDD]\\ #,##0.00",
+	567: "[$SDG]\\ #,##0.00",
+	568: "[$SDP]\\ #,##0.00",
+	569: "[$SEK]\\ #,##0.00",
+	570: "[$SGD]\\ #,##0.00",
+	571: "[$SHP]\\ #,##0.00",
+	572: "[$SIT]\\ #,##0.00",
+	573: "[$SKK]\\ #,##0.00",
+	574: "[$SLL]\\ #,##0.00",
+	575: "[$SOS]\\ #,##0.00",
+	576: "[$SPL]\\ #,##0.00",
+	577: "[$SRD]\\ #,##0.00",
+	578: "[$SRG]\\ #,##0.00",
+	579: "[$STD]\\ #,##0.00",
+	580: "[$SVC]\\ #,##0.00",
+	581: "[$SYP]\\ #,##0.00",
+	582: "[$SZL]\\ #,##0.00",
+	583: "[$THB]\\ #,##0.00",
+	584: "[$TJR]\\ #,##0.00",
+	585: "[$TJS]\\ #,##0.00",
+	586: "[$TMM]\\ #,##0.00",
+	587: "[$TMT]\\ #,##0.00",
+	588: "[$TND]\\ #,##0.00",
+	589: "[$TOP]\\ #,##0.00",
+	590: "[$TRL]\\ #,##0.00",
+	591: "[$TRY]\\ #,##0.00",
+	592: "[$TTD]\\ #,##0.00",
+	593: "[$TWD]\\ #,##0.00",
+	594: "[$TZS]\\ #,##0.00",
+	595: "[$UAH]\\ #,##0.00",
+	596: "[$UGX]\\ #,##0.00",
+	597: "[$USD]\\ #,##0.00",
+	598: "[$USN]\\ #,##0.00",
+	599: "[$USS]\\ #,##0.00",
+	600: "[$UYI]\\ #,##0.00",
+	601: "[$UYU]\\ #,##0.00",
+	602: "[$UZS]\\ #,##0.00",
+	603: "[$VEB]\\ #,##0.00",
+	604: "[$VEF]\\ #,##0.00",
+	605: "[$VND]\\ #,##0.00",
+	606: "[$VUV]\\ #,##0.00",
+	607: "[$WST]\\ #,##0.00",
+	608: "[$XAF]\\ #,##0.00",
+	609: "[$XAG]\\ #,##0.00",
+	610: "[$XAU]\\ #,##0.00",
+	611: "[$XB5]\\ #,##0.00",
+	612: "[$XBA]\\ #,##0.00",
+	613: "[$XBB]\\ #,##0.00",
+	614: "[$XBC]\\ #,##0.00",
+	615: "[$XBD]\\ #,##0.00",
+	616: "[$XCD]\\ #,##0.00",
+	617: "[$XDR]\\ #,##0.00",
+	618: "[$XFO]\\ #,##0.00",
+	619: "[$XFU]\\ #,##0.00",
+	620: "[$XOF]\\ #,##0.00",
+	621: "[$XPD]\\ #,##0.00",
+	622: "[$XPF]\\ #,##0.00",
+	623: "[$XPT]\\ #,##0.00",
+	624: "[$XTS]\\ #,##0.00",
+	625: "[$XXX]\\ #,##0.00",
+	626: "[$YER]\\ #,##0.00",
+	627: "[$YUM]\\ #,##0.00",
+	628: "[$ZAR]\\ #,##0.00",
+	629: "[$ZMK]\\ #,##0.00",
+	630: "[$ZMW]\\ #,##0.00",
+	631: "[$ZWD]\\ #,##0.00",
+	632: "[$ZWL]\\ #,##0.00",
+	633: "[$ZWN]\\ #,##0.00",
+	634: "[$ZWR]\\ #,##0.00",
+}
+
+// builtInNumFmtFunc defined the format conversion functions map. Partial format
+// code doesn't support currently and will return original string.
+var builtInNumFmtFunc = map[int]func(i int, v string) string{
+	0:  formatToString,
+	1:  formatToInt,
+	2:  formatToFloat,
+	3:  formatToInt,
+	4:  formatToFloat,
+	9:  formatToC,
+	10: formatToD,
+	11: formatToE,
+	12: formatToString, // Doesn't support currently
+	13: formatToString, // Doesn't support currently
+	14: parseTime,
+	15: parseTime,
+	16: parseTime,
+	17: parseTime,
+	18: parseTime,
+	19: parseTime,
+	20: parseTime,
+	21: parseTime,
+	22: parseTime,
+	37: formatToA,
+	38: formatToA,
+	39: formatToB,
+	40: formatToB,
+	41: formatToString, // Doesn't support currently
+	42: formatToString, // Doesn't support currently
+	43: formatToString, // Doesn't support currently
+	44: formatToString, // Doesn't support currently
+	45: parseTime,
+	46: parseTime,
+	47: parseTime,
+	48: formatToE,
+	49: formatToString,
+}
+
+// validType defined the list of valid validation types.
+var validType = map[string]string{
+	"cell":          "cellIs",
+	"date":          "date", // Doesn't support currently
+	"time":          "time", // Doesn't support currently
+	"average":       "aboveAverage",
+	"duplicate":     "duplicateValues",
+	"unique":        "uniqueValues",
+	"top":           "top10",
+	"bottom":        "top10",
+	"text":          "text",              // Doesn't support currently
+	"time_period":   "timePeriod",        // Doesn't support currently
+	"blanks":        "containsBlanks",    // Doesn't support currently
+	"no_blanks":     "notContainsBlanks", // Doesn't support currently
+	"errors":        "containsErrors",    // Doesn't support currently
+	"no_errors":     "notContainsErrors", // Doesn't support currently
+	"2_color_scale": "2_color_scale",
+	"3_color_scale": "3_color_scale",
+	"data_bar":      "dataBar",
+	"formula":       "expression",
+}
+
+// criteriaType defined the list of valid criteria types.
+var criteriaType = map[string]string{
+	"between":                  "between",
+	"not between":              "notBetween",
+	"equal to":                 "equal",
+	"=":                        "equal",
+	"==":                       "equal",
+	"not equal to":             "notEqual",
+	"!=":                       "notEqual",
+	"<>":                       "notEqual",
+	"greater than":             "greaterThan",
+	">":                        "greaterThan",
+	"less than":                "lessThan",
+	"<":                        "lessThan",
+	"greater than or equal to": "greaterThanOrEqual",
+	">=":                       "greaterThanOrEqual",
+	"less than or equal to":    "lessThanOrEqual",
+	"<=":                       "lessThanOrEqual",
+	"containing":               "containsText",
+	"not containing":           "notContains",
+	"begins with":              "beginsWith",
+	"ends with":                "endsWith",
+	"yesterday":                "yesterday",
+	"today":                    "today",
+	"last 7 days":              "last7Days",
+	"last week":                "lastWeek",
+	"this week":                "thisWeek",
+	"continue week":            "continueWeek",
+	"last month":               "lastMonth",
+	"this month":               "thisMonth",
+	"continue month":           "continueMonth",
+}
+
+// formatToString provides a function to return original string by given
+// built-in number formats code and cell string.
+func formatToString(i int, v string) string {
+	return v
+}
+
+// formatToInt provides a function to convert original string to integer
+// format as string type by given built-in number formats code and cell
+// string.
+func formatToInt(i int, v string) string {
+	f, err := strconv.ParseFloat(v, 64)
+	if err != nil {
+		return v
+	}
+	return fmt.Sprintf("%d", int64(f))
+}
+
+// formatToFloat provides a function to convert original string to float
+// format as string type by given built-in number formats code and cell
+// string.
+func formatToFloat(i int, v string) string {
+	f, err := strconv.ParseFloat(v, 64)
+	if err != nil {
+		return v
+	}
+	return fmt.Sprintf("%.2f", f)
+}
+
+// formatToA provides a function to convert original string to special format
+// as string type by given built-in number formats code and cell string.
+func formatToA(i int, v string) string {
+	f, err := strconv.ParseFloat(v, 64)
+	if err != nil {
+		return v
+	}
+	if f < 0 {
+		t := int(math.Abs(f))
+		return fmt.Sprintf("(%d)", t)
+	}
+	t := int(f)
+	return fmt.Sprintf("%d", t)
+}
+
+// formatToB provides a function to convert original string to special format
+// as string type by given built-in number formats code and cell string.
+func formatToB(i int, v string) string {
+	f, err := strconv.ParseFloat(v, 64)
+	if err != nil {
+		return v
+	}
+	if f < 0 {
+		return fmt.Sprintf("(%.2f)", f)
+	}
+	return fmt.Sprintf("%.2f", f)
+}
+
+// formatToC provides a function to convert original string to special format
+// as string type by given built-in number formats code and cell string.
+func formatToC(i int, v string) string {
+	f, err := strconv.ParseFloat(v, 64)
+	if err != nil {
+		return v
+	}
+	f = f * 100
+	return fmt.Sprintf("%.f%%", f)
+}
+
+// formatToD provides a function to convert original string to special format
+// as string type by given built-in number formats code and cell string.
+func formatToD(i int, v string) string {
+	f, err := strconv.ParseFloat(v, 64)
+	if err != nil {
+		return v
+	}
+	f = f * 100
+	return fmt.Sprintf("%.2f%%", f)
+}
+
+// formatToE provides a function to convert original string to special format
+// as string type by given built-in number formats code and cell string.
+func formatToE(i int, v string) string {
+	f, err := strconv.ParseFloat(v, 64)
+	if err != nil {
+		return v
+	}
+	return fmt.Sprintf("%.e", f)
+}
+
+// parseTime provides a function to returns a string parsed using time.Time.
+// Replace Excel placeholders with Go time placeholders. For example, replace
+// yyyy with 2006. These are in a specific order, due to the fact that m is
+// used in month, minute, and am/pm. It would be easier to fix that with
+// regular expressions, but if it's possible to keep this simple it would be
+// easier to maintain. Full-length month and days (e.g. March, Tuesday) have
+// letters in them that would be replaced by other characters below (such as
+// the 'h' in March, or the 'd' in Tuesday) below. First we convert them to
+// arbitrary characters unused in Excel Date formats, and then at the end,
+// turn them to what they should actually be. Based off:
+// http://www.ozgrid.com/Excel/CustomFormats.htm
+func parseTime(i int, v string) string {
+	f, err := strconv.ParseFloat(v, 64)
+	if err != nil {
+		return v
+	}
+	val := timeFromExcelTime(f, false)
+	format := builtInNumFmt[i]
+
+	replacements := []struct{ xltime, gotime string }{
+		{"yyyy", "2006"},
+		{"yy", "06"},
+		{"mmmm", "%%%%"},
+		{"dddd", "&&&&"},
+		{"dd", "02"},
+		{"d", "2"},
+		{"mmm", "Jan"},
+		{"mmss", "0405"},
+		{"ss", "05"},
+		{"mm:", "04:"},
+		{":mm", ":04"},
+		{"mm", "01"},
+		{"am/pm", "pm"},
+		{"m/", "1/"},
+		{"%%%%", "January"},
+		{"&&&&", "Monday"},
+	}
+	// It is the presence of the "am/pm" indicator that determines if this is
+	// a 12 hour or 24 hours time format, not the number of 'h' characters.
+	if is12HourTime(format) {
+		format = strings.Replace(format, "hh", "03", 1)
+		format = strings.Replace(format, "h", "3", 1)
+	} else {
+		format = strings.Replace(format, "hh", "15", 1)
+		format = strings.Replace(format, "h", "15", 1)
+	}
+	for _, repl := range replacements {
+		format = strings.Replace(format, repl.xltime, repl.gotime, 1)
+	}
+	// If the hour is optional, strip it out, along with the possible dangling
+	// colon that would remain.
+	if val.Hour() < 1 {
+		format = strings.Replace(format, "]:", "]", 1)
+		format = strings.Replace(format, "[03]", "", 1)
+		format = strings.Replace(format, "[3]", "", 1)
+		format = strings.Replace(format, "[15]", "", 1)
+	} else {
+		format = strings.Replace(format, "[3]", "3", 1)
+		format = strings.Replace(format, "[15]", "15", 1)
+	}
+	return val.Format(format)
+}
+
+// is12HourTime checks whether an Excel time format string is a 12 hours form.
+func is12HourTime(format string) bool {
+	return strings.Contains(format, "am/pm") || strings.Contains(format, "AM/PM") || strings.Contains(format, "a/p") || strings.Contains(format, "A/P")
+}
+
+// stylesReader provides a function to get the pointer to the structure after
+// deserialization of xl/styles.xml.
+func (f *File) stylesReader() *xlsxStyleSheet {
+	var err error
+
+	if f.Styles == nil {
+		f.Styles = new(xlsxStyleSheet)
+		if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML("xl/styles.xml")))).
+			Decode(f.Styles); err != nil && err != io.EOF {
+			log.Printf("xml decode error: %s", err)
+		}
+	}
+
+	return f.Styles
+}
+
+// styleSheetWriter provides a function to save xl/styles.xml after serialize
+// structure.
+func (f *File) styleSheetWriter() {
+	if f.Styles != nil {
+		output, _ := xml.Marshal(f.Styles)
+		f.saveFileList("xl/styles.xml", f.replaceNameSpaceBytes("xl/styles.xml", output))
+	}
+}
+
+// sharedStringsWriter provides a function to save xl/sharedStrings.xml after
+// serialize structure.
+func (f *File) sharedStringsWriter() {
+	if f.SharedStrings != nil {
+		output, _ := xml.Marshal(f.SharedStrings)
+		f.saveFileList("xl/sharedStrings.xml", f.replaceNameSpaceBytes("xl/sharedStrings.xml", output))
+	}
+}
+
+// parseFormatStyleSet provides a function to parse the format settings of the
+// cells and conditional formats.
+func parseFormatStyleSet(style string) (*Style, error) {
+	format := Style{}
+	err := json.Unmarshal([]byte(style), &format)
+	return &format, err
+}
+
+// NewStyle provides a function to create the style for cells by given JSON or
+// structure pointer. Note that the color field uses RGB color code.
+//
+// The following shows the border styles sorted by excelize index number:
+//
+//     Index | Name          | Weight | Style
+//    -------+---------------+--------+-------------
+//     0     | None          | 0      |
+//     1     | Continuous    | 1      | -----------
+//     2     | Continuous    | 2      | -----------
+//     3     | Dash          | 1      | - - - - - -
+//     4     | Dot           | 1      | . . . . . .
+//     5     | Continuous    | 3      | -----------
+//     6     | Double        | 3      | ===========
+//     7     | Continuous    | 0      | -----------
+//     8     | Dash          | 2      | - - - - - -
+//     9     | Dash Dot      | 1      | - . - . - .
+//     10    | Dash Dot      | 2      | - . - . - .
+//     11    | Dash Dot Dot  | 1      | - . . - . .
+//     12    | Dash Dot Dot  | 2      | - . . - . .
+//     13    | SlantDash Dot | 2      | / - . / - .
+//
+// The following shows the borders in the order shown in the Excel dialog:
+//
+//     Index | Style       | Index | Style
+//    -------+-------------+-------+-------------
+//     0     | None        | 12    | - . . - . .
+//     7     | ----------- | 13    | / - . / - .
+//     4     | . . . . . . | 10    | - . - . - .
+//     11    | - . . - . . | 8     | - - - - - -
+//     9     | - . - . - . | 2     | -----------
+//     3     | - - - - - - | 5     | -----------
+//     1     | ----------- | 6     | ===========
+//
+// The following shows the shading styles sorted by excelize index number:
+//
+//     Index | Style           | Index | Style
+//    -------+-----------------+-------+-----------------
+//     0     | Horizontal      | 3     | Diagonal down
+//     1     | Vertical        | 4     | From corner
+//     2     | Diagonal Up     | 5     | From center
+//
+// The following shows the patterns styles sorted by excelize index number:
+//
+//     Index | Style           | Index | Style
+//    -------+-----------------+-------+-----------------
+//     0     | None            | 10    | darkTrellis
+//     1     | solid           | 11    | lightHorizontal
+//     2     | mediumGray      | 12    | lightVertical
+//     3     | darkGray        | 13    | lightDown
+//     4     | lightGray       | 14    | lightUp
+//     5     | darkHorizontal  | 15    | lightGrid
+//     6     | darkVertical    | 16    | lightTrellis
+//     7     | darkDown        | 17    | gray125
+//     8     | darkUp          | 18    | gray0625
+//     9     | darkGrid        |       |
+//
+// The following the type of horizontal alignment in cells:
+//
+//     Style
+//    ------------------
+//     left
+//     center
+//     right
+//     fill
+//     justify
+//     centerContinuous
+//     distributed
+//
+// The following the type of vertical alignment in cells:
+//
+//     Style
+//    ------------------
+//     top
+//     center
+//     justify
+//     distributed
+//
+// The following the type of font underline style:
+//
+//     Style
+//    ------------------
+//     single
+//     double
+//
+// Excel's built-in all languages formats are shown in the following table:
+//
+//     Index | Format String
+//    -------+----------------------------------------------------
+//     0     | General
+//     1     | 0
+//     2     | 0.00
+//     3     | #,##0
+//     4     | #,##0.00
+//     5     | ($#,##0_);($#,##0)
+//     6     | ($#,##0_);[Red]($#,##0)
+//     7     | ($#,##0.00_);($#,##0.00)
+//     8     | ($#,##0.00_);[Red]($#,##0.00)
+//     9     | 0%
+//     10    | 0.00%
+//     11    | 0.00E+00
+//     12    | # ?/?
+//     13    | # ??/??
+//     14    | m/d/yy
+//     15    | d-mmm-yy
+//     16    | d-mmm
+//     17    | mmm-yy
+//     18    | h:mm AM/PM
+//     19    | h:mm:ss AM/PM
+//     20    | h:mm
+//     21    | h:mm:ss
+//     22    | m/d/yy h:mm
+//     ...   | ...
+//     37    | (#,##0_);(#,##0)
+//     38    | (#,##0_);[Red](#,##0)
+//     39    | (#,##0.00_);(#,##0.00)
+//     40    | (#,##0.00_);[Red](#,##0.00)
+//     41    | _(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)
+//     42    | _($* #,##0_);_($* (#,##0);_($* "-"_);_(@_)
+//     43    | _(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)
+//     44    | _($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)
+//     45    | mm:ss
+//     46    | [h]:mm:ss
+//     47    | mm:ss.0
+//     48    | ##0.0E+0
+//     49    | @
+//
+// Number format code in zh-tw language:
+//
+//     Index | Symbol
+//    -------+-------------------------------------------
+//     27    | [$-404]e/m/d
+//     28    | [$-404]e"年"m"月"d"日"
+//     29    | [$-404]e"年"m"月"d"日"
+//     30    | m/d/yy
+//     31    | yyyy"年"m"月"d"日"
+//     32    | hh"時"mm"分"
+//     33    | hh"時"mm"分"ss"秒"
+//     34    | 上午/下午 hh"時"mm"分"
+//     35    | 上午/下午 hh"時"mm"分"ss"秒"
+//     36    | [$-404]e/m/d
+//     50    | [$-404]e/m/d
+//     51    | [$-404]e"年"m"月"d"日"
+//     52    | 上午/下午 hh"時"mm"分"
+//     53    | 上午/下午 hh"時"mm"分"ss"秒"
+//     54    | [$-404]e"年"m"月"d"日"
+//     55    | 上午/下午 hh"時"mm"分"
+//     56    | 上午/下午 hh"時"mm"分"ss"秒"
+//     57    | [$-404]e/m/d
+//     58    | [$-404]e"年"m"月"d"日"
+//
+// Number format code in zh-cn language:
+//
+//     Index | Symbol
+//    -------+-------------------------------------------
+//     27    | yyyy"年"m"月"
+//     28    | m"月"d"日"
+//     29    | m"月"d"日"
+//     30    | m-d-yy
+//     31    | yyyy"年"m"月"d"日"
+//     32    | h"时"mm"分"
+//     33    | h"时"mm"分"ss"秒"
+//     34    | 上午/下午 h"时"mm"分"
+//     35    | 上午/下午 h"时"mm"分"ss"秒
+//     36    | yyyy"年"m"月
+//     50    | yyyy"年"m"月
+//     51    | m"月"d"日
+//     52    | yyyy"年"m"月
+//     53    | m"月"d"日
+//     54    | m"月"d"日
+//     55    | 上午/下午 h"时"mm"分
+//     56    | 上午/下午 h"时"mm"分"ss"秒
+//     57    | yyyy"年"m"月
+//     58    | m"月"d"日"
+//
+// Number format code with unicode values provided for language glyphs where
+// they occur in zh-tw language:
+//
+//     Index | Symbol
+//    -------+-------------------------------------------
+//     27    | [$-404]e/m/
+//     28    | [$-404]e"5E74"m"6708"d"65E5
+//     29    | [$-404]e"5E74"m"6708"d"65E5
+//     30    | m/d/y
+//     31    | yyyy"5E74"m"6708"d"65E5
+//     32    | hh"6642"mm"5206
+//     33    | hh"6642"mm"5206"ss"79D2
+//     34    | 4E0A5348/4E0B5348hh"6642"mm"5206
+//     35    | 4E0A5348/4E0B5348hh"6642"mm"5206"ss"79D2
+//     36    | [$-404]e/m/
+//     50    | [$-404]e/m/
+//     51    | [$-404]e"5E74"m"6708"d"65E5
+//     52    | 4E0A5348/4E0B5348hh"6642"mm"5206
+//     53    | 4E0A5348/4E0B5348hh"6642"mm"5206"ss"79D2
+//     54    | [$-404]e"5E74"m"6708"d"65E5
+//     55    | 4E0A5348/4E0B5348hh"6642"mm"5206
+//     56    | 4E0A5348/4E0B5348hh"6642"mm"5206"ss"79D2
+//     57    | [$-404]e/m/
+//     58    | [$-404]e"5E74"m"6708"d"65E5"
+//
+// Number format code with unicode values provided for language glyphs where
+// they occur in zh-cn language:
+//
+//     Index | Symbol
+//    -------+-------------------------------------------
+//     27    | yyyy"5E74"m"6708
+//     28    | m"6708"d"65E5
+//     29    | m"6708"d"65E5
+//     30    | m-d-y
+//     31    | yyyy"5E74"m"6708"d"65E5
+//     32    | h"65F6"mm"5206
+//     33    | h"65F6"mm"5206"ss"79D2
+//     34    | 4E0A5348/4E0B5348h"65F6"mm"5206
+//     35    | 4E0A5348/4E0B5348h"65F6"mm"5206"ss"79D2
+//     36    | yyyy"5E74"m"6708
+//     50    | yyyy"5E74"m"6708
+//     51    | m"6708"d"65E5
+//     52    | yyyy"5E74"m"6708
+//     53    | m"6708"d"65E5
+//     54    | m"6708"d"65E5
+//     55    | 4E0A5348/4E0B5348h"65F6"mm"5206
+//     56    | 4E0A5348/4E0B5348h"65F6"mm"5206"ss"79D2
+//     57    | yyyy"5E74"m"6708
+//     58    | m"6708"d"65E5"
+//
+// Number format code in ja-jp language:
+//
+//     Index | Symbol
+//    -------+-------------------------------------------
+//     27    | [$-411]ge.m.d
+//     28    | [$-411]ggge"年"m"月"d"日
+//     29    | [$-411]ggge"年"m"月"d"日
+//     30    | m/d/y
+//     31    | yyyy"年"m"月"d"日
+//     32    | h"時"mm"分
+//     33    | h"時"mm"分"ss"秒
+//     34    | yyyy"年"m"月
+//     35    | m"月"d"日
+//     36    | [$-411]ge.m.d
+//     50    | [$-411]ge.m.d
+//     51    | [$-411]ggge"年"m"月"d"日
+//     52    | yyyy"年"m"月
+//     53    | m"月"d"日
+//     54    | [$-411]ggge"年"m"月"d"日
+//     55    | yyyy"年"m"月
+//     56    | m"月"d"日
+//     57    | [$-411]ge.m.d
+//     58    | [$-411]ggge"年"m"月"d"日"
+//
+// Number format code in ko-kr language:
+//
+//     Index | Symbol
+//    -------+-------------------------------------------
+//     27    | yyyy"年" mm"月" dd"日
+//     28    | mm-d
+//     29    | mm-d
+//     30    | mm-dd-y
+//     31    | yyyy"년" mm"월" dd"일
+//     32    | h"시" mm"분
+//     33    | h"시" mm"분" ss"초
+//     34    | yyyy-mm-d
+//     35    | yyyy-mm-d
+//     36    | yyyy"年" mm"月" dd"日
+//     50    | yyyy"年" mm"月" dd"日
+//     51    | mm-d
+//     52    | yyyy-mm-d
+//     53    | yyyy-mm-d
+//     54    | mm-d
+//     55    | yyyy-mm-d
+//     56    | yyyy-mm-d
+//     57    | yyyy"年" mm"月" dd"日
+//     58    | mm-dd
+//
+// Number format code with unicode values provided for language glyphs where
+// they occur in ja-jp language:
+//
+//     Index | Symbol
+//    -------+-------------------------------------------
+//     27    | [$-411]ge.m.d
+//     28    | [$-411]ggge"5E74"m"6708"d"65E5
+//     29    | [$-411]ggge"5E74"m"6708"d"65E5
+//     30    | m/d/y
+//     31    | yyyy"5E74"m"6708"d"65E5
+//     32    | h"6642"mm"5206
+//     33    | h"6642"mm"5206"ss"79D2
+//     34    | yyyy"5E74"m"6708
+//     35    | m"6708"d"65E5
+//     36    | [$-411]ge.m.d
+//     50    | [$-411]ge.m.d
+//     51    | [$-411]ggge"5E74"m"6708"d"65E5
+//     52    | yyyy"5E74"m"6708
+//     53    | m"6708"d"65E5
+//     54    | [$-411]ggge"5E74"m"6708"d"65E5
+//     55    | yyyy"5E74"m"6708
+//     56    | m"6708"d"65E5
+//     57    | [$-411]ge.m.d
+//     58    | [$-411]ggge"5E74"m"6708"d"65E5"
+//
+// Number format code with unicode values provided for language glyphs where
+// they occur in ko-kr language:
+//
+//     Index | Symbol
+//    -------+-------------------------------------------
+//     27    | yyyy"5E74" mm"6708" dd"65E5
+//     28    | mm-d
+//     29    | mm-d
+//     30    | mm-dd-y
+//     31    | yyyy"B144" mm"C6D4" dd"C77C
+//     32    | h"C2DC" mm"BD84
+//     33    | h"C2DC" mm"BD84" ss"CD08
+//     34    | yyyy-mm-d
+//     35    | yyyy-mm-d
+//     36    | yyyy"5E74" mm"6708" dd"65E5
+//     50    | yyyy"5E74" mm"6708" dd"65E5
+//     51    | mm-d
+//     52    | yyyy-mm-d
+//     53    | yyyy-mm-d
+//     54    | mm-d
+//     55    | yyyy-mm-d
+//     56    | yyyy-mm-d
+//     57    | yyyy"5E74" mm"6708" dd"65E5
+//     58    | mm-dd
+//
+// Number format code in th-th language:
+//
+//     Index | Symbol
+//    -------+-------------------------------------------
+//     59    | t
+//     60    | t0.0
+//     61    | t#,##
+//     62    | t#,##0.0
+//     67    | t0
+//     68    | t0.00
+//     69    | t# ?/
+//     70    | t# ??/?
+//     71    | ว/ด/ปปป
+//     72    | ว-ดดด-ป
+//     73    | ว-ดด
+//     74    | ดดด-ป
+//     75    | ช:น
+//     76    | ช:นน:ท
+//     77    | ว/ด/ปปปป ช:น
+//     78    | นน:ท
+//     79    | [ช]:นน:ท
+//     80    | นน:ทท.
+//     81    | d/m/bb
+//
+// Number format code with unicode values provided for language glyphs where
+// they occur in th-th language:
+//
+//     Index | Symbol
+//    -------+-------------------------------------------
+//     59    | t
+//     60    | t0.0
+//     61    | t#,##
+//     62    | t#,##0.0
+//     67    | t0
+//     68    | t0.00
+//     69    | t# ?/
+//     70    | t# ??/?
+//     71    | 0E27/0E14/0E1B0E1B0E1B0E1
+//     72    | 0E27-0E140E140E14-0E1B0E1
+//     73    | 0E27-0E140E140E1
+//     74    | 0E140E140E14-0E1B0E1
+//     75    | 0E0A:0E190E1
+//     76    | 0E0A:0E190E19:0E170E1
+//     77    | 0E27/0E14/0E1B0E1B0E1B0E1B 0E0A:0E190E1
+//     78    | 0E190E19:0E170E1
+//     79    | [0E0A]:0E190E19:0E170E1
+//     80    | 0E190E19:0E170E17.
+//     81    | d/m/bb
+//
+// Excelize built-in currency formats are shown in the following table, only
+// support these types in the following table (Index number is used only for
+// markup and is not used inside an Excel file and you can't get formatted value
+// by the function GetCellValue) currently:
+//
+//     Index | Symbol
+//    -------+---------------------------------------------------------------
+//     164   | CN¥
+//     165   | $ English (China)
+//     166   | $ Cherokee (United States)
+//     167   | $ Chinese (Singapore)
+//     168   | $ Chinese (Taiwan)
+//     169   | $ English (Australia)
+//     170   | $ English (Belize)
+//     171   | $ English (Canada)
+//     172   | $ English (Jamaica)
+//     173   | $ English (New Zealand)
+//     174   | $ English (Singapore)
+//     175   | $ English (Trinidad & Tobago)
+//     176   | $ English (U.S. Virgin Islands)
+//     177   | $ English (United States)
+//     178   | $ French (Canada)
+//     179   | $ Hawaiian (United States)
+//     180   | $ Malay (Brunei)
+//     181   | $ Quechua (Ecuador)
+//     182   | $ Spanish (Chile)
+//     183   | $ Spanish (Colombia)
+//     184   | $ Spanish (Ecuador)
+//     185   | $ Spanish (El Salvador)
+//     186   | $ Spanish (Mexico)
+//     187   | $ Spanish (Puerto Rico)
+//     188   | $ Spanish (United States)
+//     189   | $ Spanish (Uruguay)
+//     190   | £ English (United Kingdom)
+//     191   | £ Scottish Gaelic (United Kingdom)
+//     192   | £ Welsh (United Kindom)
+//     193   | ¥ Chinese (China)
+//     194   | ¥ Japanese (Japan)
+//     195   | ¥ Sichuan Yi (China)
+//     196   | ¥ Tibetan (China)
+//     197   | ¥ Uyghur (China)
+//     198   | ֏ Armenian (Armenia)
+//     199   | ؋ Pashto (Afghanistan)
+//     200   | ؋ Persian (Afghanistan)
+//     201   | ৳ Bengali (Bangladesh)
+//     202   | ៛ Khmer (Cambodia)
+//     203   | ₡ Spanish (Costa Rica)
+//     204   | ₦ Hausa (Nigeria)
+//     205   | ₦ Igbo (Nigeria)
+//     206   | ₦ Yoruba (Nigeria)
+//     207   | ₩ Korean (South Korea)
+//     208   | ₪ Hebrew (Israel)
+//     209   | ₫ Vietnamese (Vietnam)
+//     210   | € Basque (Spain)
+//     211   | € Breton (France)
+//     212   | € Catalan (Spain)
+//     213   | € Corsican (France)
+//     214   | € Dutch (Belgium)
+//     215   | € Dutch (Netherlands)
+//     216   | € English (Ireland)
+//     217   | € Estonian (Estonia)
+//     218   | € Euro (€ 123)
+//     219   | € Euro (123 €)
+//     220   | € Finnish (Finland)
+//     221   | € French (Belgium)
+//     222   | € French (France)
+//     223   | € French (Luxembourg)
+//     224   | € French (Monaco)
+//     225   | € French (Réunion)
+//     226   | € Galician (Spain)
+//     227   | € German (Austria)
+//     228   | € German (Luxembourg)
+//     229   | € Greek (Greece)
+//     230   | € Inari Sami (Finland)
+//     231   | € Irish (Ireland)
+//     232   | € Italian (Italy)
+//     233   | € Latin (Italy)
+//     234   | € Latin, Serbian (Montenegro)
+//     235   | € Larvian (Latvia)
+//     236   | € Lithuanian (Lithuania)
+//     237   | € Lower Sorbian (Germany)
+//     238   | € Luxembourgish (Luxembourg)
+//     239   | € Maltese (Malta)
+//     240   | € Northern Sami (Finland)
+//     241   | € Occitan (France)
+//     242   | € Portuguese (Portugal)
+//     243   | € Serbian (Montenegro)
+//     244   | € Skolt Sami (Finland)
+//     245   | € Slovak (Slovakia)
+//     246   | € Slovenian (Slovenia)
+//     247   | € Spanish (Spain)
+//     248   | € Swedish (Finland)
+//     249   | € Swiss German (France)
+//     250   | € Upper Sorbian (Germany)
+//     251   | € Western Frisian (Netherlands)
+//     252   | ₭ Lao (Laos)
+//     253   | ₮ Mongolian (Mongolia)
+//     254   | ₮ Mongolian, Mongolian (Mongolia)
+//     255   | ₱ English (Philippines)
+//     256   | ₱ Filipino (Philippines)
+//     257   | ₴ Ukrainian (Ukraine)
+//     258   | ₸ Kazakh (Kazakhstan)
+//     259   | ₹ Arabic, Kashmiri (India)
+//     260   | ₹ English (India)
+//     261   | ₹ Gujarati (India)
+//     262   | ₹ Hindi (India)
+//     263   | ₹ Kannada (India)
+//     264   | ₹ Kashmiri (India)
+//     265   | ₹ Konkani (India)
+//     266   | ₹ Manipuri (India)
+//     267   | ₹ Marathi (India)
+//     268   | ₹ Nepali (India)
+//     269   | ₹ Oriya (India)
+//     270   | ₹ Punjabi (India)
+//     271   | ₹ Sanskrit (India)
+//     272   | ₹ Sindhi (India)
+//     273   | ₹ Tamil (India)
+//     274   | ₹ Urdu (India)
+//     275   | ₺ Turkish (Turkey)
+//     276   | ₼ Azerbaijani (Azerbaijan)
+//     277   | ₼ Cyrillic, Azerbaijani (Azerbaijan)
+//     278   | ₽ Russian (Russia)
+//     279   | ₽ Sakha (Russia)
+//     280   | ₾ Georgian (Georgia)
+//     281   | B/. Spanish (Panama)
+//     282   | Br Oromo (Ethiopia)
+//     283   | Br Somali (Ethiopia)
+//     284   | Br Tigrinya (Ethiopia)
+//     285   | Bs Quechua (Bolivia)
+//     286   | Bs Spanish (Bolivia)
+//     287   | BS. Spanish (Venezuela)
+//     288   | BWP Tswana (Botswana)
+//     289   | C$ Spanish (Nicaragua)
+//     290   | CA$ Latin, Inuktitut (Canada)
+//     291   | CA$ Mohawk (Canada)
+//     292   | CA$ Unified Canadian Aboriginal Syllabics, Inuktitut (Canada)
+//     293   | CFA French (Mali)
+//     294   | CFA French (Senegal)
+//     295   | CFA Fulah (Senegal)
+//     296   | CFA Wolof (Senegal)
+//     297   | CHF French (Switzerland)
+//     298   | CHF German (Liechtenstein)
+//     299   | CHF German (Switzerland)
+//     300   | CHF Italian (Switzerland)
+//     301   | CHF Romansh (Switzerland)
+//     302   | CLP Mapuche (Chile)
+//     303   | CN¥ Mongolian, Mongolian (China)
+//     304   | DZD Central Atlas Tamazight (Algeria)
+//     305   | FCFA French (Cameroon)
+//     306   | Ft Hungarian (Hungary)
+//     307   | G French (Haiti)
+//     308   | Gs. Spanish (Paraguay)
+//     309   | GTQ K'iche' (Guatemala)
+//     310   | HK$ Chinese (Hong Kong (China))
+//     311   | HK$ English (Hong Kong (China))
+//     312   | HRK Croatian (Croatia)
+//     313   | IDR English (Indonesia)
+//     314   | IQD Arbic, Central Kurdish (Iraq)
+//     315   | ISK Icelandic (Iceland)
+//     316   | K Burmese (Myanmar (Burma))
+//     317   | Kč Czech (Czech Republic)
+//     318   | KM Bosnian (Bosnia & Herzegovina)
+//     319   | KM Croatian (Bosnia & Herzegovina)
+//     320   | KM Latin, Serbian (Bosnia & Herzegovina)
+//     321   | kr Faroese (Faroe Islands)
+//     322   | kr Northern Sami (Norway)
+//     323   | kr Northern Sami (Sweden)
+//     324   | kr Norwegian Bokmål (Norway)
+//     325   | kr Norwegian Nynorsk (Norway)
+//     326   | kr Swedish (Sweden)
+//     327   | kr. Danish (Denmark)
+//     328   | kr. Kalaallisut (Greenland)
+//     329   | Ksh Swahili (kenya)
+//     330   | L Romanian (Moldova)
+//     331   | L Russian (Moldova)
+//     332   | L Spanish (Honduras)
+//     333   | Lekë Albanian (Albania)
+//     334   | MAD Arabic, Central Atlas Tamazight (Morocco)
+//     335   | MAD French (Morocco)
+//     336   | MAD Tifinagh, Central Atlas Tamazight (Morocco)
+//     337   | MOP$ Chinese (Macau (China))
+//     338   | MVR Divehi (Maldives)
+//     339   | Nfk Tigrinya (Eritrea)
+//     340   | NGN Bini (Nigeria)
+//     341   | NGN Fulah (Nigeria)
+//     342   | NGN Ibibio (Nigeria)
+//     343   | NGN Kanuri (Nigeria)
+//     344   | NOK Lule Sami (Norway)
+//     345   | NOK Southern Sami (Norway)
+//     346   | NZ$ Maori (New Zealand)
+//     347   | PKR Sindhi (Pakistan)
+//     348   | PYG Guarani (Paraguay)
+//     349   | Q Spanish (Guatemala)
+//     350   | R Afrikaans (South Africa)
+//     351   | R English (South Africa)
+//     352   | R Zulu (South Africa)
+//     353   | R$ Portuguese (Brazil)
+//     354   | RD$ Spanish (Dominican Republic)
+//     355   | RF Kinyarwanda (Rwanda)
+//     356   | RM English (Malaysia)
+//     357   | RM Malay (Malaysia)
+//     358   | RON Romanian (Romania)
+//     359   | Rp Indonesoan (Indonesia)
+//     360   | Rs Urdu (Pakistan)
+//     361   | Rs. Tamil (Sri Lanka)
+//     362   | RSD Latin, Serbian (Serbia)
+//     363   | RSD Serbian (Serbia)
+//     364   | RUB Bashkir (Russia)
+//     365   | RUB Tatar (Russia)
+//     366   | S/. Quechua (Peru)
+//     367   | S/. Spanish (Peru)
+//     368   | SEK Lule Sami (Sweden)
+//     369   | SEK Southern Sami (Sweden)
+//     370   | soʻm Latin, Uzbek (Uzbekistan)
+//     371   | soʻm Uzbek (Uzbekistan)
+//     372   | SYP Syriac (Syria)
+//     373   | THB Thai (Thailand)
+//     374   | TMT Turkmen (Turkmenistan)
+//     375   | US$ English (Zimbabwe)
+//     376   | ZAR Northern Sotho (South Africa)
+//     377   | ZAR Southern Sotho (South Africa)
+//     378   | ZAR Tsonga (South Africa)
+//     379   | ZAR Tswana (south Africa)
+//     380   | ZAR Venda (South Africa)
+//     381   | ZAR Xhosa (South Africa)
+//     382   | zł Polish (Poland)
+//     383   | ден Macedonian (Macedonia)
+//     384   | KM Cyrillic, Bosnian (Bosnia & Herzegovina)
+//     385   | KM Serbian (Bosnia & Herzegovina)
+//     386   | лв. Bulgarian (Bulgaria)
+//     387   | p. Belarusian (Belarus)
+//     388   | сом Kyrgyz (Kyrgyzstan)
+//     389   | сом Tajik (Tajikistan)
+//     390   | ج.م. Arabic (Egypt)
+//     391   | د.أ. Arabic (Jordan)
+//     392   | د.أ. Arabic (United Arab Emirates)
+//     393   | د.ب. Arabic (Bahrain)
+//     394   | د.ت. Arabic (Tunisia)
+//     395   | د.ج. Arabic (Algeria)
+//     396   | د.ع. Arabic (Iraq)
+//     397   | د.ك. Arabic (Kuwait)
+//     398   | د.ل. Arabic (Libya)
+//     399   | د.م. Arabic (Morocco)
+//     400   | ر Punjabi (Pakistan)
+//     401   | ر.س. Arabic (Saudi Arabia)
+//     402   | ر.ع. Arabic (Oman)
+//     403   | ر.ق. Arabic (Qatar)
+//     404   | ر.ي. Arabic (Yemen)
+//     405   | ریال Persian (Iran)
+//     406   | ل.س. Arabic (Syria)
+//     407   | ل.ل. Arabic (Lebanon)
+//     408   | ብር Amharic (Ethiopia)
+//     409   | रू Nepaol (Nepal)
+//     410   | රු. Sinhala (Sri Lanka)
+//     411   | ADP
+//     412   | AED
+//     413   | AFA
+//     414   | AFN
+//     415   | ALL
+//     416   | AMD
+//     417   | ANG
+//     418   | AOA
+//     419   | ARS
+//     420   | ATS
+//     421   | AUD
+//     422   | AWG
+//     423   | AZM
+//     424   | AZN
+//     425   | BAM
+//     426   | BBD
+//     427   | BDT
+//     428   | BEF
+//     429   | BGL
+//     430   | BGN
+//     431   | BHD
+//     432   | BIF
+//     433   | BMD
+//     434   | BND
+//     435   | BOB
+//     436   | BOV
+//     437   | BRL
+//     438   | BSD
+//     439   | BTN
+//     440   | BWP
+//     441   | BYR
+//     442   | BZD
+//     443   | CAD
+//     444   | CDF
+//     445   | CHE
+//     446   | CHF
+//     447   | CHW
+//     448   | CLF
+//     449   | CLP
+//     450   | CNY
+//     451   | COP
+//     452   | COU
+//     453   | CRC
+//     454   | CSD
+//     455   | CUC
+//     456   | CVE
+//     457   | CYP
+//     458   | CZK
+//     459   | DEM
+//     460   | DJF
+//     461   | DKK
+//     462   | DOP
+//     463   | DZD
+//     464   | ECS
+//     465   | ECV
+//     466   | EEK
+//     467   | EGP
+//     468   | ERN
+//     469   | ESP
+//     470   | ETB
+//     471   | EUR
+//     472   | FIM
+//     473   | FJD
+//     474   | FKP
+//     475   | FRF
+//     476   | GBP
+//     477   | GEL
+//     478   | GHC
+//     479   | GHS
+//     480   | GIP
+//     481   | GMD
+//     482   | GNF
+//     483   | GRD
+//     484   | GTQ
+//     485   | GYD
+//     486   | HKD
+//     487   | HNL
+//     488   | HRK
+//     489   | HTG
+//     490   | HUF
+//     491   | IDR
+//     492   | IEP
+//     493   | ILS
+//     494   | INR
+//     495   | IQD
+//     496   | IRR
+//     497   | ISK
+//     498   | ITL
+//     499   | JMD
+//     500   | JOD
+//     501   | JPY
+//     502   | KAF
+//     503   | KES
+//     504   | KGS
+//     505   | KHR
+//     506   | KMF
+//     507   | KPW
+//     508   | KRW
+//     509   | KWD
+//     510   | KYD
+//     511   | KZT
+//     512   | LAK
+//     513   | LBP
+//     514   | LKR
+//     515   | LRD
+//     516   | LSL
+//     517   | LTL
+//     518   | LUF
+//     519   | LVL
+//     520   | LYD
+//     521   | MAD
+//     522   | MDL
+//     523   | MGA
+//     524   | MGF
+//     525   | MKD
+//     526   | MMK
+//     527   | MNT
+//     528   | MOP
+//     529   | MRO
+//     530   | MTL
+//     531   | MUR
+//     532   | MVR
+//     533   | MWK
+//     534   | MXN
+//     535   | MXV
+//     536   | MYR
+//     537   | MZM
+//     538   | MZN
+//     539   | NAD
+//     540   | NGN
+//     541   | NIO
+//     542   | NLG
+//     543   | NOK
+//     544   | NPR
+//     545   | NTD
+//     546   | NZD
+//     547   | OMR
+//     548   | PAB
+//     549   | PEN
+//     550   | PGK
+//     551   | PHP
+//     552   | PKR
+//     553   | PLN
+//     554   | PTE
+//     555   | PYG
+//     556   | QAR
+//     557   | ROL
+//     558   | RON
+//     559   | RSD
+//     560   | RUB
+//     561   | RUR
+//     562   | RWF
+//     563   | SAR
+//     564   | SBD
+//     565   | SCR
+//     566   | SDD
+//     567   | SDG
+//     568   | SDP
+//     569   | SEK
+//     570   | SGD
+//     571   | SHP
+//     572   | SIT
+//     573   | SKK
+//     574   | SLL
+//     575   | SOS
+//     576   | SPL
+//     577   | SRD
+//     578   | SRG
+//     579   | STD
+//     580   | SVC
+//     581   | SYP
+//     582   | SZL
+//     583   | THB
+//     584   | TJR
+//     585   | TJS
+//     586   | TMM
+//     587   | TMT
+//     588   | TND
+//     589   | TOP
+//     590   | TRL
+//     591   | TRY
+//     592   | TTD
+//     593   | TWD
+//     594   | TZS
+//     595   | UAH
+//     596   | UGX
+//     597   | USD
+//     598   | USN
+//     599   | USS
+//     600   | UYI
+//     601   | UYU
+//     602   | UZS
+//     603   | VEB
+//     604   | VEF
+//     605   | VND
+//     606   | VUV
+//     607   | WST
+//     608   | XAF
+//     609   | XAG
+//     610   | XAU
+//     611   | XB5
+//     612   | XBA
+//     613   | XBB
+//     614   | XBC
+//     615   | XBD
+//     616   | XCD
+//     617   | XDR
+//     618   | XFO
+//     619   | XFU
+//     620   | XOF
+//     621   | XPD
+//     622   | XPF
+//     623   | XPT
+//     624   | XTS
+//     625   | XXX
+//     626   | YER
+//     627   | YUM
+//     628   | ZAR
+//     629   | ZMK
+//     630   | ZMW
+//     631   | ZWD
+//     632   | ZWL
+//     633   | ZWN
+//     634   | ZWR
+//
+// Excelize support set custom number format for cell. For example, set number
+// as date type in Uruguay (Spanish) format for Sheet1!A6:
+//
+//    f := excelize.NewFile()
+//    f.SetCellValue("Sheet1", "A6", 42920.5)
+//    exp := "[$-380A]dddd\\,\\ dd\" de \"mmmm\" de \"yyyy;@"
+//    style, err := f.NewStyle(&excelize.Style{CustomNumFmt: &exp})
+//    err = f.SetCellStyle("Sheet1", "A6", "A6", style)
+//
+// Cell Sheet1!A6 in the Excel Application: martes, 04 de Julio de 2017
+//
+func (f *File) NewStyle(style interface{}) (int, error) {
+	var fs *Style
+	var err error
+	var cellXfsID, fontID, borderID, fillID int
+	switch v := style.(type) {
+	case string:
+		fs, err = parseFormatStyleSet(v)
+		if err != nil {
+			return cellXfsID, err
+		}
+	case *Style:
+		fs = v
+	default:
+		return cellXfsID, errors.New("invalid parameter type")
+	}
+	if fs.DecimalPlaces == 0 {
+		fs.DecimalPlaces = 2
+	}
+	s := f.stylesReader()
+	// check given style already exist.
+	if cellXfsID = f.getStyleID(s, fs); cellXfsID != -1 {
+		return cellXfsID, err
+	}
+
+	numFmtID := newNumFmt(s, fs)
+
+	if fs.Font != nil {
+		fontID = f.getFontID(s, fs)
+		if fontID == -1 {
+			s.Fonts.Count++
+			s.Fonts.Font = append(s.Fonts.Font, f.newFont(fs))
+			fontID = s.Fonts.Count - 1
+		}
+	}
+
+	borderID = getBorderID(s, fs)
+	if borderID == -1 {
+		if len(fs.Border) == 0 {
+			borderID = 0
+		} else {
+			s.Borders.Count++
+			s.Borders.Border = append(s.Borders.Border, newBorders(fs))
+			borderID = s.Borders.Count - 1
+		}
+	}
+
+	if fillID = getFillID(s, fs); fillID == -1 {
+		if fill := newFills(fs, true); fill != nil {
+			s.Fills.Count++
+			s.Fills.Fill = append(s.Fills.Fill, fill)
+			fillID = s.Fills.Count - 1
+		} else {
+			fillID = 0
+		}
+	}
+
+	applyAlignment, alignment := fs.Alignment != nil, newAlignment(fs)
+	applyProtection, protection := fs.Protection != nil, newProtection(fs)
+	cellXfsID = setCellXfs(s, fontID, numFmtID, fillID, borderID, applyAlignment, applyProtection, alignment, protection)
+	return cellXfsID, nil
+}
+
+var getXfIDFuncs = map[string]func(int, xlsxXf, *Style) bool{
+	"numFmt": func(numFmtID int, xf xlsxXf, style *Style) bool {
+		if style.NumFmt == 0 && style.CustomNumFmt == nil && numFmtID == -1 {
+			return xf.NumFmtID != nil || *xf.NumFmtID == 0
+		}
+		if style.NegRed || style.Lang != "" || style.DecimalPlaces != 2 {
+			return false
+		}
+		return xf.NumFmtID != nil && *xf.NumFmtID == numFmtID
+	},
+	"font": func(fontID int, xf xlsxXf, style *Style) bool {
+		if style.Font == nil {
+			return (xf.FontID == nil || *xf.FontID == 0) && (xf.ApplyFont == nil || *xf.ApplyFont == false)
+		}
+		return xf.FontID != nil && *xf.FontID == fontID && xf.ApplyFont != nil && *xf.ApplyFont == true
+	},
+	"fill": func(fillID int, xf xlsxXf, style *Style) bool {
+		if style.Fill.Type == "" {
+			return (xf.FillID == nil || *xf.FillID == 0) && (xf.ApplyFill == nil || *xf.ApplyFill == false)
+		}
+		return xf.FillID != nil && *xf.FillID == fillID && xf.ApplyFill != nil && *xf.ApplyFill == true
+	},
+	"border": func(borderID int, xf xlsxXf, style *Style) bool {
+		if len(style.Border) == 0 {
+			return (xf.BorderID == nil || *xf.BorderID == 0) && (xf.ApplyBorder == nil || *xf.ApplyBorder == false)
+		}
+		return xf.BorderID != nil && *xf.BorderID == borderID && xf.ApplyBorder != nil && *xf.ApplyBorder == true
+	},
+	"alignment": func(ID int, xf xlsxXf, style *Style) bool {
+		if style.Alignment == nil {
+			return xf.ApplyAlignment == nil || *xf.ApplyAlignment == false
+		}
+		return reflect.DeepEqual(xf.Alignment, newAlignment(style)) && xf.ApplyBorder != nil && *xf.ApplyBorder == true
+	},
+	"protection": func(ID int, xf xlsxXf, style *Style) bool {
+		if style.Protection == nil {
+			return xf.ApplyProtection == nil || *xf.ApplyProtection == false
+		}
+		return reflect.DeepEqual(xf.Protection, newProtection(style)) && xf.ApplyProtection != nil && *xf.ApplyProtection == true
+	},
+}
+
+// getStyleID provides a function to get styleID by given style. If given
+// style is not exist, will return -1.
+func (f *File) getStyleID(ss *xlsxStyleSheet, style *Style) (styleID int) {
+	styleID = -1
+	if ss.CellXfs == nil {
+		return
+	}
+	numFmtID, borderID, fillID, fontID := getNumFmtID(ss, style), getBorderID(ss, style), getFillID(ss, style), f.getFontID(ss, style)
+	if style.CustomNumFmt != nil {
+		numFmtID = getCustomNumFmtID(ss, style)
+	}
+	for xfID, xf := range ss.CellXfs.Xf {
+		if getXfIDFuncs["numFmt"](numFmtID, xf, style) &&
+			getXfIDFuncs["font"](fontID, xf, style) &&
+			getXfIDFuncs["fill"](fillID, xf, style) &&
+			getXfIDFuncs["border"](borderID, xf, style) &&
+			getXfIDFuncs["alignment"](0, xf, style) &&
+			getXfIDFuncs["protection"](0, xf, style) {
+			styleID = xfID
+			return
+		}
+	}
+	return
+}
+
+// NewConditionalStyle provides a function to create style for conditional
+// format by given style format. The parameters are the same as function
+// NewStyle(). Note that the color field uses RGB color code and only support
+// to set font, fills, alignment and borders currently.
+func (f *File) NewConditionalStyle(style string) (int, error) {
+	s := f.stylesReader()
+	fs, err := parseFormatStyleSet(style)
+	if err != nil {
+		return 0, err
+	}
+	dxf := dxf{
+		Fill: newFills(fs, false),
+	}
+	if fs.Alignment != nil {
+		dxf.Alignment = newAlignment(fs)
+	}
+	if len(fs.Border) > 0 {
+		dxf.Border = newBorders(fs)
+	}
+	if fs.Font != nil {
+		dxf.Font = f.newFont(fs)
+	}
+	dxfStr, _ := xml.Marshal(dxf)
+	if s.Dxfs == nil {
+		s.Dxfs = &xlsxDxfs{}
+	}
+	s.Dxfs.Count++
+	s.Dxfs.Dxfs = append(s.Dxfs.Dxfs, &xlsxDxf{
+		Dxf: string(dxfStr[5 : len(dxfStr)-6]),
+	})
+	return s.Dxfs.Count - 1, nil
+}
+
+// GetDefaultFont provides the default font name currently set in the workbook
+// Documents generated by excelize start with Calibri.
+func (f *File) GetDefaultFont() string {
+	font := f.readDefaultFont()
+	return *font.Name.Val
+}
+
+// SetDefaultFont changes the default font in the workbook.
+func (f *File) SetDefaultFont(fontName string) {
+	font := f.readDefaultFont()
+	font.Name.Val = stringPtr(fontName)
+	s := f.stylesReader()
+	s.Fonts.Font[0] = font
+	custom := true
+	s.CellStyles.CellStyle[0].CustomBuiltIn = &custom
+}
+
+// readDefaultFont provides an unmarshalled font value.
+func (f *File) readDefaultFont() *xlsxFont {
+	s := f.stylesReader()
+	return s.Fonts.Font[0]
+}
+
+// getFontID provides a function to get font ID.
+// If given font is not exist, will return -1.
+func (f *File) getFontID(styleSheet *xlsxStyleSheet, style *Style) (fontID int) {
+	fontID = -1
+	if styleSheet.Fonts == nil || style.Font == nil {
+		return
+	}
+	for idx, fnt := range styleSheet.Fonts.Font {
+		if reflect.DeepEqual(*fnt, *f.newFont(style)) {
+			fontID = idx
+			return
+		}
+	}
+	return
+}
+
+// newFont provides a function to add font style by given cell format
+// settings.
+func (f *File) newFont(style *Style) *xlsxFont {
+	fontUnderlineType := map[string]string{"single": "single", "double": "double"}
+	if style.Font.Size < 1 {
+		style.Font.Size = 11
+	}
+	if style.Font.Color == "" {
+		style.Font.Color = "#000000"
+	}
+	fnt := xlsxFont{
+		Sz:     &attrValFloat{Val: float64Ptr(style.Font.Size)},
+		Color:  &xlsxColor{RGB: getPaletteColor(style.Font.Color)},
+		Name:   &attrValString{Val: stringPtr(style.Font.Family)},
+		Family: &attrValInt{Val: intPtr(2)},
+	}
+	if style.Font.Bold {
+		fnt.B = &style.Font.Bold
+	}
+	if style.Font.Italic {
+		fnt.I = &style.Font.Italic
+	}
+	if *fnt.Name.Val == "" {
+		*fnt.Name.Val = f.GetDefaultFont()
+	}
+	if style.Font.Strike {
+		strike := true
+		fnt.Strike = &strike
+	}
+	val, ok := fontUnderlineType[style.Font.Underline]
+	if ok {
+		fnt.U = &attrValString{Val: stringPtr(val)}
+	}
+	return &fnt
+}
+
+// getNumFmtID provides a function to get number format code ID.
+// If given number format code is not exist, will return -1.
+func getNumFmtID(styleSheet *xlsxStyleSheet, style *Style) (numFmtID int) {
+	numFmtID = -1
+	if styleSheet.NumFmts == nil {
+		return
+	}
+	if _, ok := builtInNumFmt[style.NumFmt]; ok {
+		return style.NumFmt
+	}
+	if fmtCode, ok := currencyNumFmt[style.NumFmt]; ok {
+		for _, numFmt := range styleSheet.NumFmts.NumFmt {
+			if numFmt.FormatCode == fmtCode {
+				numFmtID = numFmt.NumFmtID
+				return
+			}
+		}
+	}
+	return
+}
+
+// newNumFmt provides a function to check if number format code in the range
+// of built-in values.
+func newNumFmt(styleSheet *xlsxStyleSheet, style *Style) int {
+	dp := "0."
+	numFmtID := 164 // Default custom number format code from 164.
+	if style.DecimalPlaces < 0 || style.DecimalPlaces > 30 {
+		style.DecimalPlaces = 2
+	}
+	for i := 0; i < style.DecimalPlaces; i++ {
+		dp += "0"
+	}
+	if style.CustomNumFmt != nil {
+		if customNumFmtID := getCustomNumFmtID(styleSheet, style); customNumFmtID != -1 {
+			return customNumFmtID
+		}
+		return setCustomNumFmt(styleSheet, style)
+	}
+	_, ok := builtInNumFmt[style.NumFmt]
+	if !ok {
+		fc, currency := currencyNumFmt[style.NumFmt]
+		if !currency {
+			return setLangNumFmt(styleSheet, style)
+		}
+		fc = strings.Replace(fc, "0.00", dp, -1)
+		if style.NegRed {
+			fc = fc + ";[Red]" + fc
+		}
+		if styleSheet.NumFmts != nil {
+			numFmtID = styleSheet.NumFmts.NumFmt[len(styleSheet.NumFmts.NumFmt)-1].NumFmtID + 1
+			nf := xlsxNumFmt{
+				FormatCode: fc,
+				NumFmtID:   numFmtID,
+			}
+			styleSheet.NumFmts.NumFmt = append(styleSheet.NumFmts.NumFmt, &nf)
+			styleSheet.NumFmts.Count++
+		} else {
+			nf := xlsxNumFmt{
+				FormatCode: fc,
+				NumFmtID:   numFmtID,
+			}
+			numFmts := xlsxNumFmts{
+				NumFmt: []*xlsxNumFmt{&nf},
+				Count:  1,
+			}
+			styleSheet.NumFmts = &numFmts
+		}
+		return numFmtID
+	}
+	return style.NumFmt
+}
+
+// setCustomNumFmt provides a function to set custom number format code.
+func setCustomNumFmt(styleSheet *xlsxStyleSheet, style *Style) int {
+	nf := xlsxNumFmt{FormatCode: *style.CustomNumFmt}
+	if styleSheet.NumFmts != nil {
+		nf.NumFmtID = styleSheet.NumFmts.NumFmt[len(styleSheet.NumFmts.NumFmt)-1].NumFmtID + 1
+		styleSheet.NumFmts.NumFmt = append(styleSheet.NumFmts.NumFmt, &nf)
+		styleSheet.NumFmts.Count++
+	} else {
+		nf.NumFmtID = 164
+		numFmts := xlsxNumFmts{
+			NumFmt: []*xlsxNumFmt{&nf},
+			Count:  1,
+		}
+		styleSheet.NumFmts = &numFmts
+	}
+	return nf.NumFmtID
+}
+
+// getCustomNumFmtID provides a function to get custom number format code ID.
+// If given custom number format code is not exist, will return -1.
+func getCustomNumFmtID(styleSheet *xlsxStyleSheet, style *Style) (customNumFmtID int) {
+	customNumFmtID = -1
+	if styleSheet.NumFmts == nil {
+		return
+	}
+	for _, numFmt := range styleSheet.NumFmts.NumFmt {
+		if style.CustomNumFmt != nil && numFmt.FormatCode == *style.CustomNumFmt {
+			customNumFmtID = numFmt.NumFmtID
+			return
+		}
+	}
+	return
+}
+
+// setLangNumFmt provides a function to set number format code with language.
+func setLangNumFmt(styleSheet *xlsxStyleSheet, style *Style) int {
+	numFmts, ok := langNumFmt[style.Lang]
+	if !ok {
+		return 0
+	}
+	var fc string
+	fc, ok = numFmts[style.NumFmt]
+	if !ok {
+		return 0
+	}
+	nf := xlsxNumFmt{FormatCode: fc}
+	if styleSheet.NumFmts != nil {
+		nf.NumFmtID = styleSheet.NumFmts.NumFmt[len(styleSheet.NumFmts.NumFmt)-1].NumFmtID + 1
+		styleSheet.NumFmts.NumFmt = append(styleSheet.NumFmts.NumFmt, &nf)
+		styleSheet.NumFmts.Count++
+	} else {
+		nf.NumFmtID = style.NumFmt
+		numFmts := xlsxNumFmts{
+			NumFmt: []*xlsxNumFmt{&nf},
+			Count:  1,
+		}
+		styleSheet.NumFmts = &numFmts
+	}
+	return nf.NumFmtID
+}
+
+// getFillID provides a function to get fill ID. If given fill is not
+// exist, will return -1.
+func getFillID(styleSheet *xlsxStyleSheet, style *Style) (fillID int) {
+	fillID = -1
+	if styleSheet.Fills == nil || style.Fill.Type == "" {
+		return
+	}
+	fills := newFills(style, true)
+	if fills == nil {
+		return
+	}
+	for idx, fill := range styleSheet.Fills.Fill {
+		if reflect.DeepEqual(fill, fills) {
+			fillID = idx
+			return
+		}
+	}
+	return
+}
+
+// newFills provides a function to add fill elements in the styles.xml by
+// given cell format settings.
+func newFills(style *Style, fg bool) *xlsxFill {
+	var patterns = []string{
+		"none",
+		"solid",
+		"mediumGray",
+		"darkGray",
+		"lightGray",
+		"darkHorizontal",
+		"darkVertical",
+		"darkDown",
+		"darkUp",
+		"darkGrid",
+		"darkTrellis",
+		"lightHorizontal",
+		"lightVertical",
+		"lightDown",
+		"lightUp",
+		"lightGrid",
+		"lightTrellis",
+		"gray125",
+		"gray0625",
+	}
+
+	var variants = []float64{
+		90,
+		0,
+		45,
+		135,
+	}
+
+	var fill xlsxFill
+	switch style.Fill.Type {
+	case "gradient":
+		if len(style.Fill.Color) != 2 {
+			break
+		}
+		var gradient xlsxGradientFill
+		switch style.Fill.Shading {
+		case 0, 1, 2, 3:
+			gradient.Degree = variants[style.Fill.Shading]
+		case 4:
+			gradient.Type = "path"
+		case 5:
+			gradient.Type = "path"
+			gradient.Bottom = 0.5
+			gradient.Left = 0.5
+			gradient.Right = 0.5
+			gradient.Top = 0.5
+		default:
+			break
+		}
+		var stops []*xlsxGradientFillStop
+		for index, color := range style.Fill.Color {
+			var stop xlsxGradientFillStop
+			stop.Position = float64(index)
+			stop.Color.RGB = getPaletteColor(color)
+			stops = append(stops, &stop)
+		}
+		gradient.Stop = stops
+		fill.GradientFill = &gradient
+	case "pattern":
+		if style.Fill.Pattern > 18 || style.Fill.Pattern < 0 {
+			break
+		}
+		if len(style.Fill.Color) < 1 {
+			break
+		}
+		var pattern xlsxPatternFill
+		pattern.PatternType = patterns[style.Fill.Pattern]
+		if fg {
+			pattern.FgColor.RGB = getPaletteColor(style.Fill.Color[0])
+		} else {
+			pattern.BgColor.RGB = getPaletteColor(style.Fill.Color[0])
+		}
+		fill.PatternFill = &pattern
+	default:
+		return nil
+	}
+	return &fill
+}
+
+// newAlignment provides a function to formatting information pertaining to
+// text alignment in cells. There are a variety of choices for how text is
+// aligned both horizontally and vertically, as well as indentation settings,
+// and so on.
+func newAlignment(style *Style) *xlsxAlignment {
+	var alignment xlsxAlignment
+	if style.Alignment != nil {
+		alignment.Horizontal = style.Alignment.Horizontal
+		alignment.Indent = style.Alignment.Indent
+		alignment.JustifyLastLine = style.Alignment.JustifyLastLine
+		alignment.ReadingOrder = style.Alignment.ReadingOrder
+		alignment.RelativeIndent = style.Alignment.RelativeIndent
+		alignment.ShrinkToFit = style.Alignment.ShrinkToFit
+		alignment.TextRotation = style.Alignment.TextRotation
+		alignment.Vertical = style.Alignment.Vertical
+		alignment.WrapText = style.Alignment.WrapText
+	}
+	return &alignment
+}
+
+// newProtection provides a function to set protection properties associated
+// with the cell.
+func newProtection(style *Style) *xlsxProtection {
+	var protection xlsxProtection
+	if style.Protection != nil {
+		protection.Hidden = style.Protection.Hidden
+		protection.Locked = style.Protection.Locked
+	}
+	return &protection
+}
+
+// getBorderID provides a function to get border ID. If given border is not
+// exist, will return -1.
+func getBorderID(styleSheet *xlsxStyleSheet, style *Style) (borderID int) {
+	borderID = -1
+	if styleSheet.Borders == nil || len(style.Border) == 0 {
+		return
+	}
+	for idx, border := range styleSheet.Borders.Border {
+		if reflect.DeepEqual(*border, *newBorders(style)) {
+			borderID = idx
+			return
+		}
+	}
+	return
+}
+
+// newBorders provides a function to add border elements in the styles.xml by
+// given borders format settings.
+func newBorders(style *Style) *xlsxBorder {
+	var styles = []string{
+		"none",
+		"thin",
+		"medium",
+		"dashed",
+		"dotted",
+		"thick",
+		"double",
+		"hair",
+		"mediumDashed",
+		"dashDot",
+		"mediumDashDot",
+		"dashDotDot",
+		"mediumDashDotDot",
+		"slantDashDot",
+	}
+
+	var border xlsxBorder
+	for _, v := range style.Border {
+		if 0 <= v.Style && v.Style < 14 {
+			var color xlsxColor
+			color.RGB = getPaletteColor(v.Color)
+			switch v.Type {
+			case "left":
+				border.Left.Style = styles[v.Style]
+				border.Left.Color = &color
+			case "right":
+				border.Right.Style = styles[v.Style]
+				border.Right.Color = &color
+			case "top":
+				border.Top.Style = styles[v.Style]
+				border.Top.Color = &color
+			case "bottom":
+				border.Bottom.Style = styles[v.Style]
+				border.Bottom.Color = &color
+			case "diagonalUp":
+				border.Diagonal.Style = styles[v.Style]
+				border.Diagonal.Color = &color
+				border.DiagonalUp = true
+			case "diagonalDown":
+				border.Diagonal.Style = styles[v.Style]
+				border.Diagonal.Color = &color
+				border.DiagonalDown = true
+			}
+		}
+	}
+	return &border
+}
+
+// setCellXfs provides a function to set describes all of the formatting for a
+// cell.
+func setCellXfs(style *xlsxStyleSheet, fontID, numFmtID, fillID, borderID int, applyAlignment, applyProtection bool, alignment *xlsxAlignment, protection *xlsxProtection) int {
+	var xf xlsxXf
+	xf.FontID = intPtr(fontID)
+	if fontID != 0 {
+		xf.ApplyFont = boolPtr(true)
+	}
+	xf.NumFmtID = intPtr(numFmtID)
+	if numFmtID != 0 {
+		xf.ApplyNumberFormat = boolPtr(true)
+	}
+	xf.FillID = intPtr(fillID)
+	if fillID != 0 {
+		xf.ApplyFill = boolPtr(true)
+	}
+	xf.BorderID = intPtr(borderID)
+	if borderID != 0 {
+		xf.ApplyBorder = boolPtr(true)
+	}
+	style.CellXfs.Count++
+	xf.Alignment = alignment
+	if alignment != nil {
+		xf.ApplyAlignment = boolPtr(applyAlignment)
+	}
+	if applyProtection {
+		xf.ApplyProtection = boolPtr(applyProtection)
+		xf.Protection = protection
+	}
+	xfID := 0
+	xf.XfID = &xfID
+	style.CellXfs.Xf = append(style.CellXfs.Xf, xf)
+	return style.CellXfs.Count - 1
+}
+
+// GetCellStyle provides a function to get cell style index by given worksheet
+// name and cell coordinates.
+func (f *File) GetCellStyle(sheet, axis string) (int, error) {
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return 0, err
+	}
+	cellData, col, _, err := f.prepareCell(xlsx, sheet, axis)
+	if err != nil {
+		return 0, err
+	}
+	return f.prepareCellStyle(xlsx, col, cellData.S), err
+}
+
+// SetCellStyle provides a function to add style attribute for cells by given
+// worksheet name, coordinate area and style ID. Note that diagonalDown and
+// diagonalUp type border should be use same color in the same coordinate
+// area.
+//
+// For example create a borders of cell H9 on Sheet1:
+//
+//    style, err := f.NewStyle(`{"border":[{"type":"left","color":"0000FF","style":3},{"type":"top","color":"00FF00","style":4},{"type":"bottom","color":"FFFF00","style":5},{"type":"right","color":"FF0000","style":6},{"type":"diagonalDown","color":"A020F0","style":7},{"type":"diagonalUp","color":"A020F0","style":8}]}`)
+//    if err != nil {
+//        fmt.Println(err)
+//    }
+//    err = f.SetCellStyle("Sheet1", "H9", "H9", style)
+//
+// Set gradient fill with vertical variants shading styles for cell H9 on
+// Sheet1:
+//
+//    style, err := f.NewStyle(`{"fill":{"type":"gradient","color":["#FFFFFF","#E0EBF5"],"shading":1}}`)
+//    if err != nil {
+//        fmt.Println(err)
+//    }
+//    err = f.SetCellStyle("Sheet1", "H9", "H9", style)
+//
+// Set solid style pattern fill for cell H9 on Sheet1:
+//
+//    style, err := f.NewStyle(`{"fill":{"type":"pattern","color":["#E0EBF5"],"pattern":1}}`)
+//    if err != nil {
+//        fmt.Println(err)
+//    }
+//    err = f.SetCellStyle("Sheet1", "H9", "H9", style)
+//
+// Set alignment style for cell H9 on Sheet1:
+//
+//    style, err := f.NewStyle(`{"alignment":{"horizontal":"center","ident":1,"justify_last_line":true,"reading_order":0,"relative_indent":1,"shrink_to_fit":true,"text_rotation":45,"vertical":"","wrap_text":true}}`)
+//    if err != nil {
+//        fmt.Println(err)
+//    }
+//    err = f.SetCellStyle("Sheet1", "H9", "H9", style)
+//
+// Dates and times in Excel are represented by real numbers, for example "Apr 7
+// 2017 12:00 PM" is represented by the number 42920.5. Set date and time format
+// for cell H9 on Sheet1:
+//
+//    f.SetCellValue("Sheet1", "H9", 42920.5)
+//    style, err := f.NewStyle(`{"number_format": 22}`)
+//    if err != nil {
+//        fmt.Println(err)
+//    }
+//    err = f.SetCellStyle("Sheet1", "H9", "H9", style)
+//
+// Set font style for cell H9 on Sheet1:
+//
+//    style, err := f.NewStyle(`{"font":{"bold":true,"italic":true,"family":"Times New Roman","size":36,"color":"#777777"}}`)
+//    if err != nil {
+//        fmt.Println(err)
+//    }
+//    err = f.SetCellStyle("Sheet1", "H9", "H9", style)
+//
+// Hide and lock for cell H9 on Sheet1:
+//
+//    style, err := f.NewStyle(`{"protection":{"hidden":true, "locked":true}}`)
+//    if err != nil {
+//        fmt.Println(err)
+//    }
+//    err = f.SetCellStyle("Sheet1", "H9", "H9", style)
+//
+func (f *File) SetCellStyle(sheet, hcell, vcell string, styleID int) error {
+	hcol, hrow, err := CellNameToCoordinates(hcell)
+	if err != nil {
+		return err
+	}
+
+	vcol, vrow, err := CellNameToCoordinates(vcell)
+	if err != nil {
+		return err
+	}
+
+	// Normalize the coordinate area, such correct C1:B3 to B1:C3.
+	if vcol < hcol {
+		vcol, hcol = hcol, vcol
+	}
+
+	if vrow < hrow {
+		vrow, hrow = hrow, vrow
+	}
+
+	hcolIdx := hcol - 1
+	hrowIdx := hrow - 1
+
+	vcolIdx := vcol - 1
+	vrowIdx := vrow - 1
+
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	prepareSheetXML(xlsx, vcol, vrow)
+	makeContiguousColumns(xlsx, hrow, vrow, vcol)
+
+	for r := hrowIdx; r <= vrowIdx; r++ {
+		for k := hcolIdx; k <= vcolIdx; k++ {
+			xlsx.SheetData.Row[r].C[k].S = styleID
+		}
+	}
+	return err
+}
+
+// SetConditionalFormat provides a function to create conditional formatting
+// rule for cell value. Conditional formatting is a feature of Excel which
+// allows you to apply a format to a cell or a range of cells based on certain
+// criteria.
+//
+// The type option is a required parameter and it has no default value.
+// Allowable type values and their associated parameters are:
+//
+//     Type          | Parameters
+//    ---------------+------------------------------------
+//     cell          | criteria
+//                   | value
+//                   | minimum
+//                   | maximum
+//     date          | criteria
+//                   | value
+//                   | minimum
+//                   | maximum
+//     time_period   | criteria
+//     text          | criteria
+//                   | value
+//     average       | criteria
+//     duplicate     | (none)
+//     unique        | (none)
+//     top           | criteria
+//                   | value
+//     bottom        | criteria
+//                   | value
+//     blanks        | (none)
+//     no_blanks     | (none)
+//     errors        | (none)
+//     no_errors     | (none)
+//     2_color_scale | min_type
+//                   | max_type
+//                   | min_value
+//                   | max_value
+//                   | min_color
+//                   | max_color
+//     3_color_scale | min_type
+//                   | mid_type
+//                   | max_type
+//                   | min_value
+//                   | mid_value
+//                   | max_value
+//                   | min_color
+//                   | mid_color
+//                   | max_color
+//     data_bar      | min_type
+//                   | max_type
+//                   | min_value
+//                   | max_value
+//                   | bar_color
+//     formula       | criteria
+//
+// The criteria parameter is used to set the criteria by which the cell data
+// will be evaluated. It has no default value. The most common criteria as
+// applied to {"type":"cell"} are:
+//
+//    between                  |
+//    not between              |
+//    equal to                 | ==
+//    not equal to             | !=
+//    greater than             | >
+//    less than                | <
+//    greater than or equal to | >=
+//    less than or equal to    | <=
+//
+// You can either use Excel's textual description strings, in the first column
+// above, or the more common symbolic alternatives.
+//
+// Additional criteria which are specific to other conditional format types are
+// shown in the relevant sections below.
+//
+// value: The value is generally used along with the criteria parameter to set
+// the rule by which the cell data will be evaluated:
+//
+//    f.SetConditionalFormat("Sheet1", "D1:D10", fmt.Sprintf(`[{"type":"cell","criteria":">","format":%d,"value":"6"}]`, format))
+//
+// The value property can also be an cell reference:
+//
+//    f.SetConditionalFormat("Sheet1", "D1:D10", fmt.Sprintf(`[{"type":"cell","criteria":">","format":%d,"value":"$C$1"}]`, format))
+//
+// type: format - The format parameter is used to specify the format that will
+// be applied to the cell when the conditional formatting criterion is met. The
+// format is created using the NewConditionalStyle() method in the same way as
+// cell formats:
+//
+//    format, err = f.NewConditionalStyle(`{"font":{"color":"#9A0511"},"fill":{"type":"pattern","color":["#FEC7CE"],"pattern":1}}`)
+//    if err != nil {
+//        fmt.Println(err)
+//    }
+//    f.SetConditionalFormat("Sheet1", "A1:A10", fmt.Sprintf(`[{"type":"cell","criteria":">","format":%d,"value":"6"}]`, format))
+//
+// Note: In Excel, a conditional format is superimposed over the existing cell
+// format and not all cell format properties can be modified. Properties that
+// cannot be modified in a conditional format are font name, font size,
+// superscript and subscript, diagonal borders, all alignment properties and all
+// protection properties.
+//
+// Excel specifies some default formats to be used with conditional formatting.
+// These can be replicated using the following excelize formats:
+//
+//    // Rose format for bad conditional.
+//    format1, err = f.NewConditionalStyle(`{"font":{"color":"#9A0511"},"fill":{"type":"pattern","color":["#FEC7CE"],"pattern":1}}`)
+//
+//    // Light yellow format for neutral conditional.
+//    format2, err = f.NewConditionalStyle(`{"font":{"color":"#9B5713"},"fill":{"type":"pattern","color":["#FEEAA0"],"pattern":1}}`)
+//
+//    // Light green format for good conditional.
+//    format3, err = f.NewConditionalStyle(`{"font":{"color":"#09600B"},"fill":{"type":"pattern","color":["#C7EECF"],"pattern":1}}`)
+//
+// type: minimum - The minimum parameter is used to set the lower limiting value
+// when the criteria is either "between" or "not between".
+//
+//    // Hightlight cells rules: between...
+//    f.SetConditionalFormat("Sheet1", "A1:A10", fmt.Sprintf(`[{"type":"cell","criteria":"between","format":%d,"minimum":"6","maximum":"8"}]`, format))
+//
+// type: maximum - The maximum parameter is used to set the upper limiting value
+// when the criteria is either "between" or "not between". See the previous
+// example.
+//
+// type: average - The average type is used to specify Excel's "Average" style
+// conditional format:
+//
+//    // Top/Bottom rules: Above Average...
+//    f.SetConditionalFormat("Sheet1", "A1:A10", fmt.Sprintf(`[{"type":"average","criteria":"=","format":%d, "above_average": true}]`, format1))
+//
+//    // Top/Bottom rules: Below Average...
+//    f.SetConditionalFormat("Sheet1", "B1:B10", fmt.Sprintf(`[{"type":"average","criteria":"=","format":%d, "above_average": false}]`, format2))
+//
+// type: duplicate - The duplicate type is used to highlight duplicate cells in a range:
+//
+//    // Hightlight cells rules: Duplicate Values...
+//    f.SetConditionalFormat("Sheet1", "A1:A10", fmt.Sprintf(`[{"type":"duplicate","criteria":"=","format":%d}]`, format))
+//
+// type: unique - The unique type is used to highlight unique cells in a range:
+//
+//    // Hightlight cells rules: Not Equal To...
+//    f.SetConditionalFormat("Sheet1", "A1:A10", fmt.Sprintf(`[{"type":"unique","criteria":"=","format":%d}]`, format))
+//
+// type: top - The top type is used to specify the top n values by number or percentage in a range:
+//
+//    // Top/Bottom rules: Top 10.
+//    f.SetConditionalFormat("Sheet1", "H1:H10", fmt.Sprintf(`[{"type":"top","criteria":"=","format":%d,"value":"6"}]`, format))
+//
+// The criteria can be used to indicate that a percentage condition is required:
+//
+//    f.SetConditionalFormat("Sheet1", "A1:A10", fmt.Sprintf(`[{"type":"top","criteria":"=","format":%d,"value":"6","percent":true}]`, format))
+//
+// type: 2_color_scale - The 2_color_scale type is used to specify Excel's "2
+// Color Scale" style conditional format:
+//
+//    // Color scales: 2 color.
+//    f.SetConditionalFormat("Sheet1", "A1:A10", `[{"type":"2_color_scale","criteria":"=","min_type":"min","max_type":"max","min_color":"#F8696B","max_color":"#63BE7B"}]`)
+//
+// This conditional type can be modified with min_type, max_type, min_value,
+// max_value, min_color and max_color, see below.
+//
+// type: 3_color_scale - The 3_color_scale type is used to specify Excel's "3
+// Color Scale" style conditional format:
+//
+//    // Color scales: 3 color.
+//    f.SetConditionalFormat("Sheet1", "A1:A10", `[{"type":"3_color_scale","criteria":"=","min_type":"min","mid_type":"percentile","max_type":"max","min_color":"#F8696B","mid_color":"#FFEB84","max_color":"#63BE7B"}]`)
+//
+// This conditional type can be modified with min_type, mid_type, max_type,
+// min_value, mid_value, max_value, min_color, mid_color and max_color, see
+// below.
+//
+// type: data_bar - The data_bar type is used to specify Excel's "Data Bar"
+// style conditional format.
+//
+// min_type - The min_type and max_type properties are available when the conditional formatting type is 2_color_scale, 3_color_scale or data_bar. The mid_type is available for 3_color_scale. The properties are used as follows:
+//
+//    // Data Bars: Gradient Fill.
+//    f.SetConditionalFormat("Sheet1", "K1:K10", `[{"type":"data_bar", "criteria":"=", "min_type":"min","max_type":"max","bar_color":"#638EC6"}]`)
+//
+// The available min/mid/max types are:
+//
+//    min        (for min_type only)
+//    num
+//    percent
+//    percentile
+//    formula
+//    max        (for max_type only)
+//
+// mid_type - Used for 3_color_scale. Same as min_type, see above.
+//
+// max_type - Same as min_type, see above.
+//
+// min_value - The min_value and max_value properties are available when the
+// conditional formatting type is 2_color_scale, 3_color_scale or data_bar. The
+// mid_value is available for 3_color_scale.
+//
+// mid_value - Used for 3_color_scale. Same as min_value, see above.
+//
+// max_value - Same as min_value, see above.
+//
+// min_color - The min_color and max_color properties are available when the
+// conditional formatting type is 2_color_scale, 3_color_scale or data_bar.
+// The mid_color is available for 3_color_scale. The properties are used as
+// follows:
+//
+//    // Color scales: 3 color.
+//    f.SetConditionalFormat("Sheet1", "B1:B10", `[{"type":"3_color_scale","criteria":"=","min_type":"min","mid_type":"percentile","max_type":"max","min_color":"#F8696B","mid_color":"#FFEB84","max_color":"#63BE7B"}]`)
+//
+// mid_color - Used for 3_color_scale. Same as min_color, see above.
+//
+// max_color - Same as min_color, see above.
+//
+// bar_color - Used for data_bar. Same as min_color, see above.
+//
+func (f *File) SetConditionalFormat(sheet, area, formatSet string) error {
+	var format []*formatConditional
+	err := json.Unmarshal([]byte(formatSet), &format)
+	if err != nil {
+		return err
+	}
+	drawContFmtFunc := map[string]func(p int, ct string, fmtCond *formatConditional) *xlsxCfRule{
+		"cellIs":          drawCondFmtCellIs,
+		"top10":           drawCondFmtTop10,
+		"aboveAverage":    drawCondFmtAboveAverage,
+		"duplicateValues": drawCondFmtDuplicateUniqueValues,
+		"uniqueValues":    drawCondFmtDuplicateUniqueValues,
+		"2_color_scale":   drawCondFmtColorScale,
+		"3_color_scale":   drawCondFmtColorScale,
+		"dataBar":         drawCondFmtDataBar,
+		"expression":      drawConfFmtExp,
+	}
+
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	cfRule := []*xlsxCfRule{}
+	for p, v := range format {
+		var vt, ct string
+		var ok bool
+		// "type" is a required parameter, check for valid validation types.
+		vt, ok = validType[v.Type]
+		if ok {
+			// Check for valid criteria types.
+			ct, ok = criteriaType[v.Criteria]
+			if ok || vt == "expression" {
+				drawfunc, ok := drawContFmtFunc[vt]
+				if ok {
+					cfRule = append(cfRule, drawfunc(p, ct, v))
+				}
+			}
+		}
+	}
+
+	xlsx.ConditionalFormatting = append(xlsx.ConditionalFormatting, &xlsxConditionalFormatting{
+		SQRef:  area,
+		CfRule: cfRule,
+	})
+	return err
+}
+
+// UnsetConditionalFormat provides a function to unset the conditional format
+// by given worksheet name and range.
+func (f *File) UnsetConditionalFormat(sheet, area string) error {
+	ws, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	for i, cf := range ws.ConditionalFormatting {
+		if cf.SQRef == area {
+			ws.ConditionalFormatting = append(ws.ConditionalFormatting[:i], ws.ConditionalFormatting[i+1:]...)
+			return nil
+		}
+	}
+	return nil
+}
+
+// drawCondFmtCellIs provides a function to create conditional formatting rule
+// for cell value (include between, not between, equal, not equal, greater
+// than and less than) by given priority, criteria type and format settings.
+func drawCondFmtCellIs(p int, ct string, format *formatConditional) *xlsxCfRule {
+	c := &xlsxCfRule{
+		Priority: p + 1,
+		Type:     validType[format.Type],
+		Operator: ct,
+		DxfID:    &format.Format,
+	}
+	// "between" and "not between" criteria require 2 values.
+	_, ok := map[string]bool{"between": true, "notBetween": true}[ct]
+	if ok {
+		c.Formula = append(c.Formula, format.Minimum)
+		c.Formula = append(c.Formula, format.Maximum)
+	}
+	_, ok = map[string]bool{"equal": true, "notEqual": true, "greaterThan": true, "lessThan": true, "greaterThanOrEqual": true, "lessThanOrEqual": true, "containsText": true, "notContains": true, "beginsWith": true, "endsWith": true}[ct]
+	if ok {
+		c.Formula = append(c.Formula, format.Value)
+	}
+	return c
+}
+
+// drawCondFmtTop10 provides a function to create conditional formatting rule
+// for top N (default is top 10) by given priority, criteria type and format
+// settings.
+func drawCondFmtTop10(p int, ct string, format *formatConditional) *xlsxCfRule {
+	c := &xlsxCfRule{
+		Priority: p + 1,
+		Type:     validType[format.Type],
+		Rank:     10,
+		DxfID:    &format.Format,
+		Percent:  format.Percent,
+	}
+	rank, err := strconv.Atoi(format.Value)
+	if err == nil {
+		c.Rank = rank
+	}
+	return c
+}
+
+// drawCondFmtAboveAverage provides a function to create conditional
+// formatting rule for above average and below average by given priority,
+// criteria type and format settings.
+func drawCondFmtAboveAverage(p int, ct string, format *formatConditional) *xlsxCfRule {
+	return &xlsxCfRule{
+		Priority:     p + 1,
+		Type:         validType[format.Type],
+		AboveAverage: &format.AboveAverage,
+		DxfID:        &format.Format,
+	}
+}
+
+// drawCondFmtDuplicateUniqueValues provides a function to create conditional
+// formatting rule for duplicate and unique values by given priority, criteria
+// type and format settings.
+func drawCondFmtDuplicateUniqueValues(p int, ct string, format *formatConditional) *xlsxCfRule {
+	return &xlsxCfRule{
+		Priority: p + 1,
+		Type:     validType[format.Type],
+		DxfID:    &format.Format,
+	}
+}
+
+// drawCondFmtColorScale provides a function to create conditional formatting
+// rule for color scale (include 2 color scale and 3 color scale) by given
+// priority, criteria type and format settings.
+func drawCondFmtColorScale(p int, ct string, format *formatConditional) *xlsxCfRule {
+	minValue := format.MinValue
+	if minValue == "" {
+		minValue = "0"
+	}
+	maxValue := format.MaxValue
+	if maxValue == "" {
+		maxValue = "0"
+	}
+	midValue := format.MidValue
+	if midValue == "" {
+		midValue = "50"
+	}
+
+	c := &xlsxCfRule{
+		Priority: p + 1,
+		Type:     "colorScale",
+		ColorScale: &xlsxColorScale{
+			Cfvo: []*xlsxCfvo{
+				{Type: format.MinType, Val: minValue},
+			},
+			Color: []*xlsxColor{
+				{RGB: getPaletteColor(format.MinColor)},
+			},
+		},
+	}
+	if validType[format.Type] == "3_color_scale" {
+		c.ColorScale.Cfvo = append(c.ColorScale.Cfvo, &xlsxCfvo{Type: format.MidType, Val: midValue})
+		c.ColorScale.Color = append(c.ColorScale.Color, &xlsxColor{RGB: getPaletteColor(format.MidColor)})
+	}
+	c.ColorScale.Cfvo = append(c.ColorScale.Cfvo, &xlsxCfvo{Type: format.MaxType, Val: maxValue})
+	c.ColorScale.Color = append(c.ColorScale.Color, &xlsxColor{RGB: getPaletteColor(format.MaxColor)})
+	return c
+}
+
+// drawCondFmtDataBar provides a function to create conditional formatting
+// rule for data bar by given priority, criteria type and format settings.
+func drawCondFmtDataBar(p int, ct string, format *formatConditional) *xlsxCfRule {
+	return &xlsxCfRule{
+		Priority: p + 1,
+		Type:     validType[format.Type],
+		DataBar: &xlsxDataBar{
+			Cfvo:  []*xlsxCfvo{{Type: format.MinType}, {Type: format.MaxType}},
+			Color: []*xlsxColor{{RGB: getPaletteColor(format.BarColor)}},
+		},
+	}
+}
+
+// drawConfFmtExp provides a function to create conditional formatting rule
+// for expression by given priority, criteria type and format settings.
+func drawConfFmtExp(p int, ct string, format *formatConditional) *xlsxCfRule {
+	return &xlsxCfRule{
+		Priority: p + 1,
+		Type:     validType[format.Type],
+		Formula:  []string{format.Criteria},
+		DxfID:    &format.Format,
+	}
+}
+
+// getPaletteColor provides a function to convert the RBG color by given
+// string.
+func getPaletteColor(color string) string {
+	return "FF" + strings.Replace(strings.ToUpper(color), "#", "", -1)
+}
+
+// themeReader provides a function to get the pointer to the xl/theme/theme1.xml
+// structure after deserialization.
+func (f *File) themeReader() *xlsxTheme {
+	var (
+		err   error
+		theme xlsxTheme
+	)
+
+	if err = f.xmlNewDecoder(bytes.NewReader(namespaceStrictToTransitional(f.readXML("xl/theme/theme1.xml")))).
+		Decode(&theme); err != nil && err != io.EOF {
+		log.Printf("xml decoder error: %s", err)
+	}
+
+	return &theme
+}
+
+// ThemeColor applied the color with tint value.
+func ThemeColor(baseColor string, tint float64) string {
+	if tint == 0 {
+		return "FF" + baseColor
+	}
+	r, _ := strconv.ParseInt(baseColor[0:2], 16, 64)
+	g, _ := strconv.ParseInt(baseColor[2:4], 16, 64)
+	b, _ := strconv.ParseInt(baseColor[4:6], 16, 64)
+	h, s, l := RGBToHSL(uint8(r), uint8(g), uint8(b))
+	if tint < 0 {
+		l *= (1 + tint)
+	} else {
+		l = l*(1-tint) + (1 - (1 - tint))
+	}
+	br, bg, bb := HSLToRGB(h, s, l)
+	return fmt.Sprintf("FF%02X%02X%02X", br, bg, bb)
+}

+ 516 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/table.go

@@ -0,0 +1,516 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"encoding/json"
+	"encoding/xml"
+	"fmt"
+	"regexp"
+	"strconv"
+	"strings"
+)
+
+// parseFormatTableSet provides a function to parse the format settings of the
+// table with default value.
+func parseFormatTableSet(formatSet string) (*formatTable, error) {
+	format := formatTable{
+		TableStyle:     "",
+		ShowRowStripes: true,
+	}
+	err := json.Unmarshal(parseFormatSet(formatSet), &format)
+	return &format, err
+}
+
+// AddTable provides the method to add table in a worksheet by given worksheet
+// name, coordinate area and format set. For example, create a table of A1:D5
+// on Sheet1:
+//
+//    err := f.AddTable("Sheet1", "A1", "D5", ``)
+//
+// Create a table of F2:H6 on Sheet2 with format set:
+//
+//    err := f.AddTable("Sheet2", "F2", "H6", `{"table_name":"table","table_style":"TableStyleMedium2", "show_first_column":true,"show_last_column":true,"show_row_stripes":false,"show_column_stripes":true}`)
+//
+// Note that the table must be at least two lines including the header. The
+// header cells must contain strings and must be unique, and must set the
+// header row data of the table before calling the AddTable function. Multiple
+// tables coordinate areas that can't have an intersection.
+//
+// table_name: The name of the table, in the same worksheet name of the table should be unique
+//
+// table_style: The built-in table style names
+//
+//    TableStyleLight1 - TableStyleLight21
+//    TableStyleMedium1 - TableStyleMedium28
+//    TableStyleDark1 - TableStyleDark11
+//
+func (f *File) AddTable(sheet, hcell, vcell, format string) error {
+	formatSet, err := parseFormatTableSet(format)
+	if err != nil {
+		return err
+	}
+	// Coordinate conversion, convert C1:B3 to 2,0,1,2.
+	hcol, hrow, err := CellNameToCoordinates(hcell)
+	if err != nil {
+		return err
+	}
+	vcol, vrow, err := CellNameToCoordinates(vcell)
+	if err != nil {
+		return err
+	}
+
+	if vcol < hcol {
+		vcol, hcol = hcol, vcol
+	}
+
+	if vrow < hrow {
+		vrow, hrow = hrow, vrow
+	}
+
+	tableID := f.countTables() + 1
+	sheetRelationshipsTableXML := "../tables/table" + strconv.Itoa(tableID) + ".xml"
+	tableXML := strings.Replace(sheetRelationshipsTableXML, "..", "xl", -1)
+	// Add first table for given sheet.
+	sheetRels := "xl/worksheets/_rels/" + strings.TrimPrefix(f.sheetMap[trimSheetName(sheet)], "xl/worksheets/") + ".rels"
+	rID := f.addRels(sheetRels, SourceRelationshipTable, sheetRelationshipsTableXML, "")
+	if err = f.addSheetTable(sheet, rID); err != nil {
+		return err
+	}
+	f.addSheetNameSpace(sheet, SourceRelationship)
+	if err = f.addTable(sheet, tableXML, hcol, hrow, vcol, vrow, tableID, formatSet); err != nil {
+		return err
+	}
+	f.addContentTypePart(tableID, "table")
+	return err
+}
+
+// countTables provides a function to get table files count storage in the
+// folder xl/tables.
+func (f *File) countTables() int {
+	count := 0
+	for k := range f.XLSX {
+		if strings.Contains(k, "xl/tables/table") {
+			count++
+		}
+	}
+	return count
+}
+
+// addSheetTable provides a function to add tablePart element to
+// xl/worksheets/sheet%d.xml by given worksheet name and relationship index.
+func (f *File) addSheetTable(sheet string, rID int) error {
+	ws, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	table := &xlsxTablePart{
+		RID: "rId" + strconv.Itoa(rID),
+	}
+	if ws.TableParts == nil {
+		ws.TableParts = &xlsxTableParts{}
+	}
+	ws.TableParts.Count++
+	ws.TableParts.TableParts = append(ws.TableParts.TableParts, table)
+	return err
+}
+
+// addTable provides a function to add table by given worksheet name,
+// coordinate area and format set.
+func (f *File) addTable(sheet, tableXML string, x1, y1, x2, y2, i int, formatSet *formatTable) error {
+	// Correct the minimum number of rows, the table at least two lines.
+	if y1 == y2 {
+		y2++
+	}
+
+	// Correct table reference coordinate area, such correct C1:B3 to B1:C3.
+	ref, err := f.coordinatesToAreaRef([]int{x1, y1, x2, y2})
+	if err != nil {
+		return err
+	}
+
+	var tableColumn []*xlsxTableColumn
+
+	idx := 0
+	for i := x1; i <= x2; i++ {
+		idx++
+		cell, err := CoordinatesToCellName(i, y1)
+		if err != nil {
+			return err
+		}
+		name, _ := f.GetCellValue(sheet, cell)
+		if _, err := strconv.Atoi(name); err == nil {
+			_ = f.SetCellStr(sheet, cell, name)
+		}
+		if name == "" {
+			name = "Column" + strconv.Itoa(idx)
+			f.SetCellStr(sheet, cell, name)
+		}
+		tableColumn = append(tableColumn, &xlsxTableColumn{
+			ID:   idx,
+			Name: name,
+		})
+	}
+	name := formatSet.TableName
+	if name == "" {
+		name = "Table" + strconv.Itoa(i)
+	}
+	t := xlsxTable{
+		XMLNS:       NameSpaceSpreadSheet.Value,
+		ID:          i,
+		Name:        name,
+		DisplayName: name,
+		Ref:         ref,
+		AutoFilter: &xlsxAutoFilter{
+			Ref: ref,
+		},
+		TableColumns: &xlsxTableColumns{
+			Count:       idx,
+			TableColumn: tableColumn,
+		},
+		TableStyleInfo: &xlsxTableStyleInfo{
+			Name:              formatSet.TableStyle,
+			ShowFirstColumn:   formatSet.ShowFirstColumn,
+			ShowLastColumn:    formatSet.ShowLastColumn,
+			ShowRowStripes:    formatSet.ShowRowStripes,
+			ShowColumnStripes: formatSet.ShowColumnStripes,
+		},
+	}
+	table, _ := xml.Marshal(t)
+	f.saveFileList(tableXML, table)
+	return nil
+}
+
+// parseAutoFilterSet provides a function to parse the settings of the auto
+// filter.
+func parseAutoFilterSet(formatSet string) (*formatAutoFilter, error) {
+	format := formatAutoFilter{}
+	err := json.Unmarshal([]byte(formatSet), &format)
+	return &format, err
+}
+
+// AutoFilter provides the method to add auto filter in a worksheet by given
+// worksheet name, coordinate area and settings. An autofilter in Excel is a
+// way of filtering a 2D range of data based on some simple criteria. For
+// example applying an autofilter to a cell range A1:D4 in the Sheet1:
+//
+//    err := f.AutoFilter("Sheet1", "A1", "D4", "")
+//
+// Filter data in an autofilter:
+//
+//    err := f.AutoFilter("Sheet1", "A1", "D4", `{"column":"B","expression":"x != blanks"}`)
+//
+// column defines the filter columns in a autofilter range based on simple
+// criteria
+//
+// It isn't sufficient to just specify the filter condition. You must also
+// hide any rows that don't match the filter condition. Rows are hidden using
+// the SetRowVisible() method. Excelize can't filter rows automatically since
+// this isn't part of the file format.
+//
+// Setting a filter criteria for a column:
+//
+// expression defines the conditions, the following operators are available
+// for setting the filter criteria:
+//
+//    ==
+//    !=
+//    >
+//    <
+//    >=
+//    <=
+//    and
+//    or
+//
+// An expression can comprise a single statement or two statements separated
+// by the 'and' and 'or' operators. For example:
+//
+//    x <  2000
+//    x >  2000
+//    x == 2000
+//    x >  2000 and x <  5000
+//    x == 2000 or  x == 5000
+//
+// Filtering of blank or non-blank data can be achieved by using a value of
+// Blanks or NonBlanks in the expression:
+//
+//    x == Blanks
+//    x == NonBlanks
+//
+// Excel also allows some simple string matching operations:
+//
+//    x == b*      // begins with b
+//    x != b*      // doesnt begin with b
+//    x == *b      // ends with b
+//    x != *b      // doesnt end with b
+//    x == *b*     // contains b
+//    x != *b*     // doesn't contains b
+//
+// You can also use '*' to match any character or number and '?' to match any
+// single character or number. No other regular expression quantifier is
+// supported by Excel's filters. Excel's regular expression characters can be
+// escaped using '~'.
+//
+// The placeholder variable x in the above examples can be replaced by any
+// simple string. The actual placeholder name is ignored internally so the
+// following are all equivalent:
+//
+//    x     < 2000
+//    col   < 2000
+//    Price < 2000
+//
+func (f *File) AutoFilter(sheet, hcell, vcell, format string) error {
+	hcol, hrow, err := CellNameToCoordinates(hcell)
+	if err != nil {
+		return err
+	}
+	vcol, vrow, err := CellNameToCoordinates(vcell)
+	if err != nil {
+		return err
+	}
+
+	if vcol < hcol {
+		vcol, hcol = hcol, vcol
+	}
+
+	if vrow < hrow {
+		vrow, hrow = hrow, vrow
+	}
+
+	formatSet, _ := parseAutoFilterSet(format)
+	cellStart, _ := CoordinatesToCellName(hcol, hrow)
+	cellEnd, _ := CoordinatesToCellName(vcol, vrow)
+	ref, filterDB := cellStart+":"+cellEnd, "_xlnm._FilterDatabase"
+	wb := f.workbookReader()
+	sheetID := f.GetSheetIndex(sheet)
+	filterRange := fmt.Sprintf("%s!%s", sheet, ref)
+	d := xlsxDefinedName{
+		Name:         filterDB,
+		Hidden:       true,
+		LocalSheetID: intPtr(sheetID),
+		Data:         filterRange,
+	}
+	if wb.DefinedNames == nil {
+		wb.DefinedNames = &xlsxDefinedNames{
+			DefinedName: []xlsxDefinedName{d},
+		}
+	} else {
+		var definedNameExists bool
+		for idx := range wb.DefinedNames.DefinedName {
+			definedName := wb.DefinedNames.DefinedName[idx]
+			if definedName.Name == filterDB && *definedName.LocalSheetID == sheetID && definedName.Hidden {
+				wb.DefinedNames.DefinedName[idx].Data = filterRange
+				definedNameExists = true
+			}
+		}
+		if !definedNameExists {
+			wb.DefinedNames.DefinedName = append(wb.DefinedNames.DefinedName, d)
+		}
+	}
+	refRange := vcol - hcol
+	return f.autoFilter(sheet, ref, refRange, hcol, formatSet)
+}
+
+// autoFilter provides a function to extract the tokens from the filter
+// expression. The tokens are mainly non-whitespace groups.
+func (f *File) autoFilter(sheet, ref string, refRange, col int, formatSet *formatAutoFilter) error {
+	xlsx, err := f.workSheetReader(sheet)
+	if err != nil {
+		return err
+	}
+	if xlsx.SheetPr != nil {
+		xlsx.SheetPr.FilterMode = true
+	}
+	xlsx.SheetPr = &xlsxSheetPr{FilterMode: true}
+	filter := &xlsxAutoFilter{
+		Ref: ref,
+	}
+	xlsx.AutoFilter = filter
+	if formatSet.Column == "" || formatSet.Expression == "" {
+		return nil
+	}
+
+	fsCol, err := ColumnNameToNumber(formatSet.Column)
+	if err != nil {
+		return err
+	}
+	offset := fsCol - col
+	if offset < 0 || offset > refRange {
+		return fmt.Errorf("incorrect index of column '%s'", formatSet.Column)
+	}
+
+	filter.FilterColumn = &xlsxFilterColumn{
+		ColID: offset,
+	}
+	re := regexp.MustCompile(`"(?:[^"]|"")*"|\S+`)
+	token := re.FindAllString(formatSet.Expression, -1)
+	if len(token) != 3 && len(token) != 7 {
+		return fmt.Errorf("incorrect number of tokens in criteria '%s'", formatSet.Expression)
+	}
+	expressions, tokens, err := f.parseFilterExpression(formatSet.Expression, token)
+	if err != nil {
+		return err
+	}
+	f.writeAutoFilter(filter, expressions, tokens)
+	xlsx.AutoFilter = filter
+	return nil
+}
+
+// writeAutoFilter provides a function to check for single or double custom
+// filters as default filters and handle them accordingly.
+func (f *File) writeAutoFilter(filter *xlsxAutoFilter, exp []int, tokens []string) {
+	if len(exp) == 1 && exp[0] == 2 {
+		// Single equality.
+		var filters []*xlsxFilter
+		filters = append(filters, &xlsxFilter{Val: tokens[0]})
+		filter.FilterColumn.Filters = &xlsxFilters{Filter: filters}
+	} else if len(exp) == 3 && exp[0] == 2 && exp[1] == 1 && exp[2] == 2 {
+		// Double equality with "or" operator.
+		filters := []*xlsxFilter{}
+		for _, v := range tokens {
+			filters = append(filters, &xlsxFilter{Val: v})
+		}
+		filter.FilterColumn.Filters = &xlsxFilters{Filter: filters}
+	} else {
+		// Non default custom filter.
+		expRel := map[int]int{0: 0, 1: 2}
+		andRel := map[int]bool{0: true, 1: false}
+		for k, v := range tokens {
+			f.writeCustomFilter(filter, exp[expRel[k]], v)
+			if k == 1 {
+				filter.FilterColumn.CustomFilters.And = andRel[exp[k]]
+			}
+		}
+	}
+}
+
+// writeCustomFilter provides a function to write the <customFilter> element.
+func (f *File) writeCustomFilter(filter *xlsxAutoFilter, operator int, val string) {
+	operators := map[int]string{
+		1:  "lessThan",
+		2:  "equal",
+		3:  "lessThanOrEqual",
+		4:  "greaterThan",
+		5:  "notEqual",
+		6:  "greaterThanOrEqual",
+		22: "equal",
+	}
+	customFilter := xlsxCustomFilter{
+		Operator: operators[operator],
+		Val:      val,
+	}
+	if filter.FilterColumn.CustomFilters != nil {
+		filter.FilterColumn.CustomFilters.CustomFilter = append(filter.FilterColumn.CustomFilters.CustomFilter, &customFilter)
+	} else {
+		customFilters := []*xlsxCustomFilter{}
+		customFilters = append(customFilters, &customFilter)
+		filter.FilterColumn.CustomFilters = &xlsxCustomFilters{CustomFilter: customFilters}
+	}
+}
+
+// parseFilterExpression provides a function to converts the tokens of a
+// possibly conditional expression into 1 or 2 sub expressions for further
+// parsing.
+//
+// Examples:
+//
+//    ('x', '==', 2000) -> exp1
+//    ('x', '>',  2000, 'and', 'x', '<', 5000) -> exp1 and exp2
+//
+func (f *File) parseFilterExpression(expression string, tokens []string) ([]int, []string, error) {
+	expressions := []int{}
+	t := []string{}
+	if len(tokens) == 7 {
+		// The number of tokens will be either 3 (for 1 expression) or 7 (for 2
+		// expressions).
+		conditional := 0
+		c := tokens[3]
+		re, _ := regexp.Match(`(or|\|\|)`, []byte(c))
+		if re {
+			conditional = 1
+		}
+		expression1, token1, err := f.parseFilterTokens(expression, tokens[0:3])
+		if err != nil {
+			return expressions, t, err
+		}
+		expression2, token2, err := f.parseFilterTokens(expression, tokens[4:7])
+		if err != nil {
+			return expressions, t, err
+		}
+		expressions = []int{expression1[0], conditional, expression2[0]}
+		t = []string{token1, token2}
+	} else {
+		exp, token, err := f.parseFilterTokens(expression, tokens)
+		if err != nil {
+			return expressions, t, err
+		}
+		expressions = exp
+		t = []string{token}
+	}
+	return expressions, t, nil
+}
+
+// parseFilterTokens provides a function to parse the 3 tokens of a filter
+// expression and return the operator and token.
+func (f *File) parseFilterTokens(expression string, tokens []string) ([]int, string, error) {
+	operators := map[string]int{
+		"==": 2,
+		"=":  2,
+		"=~": 2,
+		"eq": 2,
+		"!=": 5,
+		"!~": 5,
+		"ne": 5,
+		"<>": 5,
+		"<":  1,
+		"<=": 3,
+		">":  4,
+		">=": 6,
+	}
+	operator, ok := operators[strings.ToLower(tokens[1])]
+	if !ok {
+		// Convert the operator from a number to a descriptive string.
+		return []int{}, "", fmt.Errorf("unknown operator: %s", tokens[1])
+	}
+	token := tokens[2]
+	// Special handling for Blanks/NonBlanks.
+	re, _ := regexp.Match("blanks|nonblanks", []byte(strings.ToLower(token)))
+	if re {
+		// Only allow Equals or NotEqual in this context.
+		if operator != 2 && operator != 5 {
+			return []int{operator}, token, fmt.Errorf("the operator '%s' in expression '%s' is not valid in relation to Blanks/NonBlanks'", tokens[1], expression)
+		}
+		token = strings.ToLower(token)
+		// The operator should always be 2 (=) to flag a "simple" equality in
+		// the binary record. Therefore we convert <> to =.
+		if token == "blanks" {
+			if operator == 5 {
+				token = " "
+			}
+		} else {
+			if operator == 5 {
+				operator = 2
+				token = "blanks"
+			} else {
+				operator = 5
+				token = " "
+			}
+		}
+	}
+	// if the string token contains an Excel match character then change the
+	// operator type to indicate a non "simple" equality.
+	re, _ = regexp.Match("[*?]", []byte(token))
+	if operator == 2 && re {
+		operator = 22
+	}
+	return []int{operator}, token, nil
+}

File diff ditekan karena terlalu besar
+ 41 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/templates.go


+ 146 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/vmlDrawing.go

@@ -0,0 +1,146 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// vmlDrawing directly maps the root element in the file
+// xl/drawings/vmlDrawing%d.vml.
+type vmlDrawing struct {
+	XMLName     xml.Name         `xml:"xml"`
+	XMLNSv      string           `xml:"xmlns:v,attr"`
+	XMLNSo      string           `xml:"xmlns:o,attr"`
+	XMLNSx      string           `xml:"xmlns:x,attr"`
+	XMLNSmv     string           `xml:"xmlns:mv,attr"`
+	Shapelayout *xlsxShapelayout `xml:"o:shapelayout"`
+	Shapetype   *xlsxShapetype   `xml:"v:shapetype"`
+	Shape       []xlsxShape      `xml:"v:shape"`
+}
+
+// xlsxShapelayout directly maps the shapelayout element. This element contains
+// child elements that store information used in the editing and layout of
+// shapes.
+type xlsxShapelayout struct {
+	Ext   string     `xml:"v:ext,attr"`
+	IDmap *xlsxIDmap `xml:"o:idmap"`
+}
+
+// xlsxIDmap directly maps the idmap element.
+type xlsxIDmap struct {
+	Ext  string `xml:"v:ext,attr"`
+	Data int    `xml:"data,attr"`
+}
+
+// xlsxShape directly maps the shape element.
+type xlsxShape struct {
+	XMLName     xml.Name `xml:"v:shape"`
+	ID          string   `xml:"id,attr"`
+	Type        string   `xml:"type,attr"`
+	Style       string   `xml:"style,attr"`
+	Fillcolor   string   `xml:"fillcolor,attr"`
+	Insetmode   string   `xml:"urn:schemas-microsoft-com:office:office insetmode,attr,omitempty"`
+	Strokecolor string   `xml:"strokecolor,attr,omitempty"`
+	Val         string   `xml:",innerxml"`
+}
+
+// xlsxShapetype directly maps the shapetype element.
+type xlsxShapetype struct {
+	ID        string      `xml:"id,attr"`
+	Coordsize string      `xml:"coordsize,attr"`
+	Spt       int         `xml:"o:spt,attr"`
+	Path      string      `xml:"path,attr"`
+	Stroke    *xlsxStroke `xml:"v:stroke"`
+	VPath     *vPath      `xml:"v:path"`
+}
+
+// xlsxStroke directly maps the stroke element.
+type xlsxStroke struct {
+	Joinstyle string `xml:"joinstyle,attr"`
+}
+
+// vPath directly maps the v:path element.
+type vPath struct {
+	Gradientshapeok string `xml:"gradientshapeok,attr,omitempty"`
+	Connecttype     string `xml:"o:connecttype,attr"`
+}
+
+// vFill directly maps the v:fill element. This element must be defined within a
+// Shape element.
+type vFill struct {
+	Angle  int    `xml:"angle,attr,omitempty"`
+	Color2 string `xml:"color2,attr"`
+	Type   string `xml:"type,attr,omitempty"`
+	Fill   *oFill `xml:"o:fill"`
+}
+
+// oFill directly maps the o:fill element.
+type oFill struct {
+	Ext  string `xml:"v:ext,attr"`
+	Type string `xml:"type,attr,omitempty"`
+}
+
+// vShadow directly maps the v:shadow element. This element must be defined
+// within a Shape element. In addition, the On attribute must be set to True.
+type vShadow struct {
+	On       string `xml:"on,attr"`
+	Color    string `xml:"color,attr,omitempty"`
+	Obscured string `xml:"obscured,attr"`
+}
+
+// vTextbox directly maps the v:textbox element. This element must be defined
+// within a Shape element.
+type vTextbox struct {
+	Style string   `xml:"style,attr"`
+	Div   *xlsxDiv `xml:"div"`
+}
+
+// xlsxDiv directly maps the div element.
+type xlsxDiv struct {
+	Style string `xml:"style,attr"`
+}
+
+// xClientData (Attached Object Data) directly maps the x:ClientData element.
+// This element specifies data associated with objects attached to a
+// spreadsheet. While this element might contain any of the child elements
+// below, only certain combinations are meaningful. The ObjectType attribute
+// determines the kind of object the element represents and which subset of
+// child elements is appropriate. Relevant groups are identified for each child
+// element.
+type xClientData struct {
+	ObjectType    string `xml:"ObjectType,attr"`
+	MoveWithCells string `xml:"x:MoveWithCells,omitempty"`
+	SizeWithCells string `xml:"x:SizeWithCells,omitempty"`
+	Anchor        string `xml:"x:Anchor"`
+	AutoFill      string `xml:"x:AutoFill"`
+	Row           int    `xml:"x:Row"`
+	Column        int    `xml:"x:Column"`
+}
+
+// decodeVmlDrawing defines the structure used to parse the file
+// xl/drawings/vmlDrawing%d.vml.
+type decodeVmlDrawing struct {
+	Shape []decodeShape `xml:"urn:schemas-microsoft-com:vml shape"`
+}
+
+// decodeShape defines the structure used to parse the particular shape element.
+type decodeShape struct {
+	Val string `xml:",innerxml"`
+}
+
+// encodeShape defines the structure used to re-serialization shape element.
+type encodeShape struct {
+	Fill       *vFill       `xml:"v:fill"`
+	Shadow     *vShadow     `xml:"v:shadow"`
+	Path       *vPath       `xml:"v:path"`
+	Textbox    *vTextbox    `xml:"v:textbox"`
+	ClientData *xClientData `xml:"x:ClientData"`
+}

+ 63 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlApp.go

@@ -0,0 +1,63 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// xlsxProperties specifies to an OOXML document properties such as the
+// template used, the number of pages and words, and the application name and
+// version.
+type xlsxProperties struct {
+	XMLName              xml.Name `xml:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties Properties"`
+	Template             string
+	Manager              string
+	Company              string
+	Pages                int
+	Words                int
+	Characters           int
+	PresentationFormat   string
+	Lines                int
+	Paragraphs           int
+	Slides               int
+	Notes                int
+	TotalTime            int
+	HiddenSlides         int
+	MMClips              int
+	ScaleCrop            bool
+	HeadingPairs         *xlsxVectorVariant
+	TitlesOfParts        *xlsxVectorLpstr
+	LinksUpToDate        bool
+	CharactersWithSpaces int
+	SharedDoc            bool
+	HyperlinkBase        string
+	HLinks               *xlsxVectorVariant
+	HyperlinksChanged    bool
+	DigSig               *xlsxDigSig
+	Application          string
+	AppVersion           string
+	DocSecurity          int
+}
+
+// xlsxVectorVariant specifies the set of hyperlinks that were in this
+// document when last saved.
+type xlsxVectorVariant struct {
+	Content string `xml:",innerxml"`
+}
+
+type xlsxVectorLpstr struct {
+	Content string `xml:",innerxml"`
+}
+
+// xlsxDigSig contains the signature of a digitally signed document.
+type xlsxDigSig struct {
+	Content string `xml:",innerxml"`
+}

+ 85 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlCalcChain.go

@@ -0,0 +1,85 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// xlsxCalcChain directly maps the calcChain element. This element represents the root of the calculation chain.
+type xlsxCalcChain struct {
+	XMLName xml.Name         `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main calcChain"`
+	C       []xlsxCalcChainC `xml:"c"`
+}
+
+// xlsxCalcChainC directly maps the c element.
+//
+//     Attributes               | Attributes
+//    --------------------------+----------------------------------------------------------
+//     a (Array)                | A Boolean flag indicating whether the cell's formula
+//                              | is an array formula. True if this cell's formula is
+//                              | an array formula, false otherwise. If there is a
+//                              | conflict between this attribute and the t attribute
+//                              | of the f element (§18.3.1.40), the t attribute takes
+//                              | precedence. The possible values for this attribute
+//                              | are defined by the W3C XML Schema boolean datatype.
+//                              |
+//     i (Sheet Id)             | A sheet Id of a sheet the cell belongs to. If this is
+//                              | omitted, it is assumed to be the same as the i value
+//                              | of the previous cell.The possible values for this
+//                              | attribute are defined by the W3C XML Schema int datatype.
+//                              |
+//     l (New Dependency Level) | A Boolean flag indicating that the cell's formula
+//                              | starts a new dependency level. True if the formula
+//                              | starts a new dependency level, false otherwise.
+//                              | Starting a new dependency level means that all
+//                              | concurrent calculations, and child calculations, shall
+//                              | be completed - and the cells have new values - before
+//                              | the calc chain can continue. In other words, this
+//                              | dependency level might depend on levels that came before
+//                              | it, and any later dependency levels might depend on
+//                              | this level; but not later dependency levels can have
+//                              | any calculations started until this dependency level
+//                              | completes.The possible values for this attribute are
+//                              | defined by the W3C XML Schema boolean datatype.
+//                              |
+//     r (Cell Reference)       | An A-1 style reference to a cell.The possible values
+//                              | for this attribute are defined by the ST_CellRef
+//                              | simple type (§18.18.7).
+//                              |
+//     s (Child Chain)          | A Boolean flag indicating whether the cell's formula
+//                              | is on a child chain. True if this cell is part of a
+//                              | child chain, false otherwise. If this is omitted, it
+//                              | is assumed to be the same as the s value of the
+//                              | previous cell .A child chain is a list of calculations
+//                              | that occur which depend on the parent to the chain.
+//                              | There shall not be cross dependencies between child
+//                              | chains. Child chains are not the same as dependency
+//                              | levels - a child chain and its parent are all on the
+//                              | same dependency level. Child chains are series of
+//                              | calculations that can be independently farmed out to
+//                              | other threads or processors.The possible values for
+//                              | this attribute are defined by the W3C XML Schema
+//                              | boolean datatype.
+//                              |
+//     t (New Thread)           | A Boolean flag indicating whether the cell's formula
+//                              | starts a new thread. True if the cell's formula starts
+//                              | a new thread, false otherwise.The possible values for
+//                              | this attribute are defined by the W3C XML Schema
+//                              | boolean datatype.
+//
+type xlsxCalcChainC struct {
+	R string `xml:"r,attr"`
+	I int    `xml:"i,attr"`
+	L bool   `xml:"l,attr,omitempty"`
+	S bool   `xml:"s,attr,omitempty"`
+	T bool   `xml:"t,attr,omitempty"`
+	A bool   `xml:"a,attr,omitempty"`
+}

+ 657 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlChart.go

@@ -0,0 +1,657 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// xlsxChartSpace directly maps the chartSpace element. The chart namespace in
+// DrawingML is for representing visualizations of numeric data with column
+// charts, pie charts, scatter charts, or other types of charts.
+type xlsxChartSpace struct {
+	XMLName        xml.Name        `xml:"http://schemas.openxmlformats.org/drawingml/2006/chart chartSpace"`
+	XMLNSc         string          `xml:"xmlns:c,attr"`
+	XMLNSa         string          `xml:"xmlns:a,attr"`
+	XMLNSr         string          `xml:"xmlns:r,attr"`
+	XMLNSc16r2     string          `xml:"xmlns:c16r2,attr"`
+	Date1904       *attrValBool    `xml:"date1904"`
+	Lang           *attrValString  `xml:"lang"`
+	RoundedCorners *attrValBool    `xml:"roundedCorners"`
+	Chart          cChart          `xml:"chart"`
+	SpPr           *cSpPr          `xml:"spPr"`
+	TxPr           *cTxPr          `xml:"txPr"`
+	PrintSettings  *cPrintSettings `xml:"printSettings"`
+}
+
+// cThicknessSpPr directly maps the element that specifies the thickness of
+// the walls or floor as a percentage of the largest dimension of the plot
+// volume and SpPr element.
+type cThicknessSpPr struct {
+	Thickness *attrValInt `xml:"thickness"`
+	SpPr      *cSpPr      `xml:"spPr"`
+}
+
+// cChart (Chart) directly maps the chart element. This element specifies a
+// title.
+type cChart struct {
+	Title            *cTitle            `xml:"title"`
+	AutoTitleDeleted *cAutoTitleDeleted `xml:"autoTitleDeleted"`
+	View3D           *cView3D           `xml:"view3D"`
+	Floor            *cThicknessSpPr    `xml:"floor"`
+	SideWall         *cThicknessSpPr    `xml:"sideWall"`
+	BackWall         *cThicknessSpPr    `xml:"backWall"`
+	PlotArea         *cPlotArea         `xml:"plotArea"`
+	Legend           *cLegend           `xml:"legend"`
+	PlotVisOnly      *attrValBool       `xml:"plotVisOnly"`
+	DispBlanksAs     *attrValString     `xml:"dispBlanksAs"`
+	ShowDLblsOverMax *attrValBool       `xml:"showDLblsOverMax"`
+}
+
+// cTitle (Title) directly maps the title element. This element specifies a
+// title.
+type cTitle struct {
+	Tx      cTx          `xml:"tx,omitempty"`
+	Layout  string       `xml:"layout,omitempty"`
+	Overlay *attrValBool `xml:"overlay"`
+	SpPr    cSpPr        `xml:"spPr,omitempty"`
+	TxPr    cTxPr        `xml:"txPr,omitempty"`
+}
+
+// cTx (Chart Text) directly maps the tx element. This element specifies text
+// to use on a chart, including rich text formatting.
+type cTx struct {
+	StrRef *cStrRef `xml:"strRef"`
+	Rich   *cRich   `xml:"rich,omitempty"`
+}
+
+// cRich (Rich Text) directly maps the rich element. This element contains a
+// string with rich text formatting.
+type cRich struct {
+	BodyPr   aBodyPr `xml:"a:bodyPr,omitempty"`
+	LstStyle string  `xml:"a:lstStyle,omitempty"`
+	P        aP      `xml:"a:p"`
+}
+
+// aBodyPr (Body Properties) directly maps the a:bodyPr element. This element
+// defines the body properties for the text body within a shape.
+type aBodyPr struct {
+	Anchor           string  `xml:"anchor,attr,omitempty"`
+	AnchorCtr        bool    `xml:"anchorCtr,attr"`
+	Rot              int     `xml:"rot,attr"`
+	BIns             float64 `xml:"bIns,attr,omitempty"`
+	CompatLnSpc      bool    `xml:"compatLnSpc,attr,omitempty"`
+	ForceAA          bool    `xml:"forceAA,attr,omitempty"`
+	FromWordArt      bool    `xml:"fromWordArt,attr,omitempty"`
+	HorzOverflow     string  `xml:"horzOverflow,attr,omitempty"`
+	LIns             float64 `xml:"lIns,attr,omitempty"`
+	NumCol           int     `xml:"numCol,attr,omitempty"`
+	RIns             float64 `xml:"rIns,attr,omitempty"`
+	RtlCol           bool    `xml:"rtlCol,attr,omitempty"`
+	SpcCol           int     `xml:"spcCol,attr,omitempty"`
+	SpcFirstLastPara bool    `xml:"spcFirstLastPara,attr"`
+	TIns             float64 `xml:"tIns,attr,omitempty"`
+	Upright          bool    `xml:"upright,attr,omitempty"`
+	Vert             string  `xml:"vert,attr,omitempty"`
+	VertOverflow     string  `xml:"vertOverflow,attr,omitempty"`
+	Wrap             string  `xml:"wrap,attr,omitempty"`
+}
+
+// aP (Paragraph) directly maps the a:p element. This element specifies a
+// paragraph of content in the document.
+type aP struct {
+	PPr        *aPPr        `xml:"a:pPr"`
+	R          *aR          `xml:"a:r"`
+	EndParaRPr *aEndParaRPr `xml:"a:endParaRPr"`
+}
+
+// aPPr (Paragraph Properties) directly maps the a:pPr element. This element
+// specifies a set of paragraph properties which shall be applied to the
+// contents of the parent paragraph after all style/numbering/table properties
+// have been applied to the text. These properties are defined as direct
+// formatting, since they are directly applied to the paragraph and supersede
+// any formatting from styles.
+type aPPr struct {
+	DefRPr aRPr `xml:"a:defRPr"`
+}
+
+// aSolidFill (Solid Fill) directly maps the solidFill element. This element
+// specifies a solid color fill. The shape is filled entirely with the specified
+// color.
+type aSolidFill struct {
+	SchemeClr *aSchemeClr    `xml:"a:schemeClr"`
+	SrgbClr   *attrValString `xml:"a:srgbClr"`
+}
+
+// aSchemeClr (Scheme Color) directly maps the a:schemeClr element. This
+// element specifies a color bound to a user's theme. As with all elements which
+// define a color, it is possible to apply a list of color transforms to the
+// base color defined.
+type aSchemeClr struct {
+	Val    string      `xml:"val,attr,omitempty"`
+	LumMod *attrValInt `xml:"a:lumMod"`
+	LumOff *attrValInt `xml:"a:lumOff"`
+}
+
+// attrValInt directly maps the val element with integer data type as an
+// attribute。
+type attrValInt struct {
+	Val *int `xml:"val,attr"`
+}
+
+// attrValFloat directly maps the val element with float64 data type as an
+// attribute。
+type attrValFloat struct {
+	Val *float64 `xml:"val,attr"`
+}
+
+// attrValBool directly maps the val element with boolean data type as an
+// attribute。
+type attrValBool struct {
+	Val *bool `xml:"val,attr"`
+}
+
+// attrValString directly maps the val element with string data type as an
+// attribute。
+type attrValString struct {
+	Val *string `xml:"val,attr"`
+}
+
+// aCs directly maps the a:cs element.
+type aCs struct {
+	Typeface string `xml:"typeface,attr"`
+}
+
+// aEa directly maps the a:ea element.
+type aEa struct {
+	Typeface string `xml:"typeface,attr"`
+}
+
+// aLatin (Latin Font) directly maps the a:latin element. This element
+// specifies that a Latin font be used for a specific run of text. This font is
+// specified with a typeface attribute much like the others but is specifically
+// classified as a Latin font.
+type aLatin struct {
+	Typeface string `xml:"typeface,attr"`
+}
+
+// aR directly maps the a:r element.
+type aR struct {
+	RPr aRPr   `xml:"a:rPr,omitempty"`
+	T   string `xml:"a:t,omitempty"`
+}
+
+// aRPr (Run Properties) directly maps the rPr element. This element
+// specifies a set of run properties which shall be applied to the contents of
+// the parent run after all style formatting has been applied to the text. These
+// properties are defined as direct formatting, since they are directly applied
+// to the run and supersede any formatting from styles.
+type aRPr struct {
+	AltLang    string      `xml:"altLang,attr,omitempty"`
+	B          bool        `xml:"b,attr"`
+	Baseline   int         `xml:"baseline,attr"`
+	Bmk        string      `xml:"bmk,attr,omitempty"`
+	Cap        string      `xml:"cap,attr,omitempty"`
+	Dirty      bool        `xml:"dirty,attr,omitempty"`
+	Err        bool        `xml:"err,attr,omitempty"`
+	I          bool        `xml:"i,attr"`
+	Kern       int         `xml:"kern,attr"`
+	Kumimoji   bool        `xml:"kumimoji,attr,omitempty"`
+	Lang       string      `xml:"lang,attr,omitempty"`
+	NoProof    bool        `xml:"noProof,attr,omitempty"`
+	NormalizeH bool        `xml:"normalizeH,attr,omitempty"`
+	SmtClean   bool        `xml:"smtClean,attr,omitempty"`
+	SmtID      uint64      `xml:"smtId,attr,omitempty"`
+	Spc        int         `xml:"spc,attr"`
+	Strike     string      `xml:"strike,attr,omitempty"`
+	Sz         float64     `xml:"sz,attr,omitempty"`
+	U          string      `xml:"u,attr,omitempty"`
+	SolidFill  *aSolidFill `xml:"a:solidFill"`
+	Latin      *aLatin     `xml:"a:latin"`
+	Ea         *aEa        `xml:"a:ea"`
+	Cs         *aCs        `xml:"a:cs"`
+}
+
+// cSpPr (Shape Properties) directly maps the spPr element. This element
+// specifies the visual shape properties that can be applied to a shape. These
+// properties include the shape fill, outline, geometry, effects, and 3D
+// orientation.
+type cSpPr struct {
+	NoFill    *string     `xml:"a:noFill"`
+	SolidFill *aSolidFill `xml:"a:solidFill"`
+	Ln        *aLn        `xml:"a:ln"`
+	Sp3D      *aSp3D      `xml:"a:sp3d"`
+	EffectLst *string     `xml:"a:effectLst"`
+}
+
+// aSp3D (3-D Shape Properties) directly maps the a:sp3d element. This element
+// defines the 3D properties associated with a particular shape in DrawingML.
+// The 3D properties which can be applied to a shape are top and bottom bevels,
+// a contour and an extrusion.
+type aSp3D struct {
+	ContourW   int          `xml:"contourW,attr"`
+	ContourClr *aContourClr `xml:"a:contourClr"`
+}
+
+// aContourClr (Contour Color) directly maps the a:contourClr element. This
+// element defines the color for the contour on a shape. The contour of a shape
+// is a solid filled line which surrounds the outer edges of the shape.
+type aContourClr struct {
+	SchemeClr *aSchemeClr `xml:"a:schemeClr"`
+}
+
+// aLn (Outline) directly maps the a:ln element. This element specifies an
+// outline style that can be applied to a number of different objects such as
+// shapes and text. The line allows for the specifying of many different types
+// of outlines including even line dashes and bevels.
+type aLn struct {
+	Algn      string      `xml:"algn,attr,omitempty"`
+	Cap       string      `xml:"cap,attr,omitempty"`
+	Cmpd      string      `xml:"cmpd,attr,omitempty"`
+	W         int         `xml:"w,attr,omitempty"`
+	NoFill    string      `xml:"a:noFill,omitempty"`
+	Round     string      `xml:"a:round,omitempty"`
+	SolidFill *aSolidFill `xml:"a:solidFill"`
+}
+
+// cTxPr (Text Properties) directly maps the txPr element. This element
+// specifies text formatting. The lstStyle element is not supported.
+type cTxPr struct {
+	BodyPr   aBodyPr `xml:"a:bodyPr,omitempty"`
+	LstStyle string  `xml:"a:lstStyle,omitempty"`
+	P        aP      `xml:"a:p,omitempty"`
+}
+
+// aEndParaRPr (End Paragraph Run Properties) directly maps the a:endParaRPr
+// element. This element specifies the text run properties that are to be used
+// if another run is inserted after the last run specified. This effectively
+// saves the run property state so that it can be applied when the user enters
+// additional text. If this element is omitted, then the application can
+// determine which default properties to apply. It is recommended that this
+// element be specified at the end of the list of text runs within the paragraph
+// so that an orderly list is maintained.
+type aEndParaRPr struct {
+	Lang    string `xml:"lang,attr"`
+	AltLang string `xml:"altLang,attr,omitempty"`
+	Sz      int    `xml:"sz,attr,omitempty"`
+}
+
+// cAutoTitleDeleted (Auto Title Is Deleted) directly maps the
+// autoTitleDeleted element. This element specifies the title shall not be
+// shown for this chart.
+type cAutoTitleDeleted struct {
+	Val bool `xml:"val,attr"`
+}
+
+// cView3D (View In 3D) directly maps the view3D element. This element
+// specifies the 3-D view of the chart.
+type cView3D struct {
+	RotX         *attrValInt `xml:"rotX"`
+	RotY         *attrValInt `xml:"rotY"`
+	RAngAx       *attrValInt `xml:"rAngAx"`
+	DepthPercent *attrValInt `xml:"depthPercent"`
+	Perspective  *attrValInt `xml:"perspective"`
+	ExtLst       *xlsxExtLst `xml:"extLst"`
+}
+
+// cPlotArea directly maps the plotArea element. This element specifies the
+// plot area of the chart.
+type cPlotArea struct {
+	Layout         *string  `xml:"layout"`
+	AreaChart      *cCharts `xml:"areaChart"`
+	Area3DChart    *cCharts `xml:"area3DChart"`
+	BarChart       *cCharts `xml:"barChart"`
+	Bar3DChart     *cCharts `xml:"bar3DChart"`
+	BubbleChart    *cCharts `xml:"bubbleChart"`
+	DoughnutChart  *cCharts `xml:"doughnutChart"`
+	LineChart      *cCharts `xml:"lineChart"`
+	PieChart       *cCharts `xml:"pieChart"`
+	Pie3DChart     *cCharts `xml:"pie3DChart"`
+	OfPieChart     *cCharts `xml:"ofPieChart"`
+	RadarChart     *cCharts `xml:"radarChart"`
+	ScatterChart   *cCharts `xml:"scatterChart"`
+	Surface3DChart *cCharts `xml:"surface3DChart"`
+	SurfaceChart   *cCharts `xml:"surfaceChart"`
+	CatAx          []*cAxs  `xml:"catAx"`
+	ValAx          []*cAxs  `xml:"valAx"`
+	SerAx          []*cAxs  `xml:"serAx"`
+	SpPr           *cSpPr   `xml:"spPr"`
+}
+
+// cCharts specifies the common element of the chart.
+type cCharts struct {
+	BarDir       *attrValString `xml:"barDir"`
+	BubbleScale  *attrValFloat  `xml:"bubbleScale"`
+	Grouping     *attrValString `xml:"grouping"`
+	RadarStyle   *attrValString `xml:"radarStyle"`
+	ScatterStyle *attrValString `xml:"scatterStyle"`
+	OfPieType    *attrValString `xml:"ofPieType"`
+	VaryColors   *attrValBool   `xml:"varyColors"`
+	Wireframe    *attrValBool   `xml:"wireframe"`
+	Ser          *[]cSer        `xml:"ser"`
+	SerLines     *attrValString `xml:"serLines"`
+	DLbls        *cDLbls        `xml:"dLbls"`
+	Shape        *attrValString `xml:"shape"`
+	HoleSize     *attrValInt    `xml:"holeSize"`
+	Smooth       *attrValBool   `xml:"smooth"`
+	Overlap      *attrValInt    `xml:"overlap"`
+	AxID         []*attrValInt  `xml:"axId"`
+}
+
+// cAxs directly maps the catAx and valAx element.
+type cAxs struct {
+	AxID           *attrValInt    `xml:"axId"`
+	Scaling        *cScaling      `xml:"scaling"`
+	Delete         *attrValBool   `xml:"delete"`
+	AxPos          *attrValString `xml:"axPos"`
+	MajorGridlines *cChartLines   `xml:"majorGridlines"`
+	MinorGridlines *cChartLines   `xml:"minorGridlines"`
+	NumFmt         *cNumFmt       `xml:"numFmt"`
+	MajorTickMark  *attrValString `xml:"majorTickMark"`
+	MinorTickMark  *attrValString `xml:"minorTickMark"`
+	TickLblPos     *attrValString `xml:"tickLblPos"`
+	SpPr           *cSpPr         `xml:"spPr"`
+	TxPr           *cTxPr         `xml:"txPr"`
+	CrossAx        *attrValInt    `xml:"crossAx"`
+	Crosses        *attrValString `xml:"crosses"`
+	CrossBetween   *attrValString `xml:"crossBetween"`
+	MajorUnit      *attrValFloat  `xml:"majorUnit"`
+	MinorUnit      *attrValFloat  `xml:"minorUnit"`
+	Auto           *attrValBool   `xml:"auto"`
+	LblAlgn        *attrValString `xml:"lblAlgn"`
+	LblOffset      *attrValInt    `xml:"lblOffset"`
+	TickLblSkip    *attrValInt    `xml:"tickLblSkip"`
+	TickMarkSkip   *attrValInt    `xml:"tickMarkSkip"`
+	NoMultiLvlLbl  *attrValBool   `xml:"noMultiLvlLbl"`
+}
+
+// cChartLines directly maps the chart lines content model.
+type cChartLines struct {
+	SpPr *cSpPr `xml:"spPr"`
+}
+
+// cScaling directly maps the scaling element. This element contains
+// additional axis settings.
+type cScaling struct {
+	LogBase     *attrValFloat  `xml:"logBase"`
+	Orientation *attrValString `xml:"orientation"`
+	Max         *attrValFloat  `xml:"max"`
+	Min         *attrValFloat  `xml:"min"`
+}
+
+// cNumFmt (Numbering Format) directly maps the numFmt element. This element
+// specifies number formatting for the parent element.
+type cNumFmt struct {
+	FormatCode   string `xml:"formatCode,attr"`
+	SourceLinked bool   `xml:"sourceLinked,attr"`
+}
+
+// cSer directly maps the ser element. This element specifies a series on a
+// chart.
+type cSer struct {
+	IDx              *attrValInt  `xml:"idx"`
+	Order            *attrValInt  `xml:"order"`
+	Tx               *cTx         `xml:"tx"`
+	SpPr             *cSpPr       `xml:"spPr"`
+	DPt              []*cDPt      `xml:"dPt"`
+	DLbls            *cDLbls      `xml:"dLbls"`
+	Marker           *cMarker     `xml:"marker"`
+	InvertIfNegative *attrValBool `xml:"invertIfNegative"`
+	Cat              *cCat        `xml:"cat"`
+	Val              *cVal        `xml:"val"`
+	XVal             *cCat        `xml:"xVal"`
+	YVal             *cVal        `xml:"yVal"`
+	Smooth           *attrValBool `xml:"smooth"`
+	BubbleSize       *cVal        `xml:"bubbleSize"`
+	Bubble3D         *attrValBool `xml:"bubble3D"`
+}
+
+// cMarker (Marker) directly maps the marker element. This element specifies a
+// data marker.
+type cMarker struct {
+	Symbol *attrValString `xml:"symbol"`
+	Size   *attrValInt    `xml:"size"`
+	SpPr   *cSpPr         `xml:"spPr"`
+}
+
+// cDPt (Data Point) directly maps the dPt element. This element specifies a
+// single data point.
+type cDPt struct {
+	IDx      *attrValInt  `xml:"idx"`
+	Bubble3D *attrValBool `xml:"bubble3D"`
+	SpPr     *cSpPr       `xml:"spPr"`
+}
+
+// cCat (Category Axis Data) directly maps the cat element. This element
+// specifies the data used for the category axis.
+type cCat struct {
+	StrRef *cStrRef `xml:"strRef"`
+}
+
+// cStrRef (String Reference) directly maps the strRef element. This element
+// specifies a reference to data for a single data label or title with a cache
+// of the last values used.
+type cStrRef struct {
+	F        string     `xml:"f"`
+	StrCache *cStrCache `xml:"strCache"`
+}
+
+// cStrCache (String Cache) directly maps the strCache element. This element
+// specifies the last string data used for a chart.
+type cStrCache struct {
+	Pt      []*cPt      `xml:"pt"`
+	PtCount *attrValInt `xml:"ptCount"`
+}
+
+// cPt directly maps the pt element. This element specifies data for a
+// particular data point.
+type cPt struct {
+	IDx int     `xml:"idx,attr"`
+	V   *string `xml:"v"`
+}
+
+// cVal directly maps the val element. This element specifies the data values
+// which shall be used to define the location of data markers on a chart.
+type cVal struct {
+	NumRef *cNumRef `xml:"numRef"`
+}
+
+// cNumRef directly maps the numRef element. This element specifies a
+// reference to numeric data with a cache of the last values used.
+type cNumRef struct {
+	F        string     `xml:"f"`
+	NumCache *cNumCache `xml:"numCache"`
+}
+
+// cNumCache directly maps the numCache element. This element specifies the
+// last data shown on the chart for a series.
+type cNumCache struct {
+	FormatCode string      `xml:"formatCode"`
+	Pt         []*cPt      `xml:"pt"`
+	PtCount    *attrValInt `xml:"ptCount"`
+}
+
+// cDLbls (Data Lables) directly maps the dLbls element. This element serves
+// as a root element that specifies the settings for the data labels for an
+// entire series or the entire chart. It contains child elements that specify
+// the specific formatting and positioning settings.
+type cDLbls struct {
+	ShowLegendKey   *attrValBool `xml:"showLegendKey"`
+	ShowVal         *attrValBool `xml:"showVal"`
+	ShowCatName     *attrValBool `xml:"showCatName"`
+	ShowSerName     *attrValBool `xml:"showSerName"`
+	ShowPercent     *attrValBool `xml:"showPercent"`
+	ShowBubbleSize  *attrValBool `xml:"showBubbleSize"`
+	ShowLeaderLines *attrValBool `xml:"showLeaderLines"`
+}
+
+// cLegend (Legend) directly maps the legend element. This element specifies
+// the legend.
+type cLegend struct {
+	Layout    *string        `xml:"layout"`
+	LegendPos *attrValString `xml:"legendPos"`
+	Overlay   *attrValBool   `xml:"overlay"`
+	SpPr      *cSpPr         `xml:"spPr"`
+	TxPr      *cTxPr         `xml:"txPr"`
+}
+
+// cPrintSettings directly maps the printSettings element. This element
+// specifies the print settings for the chart.
+type cPrintSettings struct {
+	HeaderFooter *string       `xml:"headerFooter"`
+	PageMargins  *cPageMargins `xml:"pageMargins"`
+	PageSetup    *string       `xml:"pageSetup"`
+}
+
+// cPageMargins directly maps the pageMargins element. This element specifies
+// the page margins for a chart.
+type cPageMargins struct {
+	B      float64 `xml:"b,attr"`
+	Footer float64 `xml:"footer,attr"`
+	Header float64 `xml:"header,attr"`
+	L      float64 `xml:"l,attr"`
+	R      float64 `xml:"r,attr"`
+	T      float64 `xml:"t,attr"`
+}
+
+// formatChartAxis directly maps the format settings of the chart axis.
+type formatChartAxis struct {
+	Crossing            string  `json:"crossing"`
+	MajorGridlines      bool    `json:"major_grid_lines"`
+	MinorGridlines      bool    `json:"minor_grid_lines"`
+	MajorTickMark       string  `json:"major_tick_mark"`
+	MinorTickMark       string  `json:"minor_tick_mark"`
+	MinorUnitType       string  `json:"minor_unit_type"`
+	MajorUnit           float64 `json:"major_unit"`
+	MajorUnitType       string  `json:"major_unit_type"`
+	TickLabelSkip       int     `json:"tick_label_skip"`
+	DisplayUnits        string  `json:"display_units"`
+	DisplayUnitsVisible bool    `json:"display_units_visible"`
+	DateAxis            bool    `json:"date_axis"`
+	ReverseOrder        bool    `json:"reverse_order"`
+	Maximum             float64 `json:"maximum"`
+	Minimum             float64 `json:"minimum"`
+	NumFormat           string  `json:"num_format"`
+	NumFont             struct {
+		Color     string `json:"color"`
+		Bold      bool   `json:"bold"`
+		Italic    bool   `json:"italic"`
+		Underline bool   `json:"underline"`
+	} `json:"num_font"`
+	LogBase    float64      `json:"logbase"`
+	NameLayout formatLayout `json:"name_layout"`
+}
+
+type formatChartDimension struct {
+	Width  int `json:"width"`
+	Height int `json:"height"`
+}
+
+// formatChart directly maps the format settings of the chart.
+type formatChart struct {
+	Type      string               `json:"type"`
+	Series    []formatChartSeries  `json:"series"`
+	Format    formatPicture        `json:"format"`
+	Dimension formatChartDimension `json:"dimension"`
+	Legend    formatChartLegend    `json:"legend"`
+	Title     formatChartTitle     `json:"title"`
+	XAxis     formatChartAxis      `json:"x_axis"`
+	YAxis     formatChartAxis      `json:"y_axis"`
+	Chartarea struct {
+		Border struct {
+			None bool `json:"none"`
+		} `json:"border"`
+		Fill struct {
+			Color string `json:"color"`
+		} `json:"fill"`
+		Pattern struct {
+			Pattern string `json:"pattern"`
+			FgColor string `json:"fg_color"`
+			BgColor string `json:"bg_color"`
+		} `json:"pattern"`
+	} `json:"chartarea"`
+	Plotarea struct {
+		ShowBubbleSize  bool `json:"show_bubble_size"`
+		ShowCatName     bool `json:"show_cat_name"`
+		ShowLeaderLines bool `json:"show_leader_lines"`
+		ShowPercent     bool `json:"show_percent"`
+		ShowSerName     bool `json:"show_series_name"`
+		ShowVal         bool `json:"show_val"`
+		Gradient        struct {
+			Colors []string `json:"colors"`
+		} `json:"gradient"`
+		Border struct {
+			Color    string `json:"color"`
+			Width    int    `json:"width"`
+			DashType string `json:"dash_type"`
+		} `json:"border"`
+		Fill struct {
+			Color string `json:"color"`
+		} `json:"fill"`
+		Layout formatLayout `json:"layout"`
+	} `json:"plotarea"`
+	ShowBlanksAs   string `json:"show_blanks_as"`
+	ShowHiddenData bool   `json:"show_hidden_data"`
+	SetRotation    int    `json:"set_rotation"`
+	SetHoleSize    int    `json:"set_hole_size"`
+	order          int
+}
+
+// formatChartLegend directly maps the format settings of the chart legend.
+type formatChartLegend struct {
+	None            bool         `json:"none"`
+	DeleteSeries    []int        `json:"delete_series"`
+	Font            Font         `json:"font"`
+	Layout          formatLayout `json:"layout"`
+	Position        string       `json:"position"`
+	ShowLegendEntry bool         `json:"show_legend_entry"`
+	ShowLegendKey   bool         `json:"show_legend_key"`
+}
+
+// formatChartSeries directly maps the format settings of the chart series.
+type formatChartSeries struct {
+	Name       string `json:"name"`
+	Categories string `json:"categories"`
+	Values     string `json:"values"`
+	Line       struct {
+		None  bool    `json:"none"`
+		Color string  `json:"color"`
+		Width float64 `json:"width"`
+	} `json:"line"`
+	Marker struct {
+		Type   string  `json:"type"`
+		Size   int     `json:"size"`
+		Width  float64 `json:"width"`
+		Border struct {
+			Color string `json:"color"`
+			None  bool   `json:"none"`
+		} `json:"border"`
+		Fill struct {
+			Color string `json:"color"`
+			None  bool   `json:"none"`
+		} `json:"fill"`
+	} `json:"marker"`
+}
+
+// formatChartTitle directly maps the format settings of the chart title.
+type formatChartTitle struct {
+	None    bool         `json:"none"`
+	Name    string       `json:"name"`
+	Overlay bool         `json:"overlay"`
+	Layout  formatLayout `json:"layout"`
+}
+
+// formatLayout directly maps the format settings of the element layout.
+type formatLayout struct {
+	X      float64 `json:"x"`
+	Y      float64 `json:"y"`
+	Width  float64 `json:"width"`
+	Height float64 `json:"height"`
+}

+ 88 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlChartSheet.go

@@ -0,0 +1,88 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// struct code generated by github.com/xuri/xgen
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX files. Support reads and writes XLSX file generated by
+// Microsoft Excel™ 2007 and later. Support save file without losing original
+// charts of XLSX. This library needs Go version 1.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// xlsxChartsheet directly maps the chartsheet element of Chartsheet Parts in
+// a SpreadsheetML document.
+type xlsxChartsheet struct {
+	XMLName          xml.Name                     `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main chartsheet"`
+	SheetPr          []*xlsxChartsheetPr          `xml:"sheetPr"`
+	SheetViews       []*xlsxChartsheetViews       `xml:"sheetViews"`
+	SheetProtection  []*xlsxChartsheetProtection  `xml:"sheetProtection"`
+	CustomSheetViews []*xlsxCustomChartsheetViews `xml:"customSheetViews"`
+	PageMargins      *xlsxPageMargins             `xml:"pageMargins"`
+	PageSetup        []*xlsxPageSetUp             `xml:"pageSetup"`
+	HeaderFooter     *xlsxHeaderFooter            `xml:"headerFooter"`
+	Drawing          *xlsxDrawing                 `xml:"drawing"`
+	DrawingHF        []*xlsxDrawingHF             `xml:"drawingHF"`
+	Picture          []*xlsxPicture               `xml:"picture"`
+	WebPublishItems  []*xlsxInnerXML              `xml:"webPublishItems"`
+	ExtLst           []*xlsxExtLst                `xml:"extLst"`
+}
+
+// xlsxChartsheetPr specifies chart sheet properties.
+type xlsxChartsheetPr struct {
+	XMLName       xml.Name        `xml:"sheetPr"`
+	PublishedAttr bool            `xml:"published,attr,omitempty"`
+	CodeNameAttr  string          `xml:"codeName,attr,omitempty"`
+	TabColor      []*xlsxTabColor `xml:"tabColor"`
+}
+
+// xlsxChartsheetViews specifies chart sheet views.
+type xlsxChartsheetViews struct {
+	XMLName   xml.Name              `xml:"sheetViews"`
+	SheetView []*xlsxChartsheetView `xml:"sheetView"`
+	ExtLst    []*xlsxExtLst         `xml:"extLst"`
+}
+
+// xlsxChartsheetView defines custom view properties for chart sheets.
+type xlsxChartsheetView struct {
+	XMLName            xml.Name      `xml:"sheetView"`
+	TabSelectedAttr    bool          `xml:"tabSelected,attr,omitempty"`
+	ZoomScaleAttr      uint32        `xml:"zoomScale,attr,omitempty"`
+	WorkbookViewIDAttr uint32        `xml:"workbookViewId,attr"`
+	ZoomToFitAttr      bool          `xml:"zoomToFit,attr,omitempty"`
+	ExtLst             []*xlsxExtLst `xml:"extLst"`
+}
+
+// xlsxChartsheetProtection collection expresses the chart sheet protection
+// options to enforce when the chart sheet is protected.
+type xlsxChartsheetProtection struct {
+	XMLName           xml.Name `xml:"sheetProtection"`
+	AlgorithmNameAttr string   `xml:"algorithmName,attr,omitempty"`
+	HashValueAttr     []byte   `xml:"hashValue,attr,omitempty"`
+	SaltValueAttr     []byte   `xml:"saltValue,attr,omitempty"`
+	SpinCountAttr     uint32   `xml:"spinCount,attr,omitempty"`
+	ContentAttr       bool     `xml:"content,attr,omitempty"`
+	ObjectsAttr       bool     `xml:"objects,attr,omitempty"`
+}
+
+// xlsxCustomChartsheetViews collection of custom Chart Sheet View
+// information.
+type xlsxCustomChartsheetViews struct {
+	XMLName         xml.Name                    `xml:"customChartsheetViews"`
+	CustomSheetView []*xlsxCustomChartsheetView `xml:"customSheetView"`
+}
+
+// xlsxCustomChartsheetView defines custom view properties for chart sheets.
+type xlsxCustomChartsheetView struct {
+	XMLName       xml.Name            `xml:"customChartsheetView"`
+	GUIDAttr      string              `xml:"guid,attr"`
+	ScaleAttr     uint32              `xml:"scale,attr,omitempty"`
+	StateAttr     string              `xml:"state,attr,omitempty"`
+	ZoomToFitAttr bool                `xml:"zoomToFit,attr,omitempty"`
+	PageMargins   []*xlsxPageMargins  `xml:"pageMargins"`
+	PageSetup     []*xlsxPageSetUp    `xml:"pageSetup"`
+	HeaderFooter  []*xlsxHeaderFooter `xml:"headerFooter"`
+}

+ 87 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlComments.go

@@ -0,0 +1,87 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// xlsxComments directly maps the comments element from the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main. A comment is a
+// rich text note that is attached to and associated with a cell, separate from
+// other cell content. Comment content is stored separate from the cell, and is
+// displayed in a drawing object (like a text box) that is separate from, but
+// associated with, a cell. Comments are used as reminders, such as noting how a
+// complex formula works, or to provide feedback to other users. Comments can
+// also be used to explain assumptions made in a formula or to call out
+// something special about the cell.
+type xlsxComments struct {
+	XMLName     xml.Name        `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main comments"`
+	Authors     []xlsxAuthor    `xml:"authors"`
+	CommentList xlsxCommentList `xml:"commentList"`
+}
+
+// xlsxAuthor directly maps the author element. This element holds a string
+// representing the name of a single author of comments. Every comment shall
+// have an author. The maximum length of the author string is an implementation
+// detail, but a good guideline is 255 chars.
+type xlsxAuthor struct {
+	Author string `xml:"author"`
+}
+
+// xlsxCommentList (List of Comments) directly maps the xlsxCommentList element.
+// This element is a container that holds a list of comments for the sheet.
+type xlsxCommentList struct {
+	Comment []xlsxComment `xml:"comment"`
+}
+
+// xlsxComment directly maps the comment element. This element represents a
+// single user entered comment. Each comment shall have an author and can
+// optionally contain richly formatted text.
+type xlsxComment struct {
+	Ref      string   `xml:"ref,attr"`
+	AuthorID int      `xml:"authorId,attr"`
+	Text     xlsxText `xml:"text"`
+}
+
+// xlsxText directly maps the text element. This element contains rich text
+// which represents the text of a comment. The maximum length for this text is a
+// spreadsheet application implementation detail. A recommended guideline is
+// 32767 chars.
+type xlsxText struct {
+	T          *string          `xml:"t"`
+	R          []xlsxR          `xml:"r"`
+	RPh        *xlsxPhoneticRun `xml:"rPh"`
+	PhoneticPr *xlsxPhoneticPr  `xml:"phoneticPr"`
+}
+
+// xlsxPhoneticRun element represents a run of text which displays a phonetic
+// hint for this String Item (si). Phonetic hints are used to give information
+// about the pronunciation of an East Asian language. The hints are displayed
+// as text within the spreadsheet cells across the top portion of the cell.
+type xlsxPhoneticRun struct {
+	Sb uint32 `xml:"sb,attr"`
+	Eb uint32 `xml:"eb,attr"`
+	T  string `xml:"t,attr"`
+}
+
+// formatComment directly maps the format settings of the comment.
+type formatComment struct {
+	Author string `json:"author"`
+	Text   string `json:"text"`
+}
+
+// Comment directly maps the comment information.
+type Comment struct {
+	Author   string `json:"author"`
+	AuthorID int    `json:"author_id"`
+	Ref      string `json:"ref"`
+	Text     string `json:"text"`
+}

+ 37 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlContentTypes.go

@@ -0,0 +1,37 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// xlsxTypes directly maps the types element of content types for relationship
+// parts, it takes a Multipurpose Internet Mail Extension (MIME) media type as a
+// value.
+type xlsxTypes struct {
+	XMLName   xml.Name       `xml:"http://schemas.openxmlformats.org/package/2006/content-types Types"`
+	Overrides []xlsxOverride `xml:"Override"`
+	Defaults  []xlsxDefault  `xml:"Default"`
+}
+
+// xlsxOverride directly maps the override element in the namespace
+// http://schemas.openxmlformats.org/package/2006/content-types
+type xlsxOverride struct {
+	PartName    string `xml:",attr"`
+	ContentType string `xml:",attr"`
+}
+
+// xlsxDefault directly maps the default element in the namespace
+// http://schemas.openxmlformats.org/package/2006/content-types
+type xlsxDefault struct {
+	Extension   string `xml:",attr"`
+	ContentType string `xml:",attr"`
+}

+ 91 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlCore.go

@@ -0,0 +1,91 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// DocProperties directly maps the document core properties.
+type DocProperties struct {
+	Category       string
+	ContentStatus  string
+	Created        string
+	Creator        string
+	Description    string
+	Identifier     string
+	Keywords       string
+	LastModifiedBy string
+	Modified       string
+	Revision       string
+	Subject        string
+	Title          string
+	Language       string
+	Version        string
+}
+
+// decodeCoreProperties directly maps the root element for a part of this
+// content type shall coreProperties. In order to solve the problem that the
+// label structure is changed after serialization and deserialization, two
+// different structures are defined. decodeCoreProperties just for
+// deserialization.
+type decodeCoreProperties struct {
+	XMLName        xml.Name `xml:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties coreProperties"`
+	Title          string   `xml:"http://purl.org/dc/elements/1.1/ title,omitempty"`
+	Subject        string   `xml:"http://purl.org/dc/elements/1.1/ subject,omitempty"`
+	Creator        string   `xml:"http://purl.org/dc/elements/1.1/ creator"`
+	Keywords       string   `xml:"keywords,omitempty"`
+	Description    string   `xml:"http://purl.org/dc/elements/1.1/ description,omitempty"`
+	LastModifiedBy string   `xml:"lastModifiedBy"`
+	Language       string   `xml:"http://purl.org/dc/elements/1.1/ language,omitempty"`
+	Identifier     string   `xml:"http://purl.org/dc/elements/1.1/ identifier,omitempty"`
+	Revision       string   `xml:"revision,omitempty"`
+	Created        struct {
+		Text string `xml:",chardata"`
+		Type string `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
+	} `xml:"http://purl.org/dc/terms/ created"`
+	Modified struct {
+		Text string `xml:",chardata"`
+		Type string `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
+	} `xml:"http://purl.org/dc/terms/ modified"`
+	ContentStatus string `xml:"contentStatus,omitempty"`
+	Category      string `xml:"category,omitempty"`
+	Version       string `xml:"version,omitempty"`
+}
+
+// xlsxCoreProperties directly maps the root element for a part of this
+// content type shall coreProperties.
+type xlsxCoreProperties struct {
+	XMLName        xml.Name `xml:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties coreProperties"`
+	Dc             string   `xml:"xmlns:dc,attr"`
+	Dcterms        string   `xml:"xmlns:dcterms,attr"`
+	Dcmitype       string   `xml:"xmlns:dcmitype,attr"`
+	XSI            string   `xml:"xmlns:xsi,attr"`
+	Title          string   `xml:"dc:title,omitempty"`
+	Subject        string   `xml:"dc:subject,omitempty"`
+	Creator        string   `xml:"dc:creator"`
+	Keywords       string   `xml:"keywords,omitempty"`
+	Description    string   `xml:"dc:description,omitempty"`
+	LastModifiedBy string   `xml:"lastModifiedBy"`
+	Language       string   `xml:"dc:language,omitempty"`
+	Identifier     string   `xml:"dc:identifier,omitempty"`
+	Revision       string   `xml:"revision,omitempty"`
+	Created        struct {
+		Text string `xml:",chardata"`
+		Type string `xml:"xsi:type,attr"`
+	} `xml:"dcterms:created"`
+	Modified struct {
+		Text string `xml:",chardata"`
+		Type string `xml:"xsi:type,attr"`
+	} `xml:"dcterms:modified"`
+	ContentStatus string `xml:"contentStatus,omitempty"`
+	Category      string `xml:"category,omitempty"`
+	Version       string `xml:"version,omitempty"`
+}

+ 235 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlDecodeDrawing.go

@@ -0,0 +1,235 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// decodeCellAnchor directly maps the oneCellAnchor (One Cell Anchor Shape
+// Size) and twoCellAnchor (Two Cell Anchor Shape Size). This element
+// specifies a two cell anchor placeholder for a group, a shape, or a drawing
+// element. It moves with cells and its extents are in EMU units.
+type decodeCellAnchor struct {
+	EditAs     string            `xml:"editAs,attr,omitempty"`
+	From       *decodeFrom       `xml:"from"`
+	To         *decodeTo         `xml:"to"`
+	Sp         *decodeSp         `xml:"sp"`
+	ClientData *decodeClientData `xml:"clientData"`
+	Content    string            `xml:",innerxml"`
+}
+
+// xdrSp (Shape) directly maps the sp element. This element specifies the
+// existence of a single shape. A shape can either be a preset or a custom
+// geometry, defined using the SpreadsheetDrawingML framework. In addition to
+// a geometry each shape can have both visual and non-visual properties
+// attached. Text and corresponding styling information can also be attached
+// to a shape. This shape is specified along with all other shapes within
+// either the shape tree or group shape elements.
+type decodeSp struct {
+	NvSpPr *decodeNvSpPr `xml:"nvSpPr"`
+	SpPr   *decodeSpPr   `xml:"spPr"`
+}
+
+// decodeSp (Non-Visual Properties for a Shape) directly maps the nvSpPr
+// element. This element specifies all non-visual properties for a shape. This
+// element is a container for the non-visual identification properties, shape
+// properties and application properties that are to be associated with a
+// shape. This allows for additional information that does not affect the
+// appearance of the shape to be stored.
+type decodeNvSpPr struct {
+	CNvPr   *decodeCNvPr   `xml:"cNvPr"`
+	ExtLst  *decodeExt     `xml:"extLst"`
+	CNvSpPr *decodeCNvSpPr `xml:"cNvSpPr"`
+}
+
+// decodeCNvSpPr (Connection Non-Visual Shape Properties) directly maps the
+// cNvSpPr element. This element specifies the set of non-visual properties
+// for a connection shape. These properties specify all data about the
+// connection shape which do not affect its display within a spreadsheet.
+type decodeCNvSpPr struct {
+	TxBox bool `xml:"txBox,attr"`
+}
+
+// decodeWsDr directly maps the root element for a part of this content type
+// shall wsDr. In order to solve the problem that the label structure is
+// changed after serialization and deserialization, two different structures
+// are defined. decodeWsDr just for deserialization.
+type decodeWsDr struct {
+	A             string              `xml:"xmlns a,attr"`
+	Xdr           string              `xml:"xmlns xdr,attr"`
+	R             string              `xml:"xmlns r,attr"`
+	OneCellAnchor []*decodeCellAnchor `xml:"oneCellAnchor,omitempty"`
+	TwoCellAnchor []*decodeCellAnchor `xml:"twoCellAnchor,omitempty"`
+	XMLName       xml.Name            `xml:"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing wsDr,omitempty"`
+}
+
+// decodeTwoCellAnchor directly maps the oneCellAnchor (One Cell Anchor Shape
+// Size) and twoCellAnchor (Two Cell Anchor Shape Size). This element
+// specifies a two cell anchor placeholder for a group, a shape, or a drawing
+// element. It moves with cells and its extents are in EMU units.
+type decodeTwoCellAnchor struct {
+	From       *decodeFrom       `xml:"from"`
+	To         *decodeTo         `xml:"to"`
+	Pic        *decodePic        `xml:"pic,omitempty"`
+	ClientData *decodeClientData `xml:"clientData"`
+}
+
+// decodeCNvPr directly maps the cNvPr (Non-Visual Drawing Properties). This
+// element specifies non-visual canvas properties. This allows for additional
+// information that does not affect the appearance of the picture to be
+// stored.
+type decodeCNvPr struct {
+	ID    int    `xml:"id,attr"`
+	Name  string `xml:"name,attr"`
+	Descr string `xml:"descr,attr"`
+	Title string `xml:"title,attr,omitempty"`
+}
+
+// decodePicLocks directly maps the picLocks (Picture Locks). This element
+// specifies all locking properties for a graphic frame. These properties
+// inform the generating application about specific properties that have been
+// previously locked and thus should not be changed.
+type decodePicLocks struct {
+	NoAdjustHandles    bool `xml:"noAdjustHandles,attr,omitempty"`
+	NoChangeArrowheads bool `xml:"noChangeArrowheads,attr,omitempty"`
+	NoChangeAspect     bool `xml:"noChangeAspect,attr"`
+	NoChangeShapeType  bool `xml:"noChangeShapeType,attr,omitempty"`
+	NoCrop             bool `xml:"noCrop,attr,omitempty"`
+	NoEditPoints       bool `xml:"noEditPoints,attr,omitempty"`
+	NoGrp              bool `xml:"noGrp,attr,omitempty"`
+	NoMove             bool `xml:"noMove,attr,omitempty"`
+	NoResize           bool `xml:"noResize,attr,omitempty"`
+	NoRot              bool `xml:"noRot,attr,omitempty"`
+	NoSelect           bool `xml:"noSelect,attr,omitempty"`
+}
+
+// decodeBlip directly maps the blip element in the namespace
+// http://purl.oclc.org/ooxml/officeDoc ument/relationships - This element
+// specifies the existence of an image (binary large image or picture) and
+// contains a reference to the image data.
+type decodeBlip struct {
+	Embed  string `xml:"embed,attr"`
+	Cstate string `xml:"cstate,attr,omitempty"`
+	R      string `xml:"r,attr"`
+}
+
+// decodeStretch directly maps the stretch element. This element specifies
+// that a BLIP should be stretched to fill the target rectangle. The other
+// option is a tile where a BLIP is tiled to fill the available area.
+type decodeStretch struct {
+	FillRect string `xml:"fillRect"`
+}
+
+// decodeOff directly maps the colOff and rowOff element. This element is used
+// to specify the column offset within a cell.
+type decodeOff struct {
+	X int `xml:"x,attr"`
+	Y int `xml:"y,attr"`
+}
+
+// decodeExt directly maps the ext element.
+type decodeExt struct {
+	Cx int `xml:"cx,attr"`
+	Cy int `xml:"cy,attr"`
+}
+
+// decodePrstGeom directly maps the prstGeom (Preset geometry). This element
+// specifies when a preset geometric shape should be used instead of a custom
+// geometric shape. The generating application should be able to render all
+// preset geometries enumerated in the ST_ShapeType list.
+type decodePrstGeom struct {
+	Prst string `xml:"prst,attr"`
+}
+
+// decodeXfrm directly maps the xfrm (2D Transform for Graphic Frame). This
+// element specifies the transform to be applied to the corresponding graphic
+// frame. This transformation is applied to the graphic frame just as it would
+// be for a shape or group shape.
+type decodeXfrm struct {
+	Off decodeOff `xml:"off"`
+	Ext decodeExt `xml:"ext"`
+}
+
+// decodeCNvPicPr directly maps the cNvPicPr (Non-Visual Picture Drawing
+// Properties). This element specifies the non-visual properties for the picture
+// canvas. These properties are to be used by the generating application to
+// determine how certain properties are to be changed for the picture object in
+// question.
+type decodeCNvPicPr struct {
+	PicLocks decodePicLocks `xml:"picLocks"`
+}
+
+// directly maps the nvPicPr (Non-Visual Properties for a Picture). This
+// element specifies all non-visual properties for a picture. This element is
+// a container for the non-visual identification properties, shape properties
+// and application properties that are to be associated with a picture. This
+// allows for additional information that does not affect the appearance of
+// the picture to be stored.
+type decodeNvPicPr struct {
+	CNvPr    decodeCNvPr    `xml:"cNvPr"`
+	CNvPicPr decodeCNvPicPr `xml:"cNvPicPr"`
+}
+
+// decodeBlipFill directly maps the blipFill (Picture Fill). This element
+// specifies the kind of picture fill that the picture object has. Because a
+// picture has a picture fill already by default, it is possible to have two
+// fills specified for a picture object.
+type decodeBlipFill struct {
+	Blip    decodeBlip    `xml:"blip"`
+	Stretch decodeStretch `xml:"stretch"`
+}
+
+// decodeSpPr directly maps the spPr (Shape Properties). This element
+// specifies the visual shape properties that can be applied to a picture.
+// These are the same properties that are allowed to describe the visual
+// properties of a shape but are used here to describe the visual appearance
+// of a picture within a document.
+type decodeSpPr struct {
+	Xfrm     decodeXfrm     `xml:"xfrm"`
+	PrstGeom decodePrstGeom `xml:"prstGeom"`
+}
+
+// decodePic elements encompass the definition of pictures within the
+// DrawingML framework. While pictures are in many ways very similar to shapes
+// they have specific properties that are unique in order to optimize for
+// picture- specific scenarios.
+type decodePic struct {
+	NvPicPr  decodeNvPicPr  `xml:"nvPicPr"`
+	BlipFill decodeBlipFill `xml:"blipFill"`
+	SpPr     decodeSpPr     `xml:"spPr"`
+}
+
+// decodeFrom specifies the starting anchor.
+type decodeFrom struct {
+	Col    int `xml:"col"`
+	ColOff int `xml:"colOff"`
+	Row    int `xml:"row"`
+	RowOff int `xml:"rowOff"`
+}
+
+// decodeTo directly specifies the ending anchor.
+type decodeTo struct {
+	Col    int `xml:"col"`
+	ColOff int `xml:"colOff"`
+	Row    int `xml:"row"`
+	RowOff int `xml:"rowOff"`
+}
+
+// decodeClientData directly maps the clientData element. An empty element
+// which specifies (via attributes) certain properties related to printing and
+// selection of the drawing object. The fLocksWithSheet attribute (either true
+// or false) determines whether to disable selection when the sheet is
+// protected, and fPrintsWithSheet attribute (either true or false) determines
+// whether the object is printed when the sheet is printed.
+type decodeClientData struct {
+	FLocksWithSheet  bool `xml:"fLocksWithSheet,attr"`
+	FPrintsWithSheet bool `xml:"fPrintsWithSheet,attr"`
+}

+ 469 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlDrawing.go

@@ -0,0 +1,469 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// Source relationship and namespace.
+var (
+	SourceRelationship              = xml.Attr{Name: xml.Name{Local: "r", Space: "xmlns"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}
+	SourceRelationshipCompatibility = xml.Attr{Name: xml.Name{Local: "mc", Space: "xmlns"}, Value: "http://schemas.openxmlformats.org/markup-compatibility/2006"}
+	NameSpaceSpreadSheet            = xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/spreadsheetml/2006/main"}
+	NameSpaceSpreadSheetX14         = xml.Attr{Name: xml.Name{Local: "x14", Space: "xmlns"}, Value: "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}
+)
+
+// Source relationship and namespace.
+const (
+	SourceRelationshipChart                      = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"
+	SourceRelationshipComments                   = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"
+	SourceRelationshipImage                      = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
+	SourceRelationshipTable                      = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"
+	SourceRelationshipDrawingML                  = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing"
+	SourceRelationshipDrawingVML                 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing"
+	SourceRelationshipHyperLink                  = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"
+	SourceRelationshipWorkSheet                  = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"
+	SourceRelationshipChartsheet                 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet"
+	SourceRelationshipDialogsheet                = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet"
+	SourceRelationshipPivotTable                 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable"
+	SourceRelationshipPivotCache                 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition"
+	SourceRelationshipSharedStrings              = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings"
+	SourceRelationshipVBAProject                 = "http://schemas.microsoft.com/office/2006/relationships/vbaProject"
+	SourceRelationshipChart201506                = "http://schemas.microsoft.com/office/drawing/2015/06/chart"
+	SourceRelationshipChart20070802              = "http://schemas.microsoft.com/office/drawing/2007/8/2/chart"
+	SourceRelationshipChart2014                  = "http://schemas.microsoft.com/office/drawing/2014/chart"
+	NameSpaceDrawingML                           = "http://schemas.openxmlformats.org/drawingml/2006/main"
+	NameSpaceDrawingMLChart                      = "http://schemas.openxmlformats.org/drawingml/2006/chart"
+	NameSpaceDrawingMLSpreadSheet                = "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
+	NameSpaceSpreadSheetX15                      = "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"
+	NameSpaceSpreadSheetExcel2006Main            = "http://schemas.microsoft.com/office/excel/2006/main"
+	NameSpaceMacExcel2008Main                    = "http://schemas.microsoft.com/office/mac/excel/2008/main"
+	NameSpaceXML                                 = "http://www.w3.org/XML/1998/namespace"
+	NameSpaceXMLSchemaInstance                   = "http://www.w3.org/2001/XMLSchema-instance"
+	StrictSourceRelationship                     = "http://purl.oclc.org/ooxml/officeDocument/relationships"
+	StrictSourceRelationshipChart                = "http://purl.oclc.org/ooxml/officeDocument/relationships/chart"
+	StrictSourceRelationshipComments             = "http://purl.oclc.org/ooxml/officeDocument/relationships/comments"
+	StrictSourceRelationshipImage                = "http://purl.oclc.org/ooxml/officeDocument/relationships/image"
+	StrictNameSpaceSpreadSheet                   = "http://purl.oclc.org/ooxml/spreadsheetml/main"
+	NameSpaceDublinCore                          = "http://purl.org/dc/elements/1.1/"
+	NameSpaceDublinCoreTerms                     = "http://purl.org/dc/terms/"
+	NameSpaceDublinCoreMetadataIntiative         = "http://purl.org/dc/dcmitype/"
+	ContentTypeDrawing                           = "application/vnd.openxmlformats-officedocument.drawing+xml"
+	ContentTypeDrawingML                         = "application/vnd.openxmlformats-officedocument.drawingml.chart+xml"
+	ContentTypeMacro                             = "application/vnd.ms-excel.sheet.macroEnabled.main+xml"
+	ContentTypeSpreadSheetMLChartsheet           = "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml"
+	ContentTypeSpreadSheetMLComments             = "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"
+	ContentTypeSpreadSheetMLPivotCacheDefinition = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml"
+	ContentTypeSpreadSheetMLPivotTable           = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml"
+	ContentTypeSpreadSheetMLSharedStrings        = "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"
+	ContentTypeSpreadSheetMLTable                = "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"
+	ContentTypeSpreadSheetMLWorksheet            = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"
+	ContentTypeVBA                               = "application/vnd.ms-office.vbaProject"
+	ContentTypeVML                               = "application/vnd.openxmlformats-officedocument.vmlDrawing"
+	// ExtURIConditionalFormattings is the extLst child element
+	// ([ISO/IEC29500-1:2016] section 18.2.10) of the worksheet element
+	// ([ISO/IEC29500-1:2016] section 18.3.1.99) is extended by the addition of
+	// new child ext elements ([ISO/IEC29500-1:2016] section 18.2.7)
+	ExtURIConditionalFormattings = "{78C0D931-6437-407D-A8EE-F0AAD7539E65}"
+	ExtURIDataValidations        = "{CCE6A557-97BC-4B89-ADB6-D9C93CAAB3DF}"
+	ExtURISparklineGroups        = "{05C60535-1F16-4fd2-B633-F4F36F0B64E0}"
+	ExtURISlicerListX14          = "{A8765BA9-456A-4DAB-B4F3-ACF838C121DE}"
+	ExtURISlicerCachesListX14    = "{BBE1A952-AA13-448e-AADC-164F8A28A991}"
+	ExtURISlicerListX15          = "{3A4CF648-6AED-40f4-86FF-DC5316D8AED3}"
+	ExtURIProtectedRanges        = "{FC87AEE6-9EDD-4A0A-B7FB-166176984837}"
+	ExtURIIgnoredErrors          = "{01252117-D84E-4E92-8308-4BE1C098FCBB}"
+	ExtURIWebExtensions          = "{F7C9EE02-42E1-4005-9D12-6889AFFD525C}"
+	ExtURITimelineRefs           = "{7E03D99C-DC04-49d9-9315-930204A7B6E9}"
+	ExtURIDrawingBlip            = "{28A0092B-C50C-407E-A947-70E740481C1C}"
+	ExtURIMacExcelMX             = "{64002731-A6B0-56B0-2670-7721B7C09600}"
+)
+
+// Excel specifications and limits
+const (
+	FileNameLength       = 207
+	TotalRows            = 1048576
+	TotalColumns         = 16384
+	TotalSheetHyperlinks = 65529
+	TotalCellChars       = 32767
+)
+
+var supportImageTypes = map[string]string{".gif": ".gif", ".jpg": ".jpeg", ".jpeg": ".jpeg", ".png": ".png", ".tif": ".tiff", ".tiff": ".tiff"}
+
+// xlsxCNvPr directly maps the cNvPr (Non-Visual Drawing Properties). This
+// element specifies non-visual canvas properties. This allows for additional
+// information that does not affect the appearance of the picture to be stored.
+type xlsxCNvPr struct {
+	ID         int             `xml:"id,attr"`
+	Name       string          `xml:"name,attr"`
+	Descr      string          `xml:"descr,attr"`
+	Title      string          `xml:"title,attr,omitempty"`
+	HlinkClick *xlsxHlinkClick `xml:"a:hlinkClick"`
+}
+
+// xlsxHlinkClick (Click Hyperlink) Specifies the on-click hyperlink
+// information to be applied to a run of text. When the hyperlink text is
+// clicked the link is fetched.
+type xlsxHlinkClick struct {
+	R              string `xml:"xmlns:r,attr,omitempty"`
+	RID            string `xml:"r:id,attr,omitempty"`
+	InvalidURL     string `xml:"invalidUrl,attr,omitempty"`
+	Action         string `xml:"action,attr,omitempty"`
+	TgtFrame       string `xml:"tgtFrame,attr,omitempty"`
+	Tooltip        string `xml:"tooltip,attr,omitempty"`
+	History        bool   `xml:"history,attr,omitempty"`
+	HighlightClick bool   `xml:"highlightClick,attr,omitempty"`
+	EndSnd         bool   `xml:"endSnd,attr,omitempty"`
+}
+
+// xlsxPicLocks directly maps the picLocks (Picture Locks). This element
+// specifies all locking properties for a graphic frame. These properties inform
+// the generating application about specific properties that have been
+// previously locked and thus should not be changed.
+type xlsxPicLocks struct {
+	NoAdjustHandles    bool `xml:"noAdjustHandles,attr,omitempty"`
+	NoChangeArrowheads bool `xml:"noChangeArrowheads,attr,omitempty"`
+	NoChangeAspect     bool `xml:"noChangeAspect,attr"`
+	NoChangeShapeType  bool `xml:"noChangeShapeType,attr,omitempty"`
+	NoCrop             bool `xml:"noCrop,attr,omitempty"`
+	NoEditPoints       bool `xml:"noEditPoints,attr,omitempty"`
+	NoGrp              bool `xml:"noGrp,attr,omitempty"`
+	NoMove             bool `xml:"noMove,attr,omitempty"`
+	NoResize           bool `xml:"noResize,attr,omitempty"`
+	NoRot              bool `xml:"noRot,attr,omitempty"`
+	NoSelect           bool `xml:"noSelect,attr,omitempty"`
+}
+
+// xlsxBlip directly maps the blip element in the namespace
+// http://purl.oclc.org/ooxml/officeDoc ument/relationships - This element
+// specifies the existence of an image (binary large image or picture) and
+// contains a reference to the image data.
+type xlsxBlip struct {
+	Embed  string `xml:"r:embed,attr"`
+	Cstate string `xml:"cstate,attr,omitempty"`
+	R      string `xml:"xmlns:r,attr"`
+}
+
+// xlsxStretch directly maps the stretch element. This element specifies that a
+// BLIP should be stretched to fill the target rectangle. The other option is a
+// tile where a BLIP is tiled to fill the available area.
+type xlsxStretch struct {
+	FillRect string `xml:"a:fillRect"`
+}
+
+// xlsxOff directly maps the colOff and rowOff element. This element is used to
+// specify the column offset within a cell.
+type xlsxOff struct {
+	X int `xml:"x,attr"`
+	Y int `xml:"y,attr"`
+}
+
+// xlsxExt directly maps the ext element.
+type xlsxExt struct {
+	Cx int `xml:"cx,attr"`
+	Cy int `xml:"cy,attr"`
+}
+
+// xlsxPrstGeom directly maps the prstGeom (Preset geometry). This element
+// specifies when a preset geometric shape should be used instead of a custom
+// geometric shape. The generating application should be able to render all
+// preset geometries enumerated in the ST_ShapeType list.
+type xlsxPrstGeom struct {
+	Prst string `xml:"prst,attr"`
+}
+
+// xlsxXfrm directly maps the xfrm (2D Transform for Graphic Frame). This
+// element specifies the transform to be applied to the corresponding graphic
+// frame. This transformation is applied to the graphic frame just as it would
+// be for a shape or group shape.
+type xlsxXfrm struct {
+	Off xlsxOff `xml:"a:off"`
+	Ext xlsxExt `xml:"a:ext"`
+}
+
+// xlsxCNvPicPr directly maps the cNvPicPr (Non-Visual Picture Drawing
+// Properties). This element specifies the non-visual properties for the picture
+// canvas. These properties are to be used by the generating application to
+// determine how certain properties are to be changed for the picture object in
+// question.
+type xlsxCNvPicPr struct {
+	PicLocks xlsxPicLocks `xml:"a:picLocks"`
+}
+
+// directly maps the nvPicPr (Non-Visual Properties for a Picture). This element
+// specifies all non-visual properties for a picture. This element is a
+// container for the non-visual identification properties, shape properties and
+// application properties that are to be associated with a picture. This allows
+// for additional information that does not affect the appearance of the picture
+// to be stored.
+type xlsxNvPicPr struct {
+	CNvPr    xlsxCNvPr    `xml:"xdr:cNvPr"`
+	CNvPicPr xlsxCNvPicPr `xml:"xdr:cNvPicPr"`
+}
+
+// xlsxBlipFill directly maps the blipFill (Picture Fill). This element
+// specifies the kind of picture fill that the picture object has. Because a
+// picture has a picture fill already by default, it is possible to have two
+// fills specified for a picture object.
+type xlsxBlipFill struct {
+	Blip    xlsxBlip    `xml:"a:blip"`
+	Stretch xlsxStretch `xml:"a:stretch"`
+}
+
+// xlsxSpPr directly maps the spPr (Shape Properties). This element specifies
+// the visual shape properties that can be applied to a picture. These are the
+// same properties that are allowed to describe the visual properties of a shape
+// but are used here to describe the visual appearance of a picture within a
+// document.
+type xlsxSpPr struct {
+	Xfrm     xlsxXfrm     `xml:"a:xfrm"`
+	PrstGeom xlsxPrstGeom `xml:"a:prstGeom"`
+}
+
+// xlsxPic elements encompass the definition of pictures within the DrawingML
+// framework. While pictures are in many ways very similar to shapes they have
+// specific properties that are unique in order to optimize for picture-
+// specific scenarios.
+type xlsxPic struct {
+	NvPicPr  xlsxNvPicPr  `xml:"xdr:nvPicPr"`
+	BlipFill xlsxBlipFill `xml:"xdr:blipFill"`
+	SpPr     xlsxSpPr     `xml:"xdr:spPr"`
+}
+
+// xlsxFrom specifies the starting anchor.
+type xlsxFrom struct {
+	Col    int `xml:"xdr:col"`
+	ColOff int `xml:"xdr:colOff"`
+	Row    int `xml:"xdr:row"`
+	RowOff int `xml:"xdr:rowOff"`
+}
+
+// xlsxTo directly specifies the ending anchor.
+type xlsxTo struct {
+	Col    int `xml:"xdr:col"`
+	ColOff int `xml:"xdr:colOff"`
+	Row    int `xml:"xdr:row"`
+	RowOff int `xml:"xdr:rowOff"`
+}
+
+// xdrClientData directly maps the clientData element. An empty element which
+// specifies (via attributes) certain properties related to printing and
+// selection of the drawing object. The fLocksWithSheet attribute (either true
+// or false) determines whether to disable selection when the sheet is
+// protected, and fPrintsWithSheet attribute (either true or false) determines
+// whether the object is printed when the sheet is printed.
+type xdrClientData struct {
+	FLocksWithSheet  bool `xml:"fLocksWithSheet,attr"`
+	FPrintsWithSheet bool `xml:"fPrintsWithSheet,attr"`
+}
+
+// xdrCellAnchor directly maps the oneCellAnchor (One Cell Anchor Shape Size)
+// and twoCellAnchor (Two Cell Anchor Shape Size). This element specifies a two
+// cell anchor placeholder for a group, a shape, or a drawing element. It moves
+// with cells and its extents are in EMU units.
+type xdrCellAnchor struct {
+	EditAs       string         `xml:"editAs,attr,omitempty"`
+	Pos          *xlsxPoint2D   `xml:"xdr:pos"`
+	From         *xlsxFrom      `xml:"xdr:from"`
+	To           *xlsxTo        `xml:"xdr:to"`
+	Ext          *xlsxExt       `xml:"xdr:ext"`
+	Sp           *xdrSp         `xml:"xdr:sp"`
+	Pic          *xlsxPic       `xml:"xdr:pic,omitempty"`
+	GraphicFrame string         `xml:",innerxml"`
+	ClientData   *xdrClientData `xml:"xdr:clientData"`
+}
+
+// xlsxPoint2D describes the position of a drawing element within a spreadsheet.
+type xlsxPoint2D struct {
+	XMLName xml.Name `xml:"xdr:pos"`
+	X       int      `xml:"x,attr"`
+	Y       int      `xml:"y,attr"`
+}
+
+// xlsxWsDr directly maps the root element for a part of this content type shall
+// wsDr.
+type xlsxWsDr struct {
+	XMLName        xml.Name         `xml:"xdr:wsDr"`
+	AbsoluteAnchor []*xdrCellAnchor `xml:"xdr:absoluteAnchor"`
+	OneCellAnchor  []*xdrCellAnchor `xml:"xdr:oneCellAnchor"`
+	TwoCellAnchor  []*xdrCellAnchor `xml:"xdr:twoCellAnchor"`
+	A              string           `xml:"xmlns:a,attr,omitempty"`
+	Xdr            string           `xml:"xmlns:xdr,attr,omitempty"`
+	R              string           `xml:"xmlns:r,attr,omitempty"`
+}
+
+// xlsxGraphicFrame (Graphic Frame) directly maps the xdr:graphicFrame element.
+// This element specifies the existence of a graphics frame. This frame contains
+// a graphic that was generated by an external source and needs a container in
+// which to be displayed on the slide surface.
+type xlsxGraphicFrame struct {
+	XMLName          xml.Name             `xml:"xdr:graphicFrame"`
+	Macro            string               `xml:"macro,attr"`
+	NvGraphicFramePr xlsxNvGraphicFramePr `xml:"xdr:nvGraphicFramePr"`
+	Xfrm             xlsxXfrm             `xml:"xdr:xfrm"`
+	Graphic          *xlsxGraphic         `xml:"a:graphic"`
+}
+
+// xlsxNvGraphicFramePr (Non-Visual Properties for a Graphic Frame) directly
+// maps the xdr:nvGraphicFramePr element. This element specifies all non-visual
+// properties for a graphic frame. This element is a container for the non-
+// visual identification properties, shape properties and application properties
+// that are to be associated with a graphic frame. This allows for additional
+// information that does not affect the appearance of the graphic frame to be
+// stored.
+type xlsxNvGraphicFramePr struct {
+	CNvPr                *xlsxCNvPr `xml:"xdr:cNvPr"`
+	ChicNvGraphicFramePr string     `xml:"xdr:cNvGraphicFramePr"`
+}
+
+// xlsxGraphic (Graphic Object) directly maps the a:graphic element. This
+// element specifies the existence of a single graphic object. Document authors
+// should refer to this element when they wish to persist a graphical object of
+// some kind. The specification for this graphical object is provided entirely
+// by the document author and referenced within the graphicData child element.
+type xlsxGraphic struct {
+	GraphicData *xlsxGraphicData `xml:"a:graphicData"`
+}
+
+// xlsxGraphicData (Graphic Object Data) directly maps the a:graphicData
+// element. This element specifies the reference to a graphic object within the
+// document. This graphic object is provided entirely by the document authors
+// who choose to persist this data within the document.
+type xlsxGraphicData struct {
+	URI   string     `xml:"uri,attr"`
+	Chart *xlsxChart `xml:"c:chart,omitempty"`
+}
+
+// xlsxChart (Chart) directly maps the c:chart element.
+type xlsxChart struct {
+	C   string `xml:"xmlns:c,attr"`
+	RID string `xml:"r:id,attr"`
+	R   string `xml:"xmlns:r,attr"`
+}
+
+// xdrSp (Shape) directly maps the xdr:sp element. This element specifies the
+// existence of a single shape. A shape can either be a preset or a custom
+// geometry, defined using the SpreadsheetDrawingML framework. In addition to a
+// geometry each shape can have both visual and non-visual properties attached.
+// Text and corresponding styling information can also be attached to a shape.
+// This shape is specified along with all other shapes within either the shape
+// tree or group shape elements.
+type xdrSp struct {
+	Macro    string     `xml:"macro,attr"`
+	Textlink string     `xml:"textlink,attr"`
+	NvSpPr   *xdrNvSpPr `xml:"xdr:nvSpPr"`
+	SpPr     *xlsxSpPr  `xml:"xdr:spPr"`
+	Style    *xdrStyle  `xml:"xdr:style"`
+	TxBody   *xdrTxBody `xml:"xdr:txBody"`
+}
+
+// xdrNvSpPr (Non-Visual Properties for a Shape) directly maps the xdr:nvSpPr
+// element. This element specifies all non-visual properties for a shape. This
+// element is a container for the non-visual identification properties, shape
+// properties and application properties that are to be associated with a shape.
+// This allows for additional information that does not affect the appearance of
+// the shape to be stored.
+type xdrNvSpPr struct {
+	CNvPr   *xlsxCNvPr  `xml:"xdr:cNvPr"`
+	CNvSpPr *xdrCNvSpPr `xml:"xdr:cNvSpPr"`
+}
+
+// xdrCNvSpPr (Connection Non-Visual Shape Properties) directly maps the
+// xdr:cNvSpPr element. This element specifies the set of non-visual properties
+// for a connection shape. These properties specify all data about the
+// connection shape which do not affect its display within a spreadsheet.
+type xdrCNvSpPr struct {
+	TxBox bool `xml:"txBox,attr"`
+}
+
+// xdrStyle (Shape Style) directly maps the xdr:style element. The element
+// specifies the style that is applied to a shape and the corresponding
+// references for each of the style components such as lines and fills.
+type xdrStyle struct {
+	LnRef     *aRef     `xml:"a:lnRef"`
+	FillRef   *aRef     `xml:"a:fillRef"`
+	EffectRef *aRef     `xml:"a:effectRef"`
+	FontRef   *aFontRef `xml:"a:fontRef"`
+}
+
+// aRef directly maps the a:lnRef, a:fillRef and a:effectRef element.
+type aRef struct {
+	Idx       int            `xml:"idx,attr"`
+	ScrgbClr  *aScrgbClr     `xml:"a:scrgbClr"`
+	SchemeClr *attrValString `xml:"a:schemeClr"`
+	SrgbClr   *attrValString `xml:"a:srgbClr"`
+}
+
+// aScrgbClr (RGB Color Model - Percentage Variant) directly maps the a:scrgbClr
+// element. This element specifies a color using the red, green, blue RGB color
+// model. Each component, red, green, and blue is expressed as a percentage from
+// 0% to 100%. A linear gamma of 1.0 is assumed.
+type aScrgbClr struct {
+	R float64 `xml:"r,attr"`
+	G float64 `xml:"g,attr"`
+	B float64 `xml:"b,attr"`
+}
+
+// aFontRef (Font Reference) directly maps the a:fontRef element. This element
+// represents a reference to a themed font. When used it specifies which themed
+// font to use along with a choice of color.
+type aFontRef struct {
+	Idx       string         `xml:"idx,attr"`
+	SchemeClr *attrValString `xml:"a:schemeClr"`
+}
+
+// xdrTxBody (Shape Text Body) directly maps the xdr:txBody element. This
+// element specifies the existence of text to be contained within the
+// corresponding shape. All visible text and visible text related properties are
+// contained within this element. There can be multiple paragraphs and within
+// paragraphs multiple runs of text.
+type xdrTxBody struct {
+	BodyPr *aBodyPr `xml:"a:bodyPr"`
+	P      []*aP    `xml:"a:p"`
+}
+
+// formatPicture directly maps the format settings of the picture.
+type formatPicture struct {
+	FPrintsWithSheet bool    `json:"print_obj"`
+	FLocksWithSheet  bool    `json:"locked"`
+	NoChangeAspect   bool    `json:"lock_aspect_ratio"`
+	Autofit          bool    `json:"autofit"`
+	OffsetX          int     `json:"x_offset"`
+	OffsetY          int     `json:"y_offset"`
+	XScale           float64 `json:"x_scale"`
+	YScale           float64 `json:"y_scale"`
+	Hyperlink        string  `json:"hyperlink"`
+	HyperlinkType    string  `json:"hyperlink_type"`
+	Positioning      string  `json:"positioning"`
+}
+
+// formatShape directly maps the format settings of the shape.
+type formatShape struct {
+	Type      string                 `json:"type"`
+	Width     int                    `json:"width"`
+	Height    int                    `json:"height"`
+	Format    formatPicture          `json:"format"`
+	Color     formatShapeColor       `json:"color"`
+	Paragraph []formatShapeParagraph `json:"paragraph"`
+}
+
+// formatShapeParagraph directly maps the format settings of the paragraph in
+// the shape.
+type formatShapeParagraph struct {
+	Font Font   `json:"font"`
+	Text string `json:"text"`
+}
+
+// formatShapeColor directly maps the color settings of the shape.
+type formatShapeColor struct {
+	Line   string `json:"line"`
+	Fill   string `json:"fill"`
+	Effect string `json:"effect"`
+}

+ 229 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlPivotCache.go

@@ -0,0 +1,229 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// xlsxPivotCacheDefinition represents the pivotCacheDefinition part. This part
+// defines each field in the source data, including the name, the string
+// resources of the instance data (for shared items), and information about
+// the type of data that appears in the field.
+type xlsxPivotCacheDefinition struct {
+	XMLName               xml.Name               `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main pivotCacheDefinition"`
+	RID                   string                 `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
+	Invalid               bool                   `xml:"invalid,attr,omitempty"`
+	SaveData              bool                   `xml:"saveData,attr"`
+	RefreshOnLoad         bool                   `xml:"refreshOnLoad,attr,omitempty"`
+	OptimizeMemory        bool                   `xml:"optimizeMemory,attr,omitempty"`
+	EnableRefresh         bool                   `xml:"enableRefresh,attr,omitempty"`
+	RefreshedBy           string                 `xml:"refreshedBy,attr,omitempty"`
+	RefreshedDate         float64                `xml:"refreshedDate,attr,omitempty"`
+	RefreshedDateIso      float64                `xml:"refreshedDateIso,attr,omitempty"`
+	BackgroundQuery       bool                   `xml:"backgroundQuery,attr"`
+	MissingItemsLimit     int                    `xml:"missingItemsLimit,attr,omitempty"`
+	CreatedVersion        int                    `xml:"createdVersion,attr,omitempty"`
+	RefreshedVersion      int                    `xml:"refreshedVersion,attr,omitempty"`
+	MinRefreshableVersion int                    `xml:"minRefreshableVersion,attr,omitempty"`
+	RecordCount           int                    `xml:"recordCount,attr,omitempty"`
+	UpgradeOnRefresh      bool                   `xml:"upgradeOnRefresh,attr,omitempty"`
+	TupleCacheAttr        bool                   `xml:"tupleCache,attr,omitempty"`
+	SupportSubquery       bool                   `xml:"supportSubquery,attr,omitempty"`
+	SupportAdvancedDrill  bool                   `xml:"supportAdvancedDrill,attr,omitempty"`
+	CacheSource           *xlsxCacheSource       `xml:"cacheSource"`
+	CacheFields           *xlsxCacheFields       `xml:"cacheFields"`
+	CacheHierarchies      *xlsxCacheHierarchies  `xml:"cacheHierarchies"`
+	Kpis                  *xlsxKpis              `xml:"kpis"`
+	TupleCache            *xlsxTupleCache        `xml:"tupleCache"`
+	CalculatedItems       *xlsxCalculatedItems   `xml:"calculatedItems"`
+	CalculatedMembers     *xlsxCalculatedMembers `xml:"calculatedMembers"`
+	Dimensions            *xlsxDimensions        `xml:"dimensions"`
+	MeasureGroups         *xlsxMeasureGroups     `xml:"measureGroups"`
+	Maps                  *xlsxMaps              `xml:"maps"`
+	ExtLst                *xlsxExtLst            `xml:"extLst"`
+}
+
+// xlsxCacheSource represents the description of data source whose data is
+// stored in the pivot cache. The data source refers to the underlying rows or
+// database records that provide the data for a PivotTable. You can create a
+// PivotTable report from a SpreadsheetML table, an external database
+// (including OLAP cubes), multiple SpreadsheetML worksheets, or another
+// PivotTable.
+type xlsxCacheSource struct {
+	Type            string               `xml:"type,attr"`
+	ConnectionID    int                  `xml:"connectionId,attr,omitempty"`
+	WorksheetSource *xlsxWorksheetSource `xml:"worksheetSource"`
+	Consolidation   *xlsxConsolidation   `xml:"consolidation"`
+	ExtLst          *xlsxExtLst          `xml:"extLst"`
+}
+
+// xlsxWorksheetSource represents the location of the source of the data that
+// is stored in the cache.
+type xlsxWorksheetSource struct {
+	RID   string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
+	Ref   string `xml:"ref,attr,omitempty"`
+	Name  string `xml:"name,attr,omitempty"`
+	Sheet string `xml:"sheet,attr,omitempty"`
+}
+
+// xlsxConsolidation represents the description of the PivotCache source using
+// multiple consolidation ranges. This element is used when the source of the
+// PivotTable is a collection of ranges in the workbook. The ranges are
+// specified in the rangeSets collection. The logic for how the application
+// consolidates the data in the ranges is application- defined.
+type xlsxConsolidation struct {
+}
+
+// xlsxCacheFields represents the collection of field definitions in the
+// source data.
+type xlsxCacheFields struct {
+	Count      int               `xml:"count,attr"`
+	CacheField []*xlsxCacheField `xml:"cacheField"`
+}
+
+// xlsxCacheField represent a single field in the PivotCache. This definition
+// contains information about the field, such as its source, data type, and
+// location within a level or hierarchy. The sharedItems element stores
+// additional information about the data in this field. If there are no shared
+// items, then values are stored directly in the pivotCacheRecords part.
+type xlsxCacheField struct {
+	Name                string           `xml:"name,attr"`
+	Caption             string           `xml:"caption,attr,omitempty"`
+	PropertyName        string           `xml:"propertyName,attr,omitempty"`
+	ServerField         bool             `xml:"serverField,attr,omitempty"`
+	UniqueList          bool             `xml:"uniqueList,attr,omitempty"`
+	NumFmtID            int              `xml:"numFmtId,attr"`
+	Formula             string           `xml:"formula,attr,omitempty"`
+	SQLType             int              `xml:"sqlType,attr,omitempty"`
+	Hierarchy           int              `xml:"hierarchy,attr,omitempty"`
+	Level               int              `xml:"level,attr,omitempty"`
+	DatabaseField       bool             `xml:"databaseField,attr,omitempty"`
+	MappingCount        int              `xml:"mappingCount,attr,omitempty"`
+	MemberPropertyField bool             `xml:"memberPropertyField,attr,omitempty"`
+	SharedItems         *xlsxSharedItems `xml:"sharedItems"`
+	FieldGroup          *xlsxFieldGroup  `xml:"fieldGroup"`
+	MpMap               *xlsxX           `xml:"mpMap"`
+	ExtLst              *xlsxExtLst      `xml:"extLst"`
+}
+
+// xlsxSharedItems represents the collection of unique items for a field in
+// the PivotCacheDefinition. The sharedItems complex type stores data type and
+// formatting information about the data in a field. Items in the
+// PivotCacheDefinition can be shared in order to reduce the redundancy of
+// those values that are referenced in multiple places across all the
+// PivotTable parts.
+type xlsxSharedItems struct {
+	ContainsSemiMixedTypes bool          `xml:"containsSemiMixedTypes,attr,omitempty"`
+	ContainsNonDate        bool          `xml:"containsNonDate,attr,omitempty"`
+	ContainsDate           bool          `xml:"containsDate,attr,omitempty"`
+	ContainsString         bool          `xml:"containsString,attr,omitempty"`
+	ContainsBlank          bool          `xml:"containsBlank,attr,omitempty"`
+	ContainsMixedTypes     bool          `xml:"containsMixedTypes,attr,omitempty"`
+	ContainsNumber         bool          `xml:"containsNumber,attr,omitempty"`
+	ContainsInteger        bool          `xml:"containsInteger,attr,omitempty"`
+	MinValue               float64       `xml:"minValue,attr,omitempty"`
+	MaxValue               float64       `xml:"maxValue,attr,omitempty"`
+	MinDate                string        `xml:"minDate,attr,omitempty"`
+	MaxDate                string        `xml:"maxDate,attr,omitempty"`
+	Count                  int           `xml:"count,attr"`
+	LongText               bool          `xml:"longText,attr,omitempty"`
+	M                      *xlsxMissing  `xml:"m"`
+	N                      *xlsxNumber   `xml:"n"`
+	B                      *xlsxBoolean  `xml:"b"`
+	E                      *xlsxError    `xml:"e"`
+	S                      *xlsxString   `xml:"s"`
+	D                      *xlsxDateTime `xml:"d"`
+}
+
+// xlsxMissing represents a value that was not specified.
+type xlsxMissing struct {
+}
+
+// xlsxNumber represents a numeric value in the PivotTable.
+type xlsxNumber struct {
+	V    float64     `xml:"v,attr"`
+	U    bool        `xml:"u,attr,omitempty"`
+	F    bool        `xml:"f,attr,omitempty"`
+	C    string      `xml:"c,attr,omitempty"`
+	Cp   int         `xml:"cp,attr,omitempty"`
+	In   int         `xml:"in,attr,omitempty"`
+	Bc   string      `xml:"bc,attr,omitempty"`
+	Fc   string      `xml:"fc,attr,omitempty"`
+	I    bool        `xml:"i,attr,omitempty"`
+	Un   bool        `xml:"un,attr,omitempty"`
+	St   bool        `xml:"st,attr,omitempty"`
+	B    bool        `xml:"b,attr,omitempty"`
+	Tpls *xlsxTuples `xml:"tpls"`
+	X    *attrValInt `xml:"x"`
+}
+
+// xlsxTuples represents members for the OLAP sheet data entry, also known as
+// a tuple.
+type xlsxTuples struct {
+}
+
+// xlsxBoolean represents a boolean value for an item in the PivotTable.
+type xlsxBoolean struct {
+}
+
+// xlsxError represents an error value. The use of this item indicates that an
+// error value is present in the PivotTable source. The error is recorded in
+// the value attribute.
+type xlsxError struct {
+}
+
+// xlsxString represents a character value in a PivotTable.
+type xlsxString struct {
+}
+
+// xlsxDateTime represents a date-time value in the PivotTable.
+type xlsxDateTime struct {
+}
+
+// xlsxFieldGroup represents the collection of properties for a field group.
+type xlsxFieldGroup struct {
+}
+
+// xlsxCacheHierarchies represents the collection of OLAP hierarchies in the
+// PivotCache.
+type xlsxCacheHierarchies struct {
+}
+
+// xlsxKpis represents the collection of Key Performance Indicators (KPIs)
+// defined on the OLAP server and stored in the PivotCache.
+type xlsxKpis struct {
+}
+
+// xlsxTupleCache represents the cache of OLAP sheet data members, or tuples.
+type xlsxTupleCache struct {
+}
+
+// xlsxCalculatedItems represents the collection of calculated items.
+type xlsxCalculatedItems struct {
+}
+
+// xlsxCalculatedMembers represents the collection of calculated members in an
+// OLAP PivotTable.
+type xlsxCalculatedMembers struct {
+}
+
+// xlsxDimensions represents the collection of PivotTable OLAP dimensions.
+type xlsxDimensions struct {
+}
+
+// xlsxMeasureGroups represents the collection of PivotTable OLAP measure
+// groups.
+type xlsxMeasureGroups struct {
+}
+
+// xlsxMaps represents the PivotTable OLAP measure group - Dimension maps.
+type xlsxMaps struct {
+}

+ 296 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlPivotTable.go

@@ -0,0 +1,296 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// xlsxPivotTableDefinition represents the PivotTable root element for
+// non-null PivotTables. There exists one pivotTableDefinition for each
+// PivotTableDefinition part
+type xlsxPivotTableDefinition struct {
+	XMLName                 xml.Name                 `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main pivotTableDefinition"`
+	Name                    string                   `xml:"name,attr"`
+	CacheID                 int                      `xml:"cacheId,attr"`
+	ApplyNumberFormats      bool                     `xml:"applyNumberFormats,attr,omitempty"`
+	ApplyBorderFormats      bool                     `xml:"applyBorderFormats,attr,omitempty"`
+	ApplyFontFormats        bool                     `xml:"applyFontFormats,attr,omitempty"`
+	ApplyPatternFormats     bool                     `xml:"applyPatternFormats,attr,omitempty"`
+	ApplyAlignmentFormats   bool                     `xml:"applyAlignmentFormats,attr,omitempty"`
+	ApplyWidthHeightFormats bool                     `xml:"applyWidthHeightFormats,attr,omitempty"`
+	DataOnRows              bool                     `xml:"dataOnRows,attr,omitempty"`
+	DataPosition            int                      `xml:"dataPosition,attr,omitempty"`
+	DataCaption             string                   `xml:"dataCaption,attr"`
+	GrandTotalCaption       string                   `xml:"grandTotalCaption,attr,omitempty"`
+	ErrorCaption            string                   `xml:"errorCaption,attr,omitempty"`
+	ShowError               bool                     `xml:"showError,attr,omitempty"`
+	MissingCaption          string                   `xml:"missingCaption,attr,omitempty"`
+	ShowMissing             bool                     `xml:"showMissing,attr,omitempty"`
+	PageStyle               string                   `xml:"pageStyle,attr,omitempty"`
+	PivotTableStyle         string                   `xml:"pivotTableStyle,attr,omitempty"`
+	VacatedStyle            string                   `xml:"vacatedStyle,attr,omitempty"`
+	Tag                     string                   `xml:"tag,attr,omitempty"`
+	UpdatedVersion          int                      `xml:"updatedVersion,attr,omitempty"`
+	MinRefreshableVersion   int                      `xml:"minRefreshableVersion,attr,omitempty"`
+	AsteriskTotals          bool                     `xml:"asteriskTotals,attr,omitempty"`
+	ShowItems               bool                     `xml:"showItems,attr,omitempty"`
+	EditData                bool                     `xml:"editData,attr,omitempty"`
+	DisableFieldList        bool                     `xml:"disableFieldList,attr,omitempty"`
+	ShowCalcMbrs            bool                     `xml:"showCalcMbrs,attr,omitempty"`
+	VisualTotals            bool                     `xml:"visualTotals,attr,omitempty"`
+	ShowMultipleLabel       bool                     `xml:"showMultipleLabel,attr,omitempty"`
+	ShowDataDropDown        bool                     `xml:"showDataDropDown,attr,omitempty"`
+	ShowDrill               bool                     `xml:"showDrill,attr,omitempty"`
+	PrintDrill              bool                     `xml:"printDrill,attr,omitempty"`
+	ShowMemberPropertyTips  bool                     `xml:"showMemberPropertyTips,attr,omitempty"`
+	ShowDataTips            bool                     `xml:"showDataTips,attr,omitempty"`
+	EnableWizard            bool                     `xml:"enableWizard,attr,omitempty"`
+	EnableDrill             bool                     `xml:"enableDrill,attr,omitempty"`
+	EnableFieldProperties   bool                     `xml:"enableFieldProperties,attr,omitempty"`
+	PreserveFormatting      bool                     `xml:"preserveFormatting,attr,omitempty"`
+	UseAutoFormatting       bool                     `xml:"useAutoFormatting,attr,omitempty"`
+	PageWrap                int                      `xml:"pageWrap,attr,omitempty"`
+	PageOverThenDown        bool                     `xml:"pageOverThenDown,attr,omitempty"`
+	SubtotalHiddenItems     bool                     `xml:"subtotalHiddenItems,attr,omitempty"`
+	RowGrandTotals          bool                     `xml:"rowGrandTotals,attr,omitempty"`
+	ColGrandTotals          bool                     `xml:"colGrandTotals,attr,omitempty"`
+	FieldPrintTitles        bool                     `xml:"fieldPrintTitles,attr,omitempty"`
+	ItemPrintTitles         bool                     `xml:"itemPrintTitles,attr,omitempty"`
+	MergeItem               bool                     `xml:"mergeItem,attr,omitempty"`
+	ShowDropZones           bool                     `xml:"showDropZones,attr,omitempty"`
+	CreatedVersion          int                      `xml:"createdVersion,attr,omitempty"`
+	Indent                  int                      `xml:"indent,attr,omitempty"`
+	ShowEmptyRow            bool                     `xml:"showEmptyRow,attr,omitempty"`
+	ShowEmptyCol            bool                     `xml:"showEmptyCol,attr,omitempty"`
+	ShowHeaders             bool                     `xml:"showHeaders,attr,omitempty"`
+	Compact                 bool                     `xml:"compact,attr"`
+	Outline                 bool                     `xml:"outline,attr"`
+	OutlineData             bool                     `xml:"outlineData,attr,omitempty"`
+	CompactData             bool                     `xml:"compactData,attr,omitempty"`
+	Published               bool                     `xml:"published,attr,omitempty"`
+	GridDropZones           bool                     `xml:"gridDropZones,attr,omitempty"`
+	Immersive               bool                     `xml:"immersive,attr,omitempty"`
+	MultipleFieldFilters    bool                     `xml:"multipleFieldFilters,attr,omitempty"`
+	ChartFormat             int                      `xml:"chartFormat,attr,omitempty"`
+	RowHeaderCaption        string                   `xml:"rowHeaderCaption,attr,omitempty"`
+	ColHeaderCaption        string                   `xml:"colHeaderCaption,attr,omitempty"`
+	FieldListSortAscending  bool                     `xml:"fieldListSortAscending,attr,omitempty"`
+	MdxSubqueries           bool                     `xml:"mdxSubqueries,attr,omitempty"`
+	CustomListSort          bool                     `xml:"customListSort,attr,omitempty"`
+	Location                *xlsxLocation            `xml:"location"`
+	PivotFields             *xlsxPivotFields         `xml:"pivotFields"`
+	RowFields               *xlsxRowFields           `xml:"rowFields"`
+	RowItems                *xlsxRowItems            `xml:"rowItems"`
+	ColFields               *xlsxColFields           `xml:"colFields"`
+	ColItems                *xlsxColItems            `xml:"colItems"`
+	PageFields              *xlsxPageFields          `xml:"pageFields"`
+	DataFields              *xlsxDataFields          `xml:"dataFields"`
+	ConditionalFormats      *xlsxConditionalFormats  `xml:"conditionalFormats"`
+	PivotTableStyleInfo     *xlsxPivotTableStyleInfo `xml:"pivotTableStyleInfo"`
+}
+
+// xlsxLocation represents location information for the PivotTable.
+type xlsxLocation struct {
+	Ref            string `xml:"ref,attr"`
+	FirstHeaderRow int    `xml:"firstHeaderRow,attr"`
+	FirstDataRow   int    `xml:"firstDataRow,attr"`
+	FirstDataCol   int    `xml:"firstDataCol,attr"`
+	RowPageCount   int    `xml:"rowPageCount,attr,omitempty"`
+	ColPageCount   int    `xml:"colPageCount,attr,omitempty"`
+}
+
+// xlsxPivotFields represents the collection of fields that appear on the
+// PivotTable.
+type xlsxPivotFields struct {
+	Count      int               `xml:"count,attr"`
+	PivotField []*xlsxPivotField `xml:"pivotField"`
+}
+
+// xlsxPivotField represents a single field in the PivotTable. This element
+// contains information about the field, including the collection of items in
+// the field.
+type xlsxPivotField struct {
+	Name                         string             `xml:"name,attr,omitempty"`
+	Axis                         string             `xml:"axis,attr,omitempty"`
+	DataField                    bool               `xml:"dataField,attr,omitempty"`
+	SubtotalCaption              string             `xml:"subtotalCaption,attr,omitempty"`
+	ShowDropDowns                bool               `xml:"showDropDowns,attr,omitempty"`
+	HiddenLevel                  bool               `xml:"hiddenLevel,attr,omitempty"`
+	UniqueMemberProperty         string             `xml:"uniqueMemberProperty,attr,omitempty"`
+	Compact                      bool               `xml:"compact,attr"`
+	AllDrilled                   bool               `xml:"allDrilled,attr,omitempty"`
+	NumFmtID                     string             `xml:"numFmtId,attr,omitempty"`
+	Outline                      bool               `xml:"outline,attr"`
+	SubtotalTop                  bool               `xml:"subtotalTop,attr,omitempty"`
+	DragToRow                    bool               `xml:"dragToRow,attr,omitempty"`
+	DragToCol                    bool               `xml:"dragToCol,attr,omitempty"`
+	MultipleItemSelectionAllowed bool               `xml:"multipleItemSelectionAllowed,attr,omitempty"`
+	DragToPage                   bool               `xml:"dragToPage,attr,omitempty"`
+	DragToData                   bool               `xml:"dragToData,attr,omitempty"`
+	DragOff                      bool               `xml:"dragOff,attr,omitempty"`
+	ShowAll                      bool               `xml:"showAll,attr"`
+	InsertBlankRow               bool               `xml:"insertBlankRow,attr,omitempty"`
+	ServerField                  bool               `xml:"serverField,attr,omitempty"`
+	InsertPageBreak              bool               `xml:"insertPageBreak,attr,omitempty"`
+	AutoShow                     bool               `xml:"autoShow,attr,omitempty"`
+	TopAutoShow                  bool               `xml:"topAutoShow,attr,omitempty"`
+	HideNewItems                 bool               `xml:"hideNewItems,attr,omitempty"`
+	MeasureFilter                bool               `xml:"measureFilter,attr,omitempty"`
+	IncludeNewItemsInFilter      bool               `xml:"includeNewItemsInFilter,attr,omitempty"`
+	ItemPageCount                int                `xml:"itemPageCount,attr,omitempty"`
+	SortType                     string             `xml:"sortType,attr,omitempty"`
+	DataSourceSort               bool               `xml:"dataSourceSort,attr,omitempty"`
+	NonAutoSortDefault           bool               `xml:"nonAutoSortDefault,attr,omitempty"`
+	RankBy                       int                `xml:"rankBy,attr,omitempty"`
+	DefaultSubtotal              bool               `xml:"defaultSubtotal,attr,omitempty"`
+	SumSubtotal                  bool               `xml:"sumSubtotal,attr,omitempty"`
+	CountASubtotal               bool               `xml:"countASubtotal,attr,omitempty"`
+	AvgSubtotal                  bool               `xml:"avgSubtotal,attr,omitempty"`
+	MaxSubtotal                  bool               `xml:"maxSubtotal,attr,omitempty"`
+	MinSubtotal                  bool               `xml:"minSubtotal,attr,omitempty"`
+	ProductSubtotal              bool               `xml:"productSubtotal,attr,omitempty"`
+	CountSubtotal                bool               `xml:"countSubtotal,attr,omitempty"`
+	StdDevSubtotal               bool               `xml:"stdDevSubtotal,attr,omitempty"`
+	StdDevPSubtotal              bool               `xml:"stdDevPSubtotal,attr,omitempty"`
+	VarSubtotal                  bool               `xml:"varSubtotal,attr,omitempty"`
+	VarPSubtotal                 bool               `xml:"varPSubtotal,attr,omitempty"`
+	ShowPropCell                 bool               `xml:"showPropCell,attr,omitempty"`
+	ShowPropTip                  bool               `xml:"showPropTip,attr,omitempty"`
+	ShowPropAsCaption            bool               `xml:"showPropAsCaption,attr,omitempty"`
+	DefaultAttributeDrillState   bool               `xml:"defaultAttributeDrillState,attr,omitempty"`
+	Items                        *xlsxItems         `xml:"items"`
+	AutoSortScope                *xlsxAutoSortScope `xml:"autoSortScope"`
+	ExtLst                       *xlsxExtLst        `xml:"extLst"`
+}
+
+// xlsxItems represents the collection of items in a PivotTable field. The
+// items in the collection are ordered by index. Items represent the unique
+// entries from the field in the source data.
+type xlsxItems struct {
+	Count int         `xml:"count,attr"`
+	Item  []*xlsxItem `xml:"item"`
+}
+
+// xlsxItem represents a single item in PivotTable field.
+type xlsxItem struct {
+	N  string `xml:"n,attr,omitempty"`
+	T  string `xml:"t,attr,omitempty"`
+	H  bool   `xml:"h,attr,omitempty"`
+	S  bool   `xml:"s,attr,omitempty"`
+	SD bool   `xml:"sd,attr,omitempty"`
+	F  bool   `xml:"f,attr,omitempty"`
+	M  bool   `xml:"m,attr,omitempty"`
+	C  bool   `xml:"c,attr,omitempty"`
+	X  int    `xml:"x,attr,omitempty"`
+	D  bool   `xml:"d,attr,omitempty"`
+	E  bool   `xml:"e,attr,omitempty"`
+}
+
+// xlsxAutoSortScope represents the sorting scope for the PivotTable.
+type xlsxAutoSortScope struct {
+}
+
+// xlsxRowFields represents the collection of row fields for the PivotTable.
+type xlsxRowFields struct {
+	Count int          `xml:"count,attr"`
+	Field []*xlsxField `xml:"field"`
+}
+
+// xlsxField represents a generic field that can appear either on the column
+// or the row region of the PivotTable. There areas many <x> elements as there
+// are item values in any particular column or row.
+type xlsxField struct {
+	X int `xml:"x,attr"`
+}
+
+// xlsxRowItems represents the collection of items in row axis of the
+// PivotTable.
+type xlsxRowItems struct {
+	Count int      `xml:"count,attr"`
+	I     []*xlsxI `xml:"i"`
+}
+
+// xlsxI represents the collection of items in the row region of the
+// PivotTable.
+type xlsxI struct {
+	X []*xlsxX `xml:"x"`
+}
+
+// xlsxX represents an array of indexes to cached shared item values.
+type xlsxX struct {
+}
+
+// xlsxColFields represents the collection of fields that are on the column
+// axis of the PivotTable.
+type xlsxColFields struct {
+	Count int          `xml:"count,attr"`
+	Field []*xlsxField `xml:"field"`
+}
+
+// xlsxColItems represents the collection of column items of the PivotTable.
+type xlsxColItems struct {
+	Count int      `xml:"count,attr"`
+	I     []*xlsxI `xml:"i"`
+}
+
+// xlsxPageFields represents the collection of items in the page or report
+// filter region of the PivotTable.
+type xlsxPageFields struct {
+	Count     int              `xml:"count,attr"`
+	PageField []*xlsxPageField `xml:"pageField"`
+}
+
+// xlsxPageField represents a field on the page or report filter of the
+// PivotTable.
+type xlsxPageField struct {
+	Fld    int         `xml:"fld,attr"`
+	Item   int         `xml:"item,attr,omitempty"`
+	Hier   int         `xml:"hier,attr,omitempty"`
+	Name   string      `xml:"name,attr,omitempty"`
+	Cap    string      `xml:"cap,attr,omitempty"`
+	ExtLst *xlsxExtLst `xml:"extLst"`
+}
+
+// xlsxDataFields represents the collection of items in the data region of the
+// PivotTable.
+type xlsxDataFields struct {
+	Count     int              `xml:"count,attr"`
+	DataField []*xlsxDataField `xml:"dataField"`
+}
+
+// xlsxDataField represents a field from a source list, table, or database
+// that contains data that is summarized in a PivotTable.
+type xlsxDataField struct {
+	Name       string      `xml:"name,attr,omitempty"`
+	Fld        int         `xml:"fld,attr"`
+	Subtotal   string      `xml:"subtotal,attr,omitempty"`
+	ShowDataAs string      `xml:"showDataAs,attr,omitempty"`
+	BaseField  int         `xml:"baseField,attr,omitempty"`
+	BaseItem   int64       `xml:"baseItem,attr,omitempty"`
+	NumFmtID   string      `xml:"numFmtId,attr,omitempty"`
+	ExtLst     *xlsxExtLst `xml:"extLst"`
+}
+
+// xlsxConditionalFormats represents the collection of conditional formats
+// applied to a PivotTable.
+type xlsxConditionalFormats struct {
+}
+
+// xlsxPivotTableStyleInfo represent information on style applied to the
+// PivotTable.
+type xlsxPivotTableStyleInfo struct {
+	Name           string `xml:"name,attr"`
+	ShowRowHeaders bool   `xml:"showRowHeaders,attr"`
+	ShowColHeaders bool   `xml:"showColHeaders,attr"`
+	ShowRowStripes bool   `xml:"showRowStripes,attr,omitempty"`
+	ShowColStripes bool   `xml:"showColStripes,attr,omitempty"`
+	ShowLastColumn bool   `xml:"showLastColumn,attr,omitempty"`
+}

+ 105 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlSharedStrings.go

@@ -0,0 +1,105 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import (
+	"encoding/xml"
+	"strings"
+)
+
+// xlsxSST directly maps the sst element from the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main. String values may
+// be stored directly inside spreadsheet cell elements; however, storing the
+// same value inside multiple cell elements can result in very large worksheet
+// Parts, possibly resulting in performance degradation. The Shared String Table
+// is an indexed list of string values, shared across the workbook, which allows
+// implementations to store values only once.
+type xlsxSST struct {
+	XMLName     xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main sst"`
+	Count       int      `xml:"count,attr"`
+	UniqueCount int      `xml:"uniqueCount,attr"`
+	SI          []xlsxSI `xml:"si"`
+}
+
+// xlsxSI (String Item) is the representation of an individual string in the
+// Shared String table. If the string is just a simple string with formatting
+// applied at the cell level, then the String Item (si) should contain a
+// single text element used to express the string. However, if the string in
+// the cell is more complex - i.e., has formatting applied at the character
+// level - then the string item shall consist of multiple rich text runs which
+// collectively are used to express the string.
+type xlsxSI struct {
+	T *xlsxT  `xml:"t,omitempty"`
+	R []xlsxR `xml:"r"`
+}
+
+// String extracts characters from a string item.
+func (x xlsxSI) String() string {
+	if len(x.R) > 0 {
+		var rows strings.Builder
+		for _, s := range x.R {
+			if s.T != nil {
+				rows.WriteString(s.T.Val)
+			}
+		}
+		return rows.String()
+	}
+	if x.T != nil {
+		return x.T.Val
+	}
+	return ""
+}
+
+// xlsxR represents a run of rich text. A rich text run is a region of text
+// that share a common set of properties, such as formatting properties. The
+// properties are defined in the rPr element, and the text displayed to the
+// user is defined in the Text (t) element.
+type xlsxR struct {
+	RPr *xlsxRPr `xml:"rPr"`
+	T   *xlsxT   `xml:"t"`
+}
+
+// xlsxT directly maps the t element in the run properties.
+type xlsxT struct {
+	XMLName xml.Name `xml:"t"`
+	Space   xml.Attr `xml:"space,attr,omitempty"`
+	Val     string   `xml:",chardata"`
+}
+
+// xlsxRPr (Run Properties) specifies a set of run properties which shall be
+// applied to the contents of the parent run after all style formatting has been
+// applied to the text. These properties are defined as direct formatting, since
+// they are directly applied to the run and supersede any formatting from
+// styles.
+type xlsxRPr struct {
+	RFont     *attrValString `xml:"rFont"`
+	Charset   *attrValInt    `xml:"charset"`
+	Family    *attrValInt    `xml:"family"`
+	B         string         `xml:"b,omitempty"`
+	I         string         `xml:"i,omitempty"`
+	Strike    string         `xml:"strike,omitempty"`
+	Outline   string         `xml:"outline,omitempty"`
+	Shadow    string         `xml:"shadow,omitempty"`
+	Condense  string         `xml:"condense,omitempty"`
+	Extend    string         `xml:"extend,omitempty"`
+	Color     *xlsxColor     `xml:"color"`
+	Sz        *attrValFloat  `xml:"sz"`
+	U         *attrValString `xml:"u"`
+	VertAlign *attrValString `xml:"vertAlign"`
+	Scheme    *attrValString `xml:"scheme"`
+}
+
+// RichTextRun directly maps the settings of the rich text run.
+type RichTextRun struct {
+	Font *Font
+	Text string
+}

+ 368 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlStyles.go

@@ -0,0 +1,368 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// xlsxStyleSheet is the root element of the Styles part.
+type xlsxStyleSheet struct {
+	XMLName      xml.Name          `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main styleSheet"`
+	NumFmts      *xlsxNumFmts      `xml:"numFmts,omitempty"`
+	Fonts        *xlsxFonts        `xml:"fonts,omitempty"`
+	Fills        *xlsxFills        `xml:"fills,omitempty"`
+	Borders      *xlsxBorders      `xml:"borders,omitempty"`
+	CellStyleXfs *xlsxCellStyleXfs `xml:"cellStyleXfs,omitempty"`
+	CellXfs      *xlsxCellXfs      `xml:"cellXfs,omitempty"`
+	CellStyles   *xlsxCellStyles   `xml:"cellStyles,omitempty"`
+	Dxfs         *xlsxDxfs         `xml:"dxfs,omitempty"`
+	TableStyles  *xlsxTableStyles  `xml:"tableStyles,omitempty"`
+	Colors       *xlsxStyleColors  `xml:"colors,omitempty"`
+	ExtLst       *xlsxExtLst       `xml:"extLst"`
+}
+
+// xlsxAlignment formatting information pertaining to text alignment in cells.
+// There are a variety of choices for how text is aligned both horizontally and
+// vertically, as well as indentation settings, and so on.
+type xlsxAlignment struct {
+	Horizontal      string `xml:"horizontal,attr,omitempty"`
+	Indent          int    `xml:"indent,attr,omitempty"`
+	JustifyLastLine bool   `xml:"justifyLastLine,attr,omitempty"`
+	ReadingOrder    uint64 `xml:"readingOrder,attr,omitempty"`
+	RelativeIndent  int    `xml:"relativeIndent,attr,omitempty"`
+	ShrinkToFit     bool   `xml:"shrinkToFit,attr,omitempty"`
+	TextRotation    int    `xml:"textRotation,attr,omitempty"`
+	Vertical        string `xml:"vertical,attr,omitempty"`
+	WrapText        bool   `xml:"wrapText,attr,omitempty"`
+}
+
+// xlsxProtection (Protection Properties) contains protection properties
+// associated with the cell. Each cell has protection properties that can be
+// set. The cell protection properties do not take effect unless the sheet has
+// been protected.
+type xlsxProtection struct {
+	Hidden bool `xml:"hidden,attr"`
+	Locked bool `xml:"locked,attr"`
+}
+
+// xlsxLine expresses a single set of cell border.
+type xlsxLine struct {
+	Style string     `xml:"style,attr,omitempty"`
+	Color *xlsxColor `xml:"color,omitempty"`
+}
+
+// xlsxColor is a common mapping used for both the fgColor and bgColor elements.
+// Foreground color of the cell fill pattern. Cell fill patterns operate with
+// two colors: a background color and a foreground color. These combine together
+// to make a patterned cell fill. Background color of the cell fill pattern.
+// Cell fill patterns operate with two colors: a background color and a
+// foreground color. These combine together to make a patterned cell fill.
+type xlsxColor struct {
+	Auto    bool    `xml:"auto,attr,omitempty"`
+	RGB     string  `xml:"rgb,attr,omitempty"`
+	Indexed int     `xml:"indexed,attr,omitempty"`
+	Theme   *int    `xml:"theme,attr"`
+	Tint    float64 `xml:"tint,attr,omitempty"`
+}
+
+// xlsxFonts directly maps the font element. This element contains all font
+// definitions for this workbook.
+type xlsxFonts struct {
+	Count int         `xml:"count,attr"`
+	Font  []*xlsxFont `xml:"font"`
+}
+
+// xlsxFont directly maps the font element. This element defines the
+// properties for one of the fonts used in this workbook.
+type xlsxFont struct {
+	B        *bool          `xml:"b,omitempty"`
+	I        *bool          `xml:"i,omitempty"`
+	Strike   *bool          `xml:"strike,omitempty"`
+	Outline  *bool          `xml:"outline,omitempty"`
+	Shadow   *bool          `xml:"shadow,omitempty"`
+	Condense *bool          `xml:"condense,omitempty"`
+	Extend   *bool          `xml:"extend,omitempty"`
+	U        *attrValString `xml:"u"`
+	Sz       *attrValFloat  `xml:"sz"`
+	Color    *xlsxColor     `xml:"color"`
+	Name     *attrValString `xml:"name"`
+	Family   *attrValInt    `xml:"family"`
+	Charset  *attrValInt    `xml:"charset"`
+	Scheme   *attrValString `xml:"scheme"`
+}
+
+// xlsxFills directly maps the fills element. This element defines the cell
+// fills portion of the Styles part, consisting of a sequence of fill records. A
+// cell fill consists of a background color, foreground color, and pattern to be
+// applied across the cell.
+type xlsxFills struct {
+	Count int         `xml:"count,attr"`
+	Fill  []*xlsxFill `xml:"fill,omitempty"`
+}
+
+// xlsxFill directly maps the fill element. This element specifies fill
+// formatting.
+type xlsxFill struct {
+	PatternFill  *xlsxPatternFill  `xml:"patternFill,omitempty"`
+	GradientFill *xlsxGradientFill `xml:"gradientFill,omitempty"`
+}
+
+// xlsxPatternFill is used to specify cell fill information for pattern and
+// solid color cell fills. For solid cell fills (no pattern), fgColor is used.
+// For cell fills with patterns specified, then the cell fill color is
+// specified by the bgColor element.
+type xlsxPatternFill struct {
+	PatternType string    `xml:"patternType,attr,omitempty"`
+	FgColor     xlsxColor `xml:"fgColor,omitempty"`
+	BgColor     xlsxColor `xml:"bgColor,omitempty"`
+}
+
+// xlsxGradientFill defines a gradient-style cell fill. Gradient cell fills can
+// use one or two colors as the end points of color interpolation.
+type xlsxGradientFill struct {
+	Bottom float64                 `xml:"bottom,attr,omitempty"`
+	Degree float64                 `xml:"degree,attr,omitempty"`
+	Left   float64                 `xml:"left,attr,omitempty"`
+	Right  float64                 `xml:"right,attr,omitempty"`
+	Top    float64                 `xml:"top,attr,omitempty"`
+	Type   string                  `xml:"type,attr,omitempty"`
+	Stop   []*xlsxGradientFillStop `xml:"stop,omitempty"`
+}
+
+// xlsxGradientFillStop directly maps the stop element.
+type xlsxGradientFillStop struct {
+	Position float64   `xml:"position,attr"`
+	Color    xlsxColor `xml:"color,omitempty"`
+}
+
+// xlsxBorders directly maps the borders element. This element contains borders
+// formatting information, specifying all border definitions for all cells in
+// the workbook.
+type xlsxBorders struct {
+	Count  int           `xml:"count,attr"`
+	Border []*xlsxBorder `xml:"border,omitempty"`
+}
+
+// xlsxBorder directly maps the border element. Expresses a single set of cell
+// border formats (left, right, top, bottom, diagonal). Color is optional. When
+// missing, 'automatic' is implied.
+type xlsxBorder struct {
+	DiagonalDown bool     `xml:"diagonalDown,attr,omitempty"`
+	DiagonalUp   bool     `xml:"diagonalUp,attr,omitempty"`
+	Outline      bool     `xml:"outline,attr,omitempty"`
+	Left         xlsxLine `xml:"left,omitempty"`
+	Right        xlsxLine `xml:"right,omitempty"`
+	Top          xlsxLine `xml:"top,omitempty"`
+	Bottom       xlsxLine `xml:"bottom,omitempty"`
+	Diagonal     xlsxLine `xml:"diagonal,omitempty"`
+}
+
+// xlsxCellStyles directly maps the cellStyles element. This element contains
+// the named cell styles, consisting of a sequence of named style records. A
+// named cell style is a collection of direct or themed formatting (e.g., cell
+// border, cell fill, and font type/size/style) grouped together into a single
+// named style, and can be applied to a cell.
+type xlsxCellStyles struct {
+	XMLName   xml.Name         `xml:"cellStyles"`
+	Count     int              `xml:"count,attr"`
+	CellStyle []*xlsxCellStyle `xml:"cellStyle,omitempty"`
+}
+
+// xlsxCellStyle directly maps the cellStyle element. This element represents
+// the name and related formatting records for a named cell style in this
+// workbook.
+type xlsxCellStyle struct {
+	XMLName       xml.Name `xml:"cellStyle"`
+	Name          string   `xml:"name,attr"`
+	XfID          int      `xml:"xfId,attr"`
+	BuiltInID     *int     `xml:"builtinId,attr,omitempty"`
+	ILevel        *int     `xml:"iLevel,attr,omitempty"`
+	Hidden        *bool    `xml:"hidden,attr,omitempty"`
+	CustomBuiltIn *bool    `xml:"customBuiltin,attr,omitempty"`
+}
+
+// xlsxCellStyleXfs directly maps the cellStyleXfs element. This element
+// contains the master formatting records (xf's) which define the formatting for
+// all named cell styles in this workbook. Master formatting records reference
+// individual elements of formatting (e.g., number format, font definitions,
+// cell fills, etc) by specifying a zero-based index into those collections.
+// Master formatting records also specify whether to apply or ignore particular
+// aspects of formatting.
+type xlsxCellStyleXfs struct {
+	Count int      `xml:"count,attr"`
+	Xf    []xlsxXf `xml:"xf,omitempty"`
+}
+
+// xlsxXf directly maps the xf element. A single xf element describes all of the
+// formatting for a cell.
+type xlsxXf struct {
+	NumFmtID          *int            `xml:"numFmtId,attr"`
+	FontID            *int            `xml:"fontId,attr"`
+	FillID            *int            `xml:"fillId,attr"`
+	BorderID          *int            `xml:"borderId,attr"`
+	XfID              *int            `xml:"xfId,attr"`
+	QuotePrefix       *bool           `xml:"quotePrefix,attr"`
+	PivotButton       *bool           `xml:"pivotButton,attr"`
+	ApplyNumberFormat *bool           `xml:"applyNumberFormat,attr"`
+	ApplyFont         *bool           `xml:"applyFont,attr"`
+	ApplyFill         *bool           `xml:"applyFill,attr"`
+	ApplyBorder       *bool           `xml:"applyBorder,attr"`
+	ApplyAlignment    *bool           `xml:"applyAlignment,attr"`
+	ApplyProtection   *bool           `xml:"applyProtection,attr"`
+	Alignment         *xlsxAlignment  `xml:"alignment"`
+	Protection        *xlsxProtection `xml:"protection"`
+}
+
+// xlsxCellXfs directly maps the cellXfs element. This element contains the
+// master formatting records (xf) which define the formatting applied to cells
+// in this workbook. These records are the starting point for determining the
+// formatting for a cell. Cells in the Sheet Part reference the xf records by
+// zero-based index.
+type xlsxCellXfs struct {
+	Count int      `xml:"count,attr"`
+	Xf    []xlsxXf `xml:"xf,omitempty"`
+}
+
+// xlsxDxfs directly maps the dxfs element. This element contains the master
+// differential formatting records (dxf's) which define formatting for all non-
+// cell formatting in this workbook. Whereas xf records fully specify a
+// particular aspect of formatting (e.g., cell borders) by referencing those
+// formatting definitions elsewhere in the Styles part, dxf records specify
+// incremental (or differential) aspects of formatting directly inline within
+// the dxf element. The dxf formatting is to be applied on top of or in addition
+// to any formatting already present on the object using the dxf record.
+type xlsxDxfs struct {
+	Count int        `xml:"count,attr"`
+	Dxfs  []*xlsxDxf `xml:"dxf,omitempty"`
+}
+
+// xlsxDxf directly maps the dxf element. A single dxf record, expressing
+// incremental formatting to be applied.
+type xlsxDxf struct {
+	Dxf string `xml:",innerxml"`
+}
+
+// dxf directly maps the dxf element.
+type dxf struct {
+	Font       *xlsxFont       `xml:"font"`
+	NumFmt     *xlsxNumFmt     `xml:"numFmt"`
+	Fill       *xlsxFill       `xml:"fill"`
+	Alignment  *xlsxAlignment  `xml:"alignment"`
+	Border     *xlsxBorder     `xml:"border"`
+	Protection *xlsxProtection `xml:"protection"`
+	ExtLst     *xlsxExt        `xml:"extLst"`
+}
+
+// xlsxTableStyles directly maps the tableStyles element. This element
+// represents a collection of Table style definitions for Table styles and
+// PivotTable styles used in this workbook. It consists of a sequence of
+// tableStyle records, each defining a single Table style.
+type xlsxTableStyles struct {
+	Count             int               `xml:"count,attr"`
+	DefaultPivotStyle string            `xml:"defaultPivotStyle,attr"`
+	DefaultTableStyle string            `xml:"defaultTableStyle,attr"`
+	TableStyles       []*xlsxTableStyle `xml:"tableStyle,omitempty"`
+}
+
+// xlsxTableStyle directly maps the tableStyle element. This element represents
+// a single table style definition that indicates how a spreadsheet application
+// should format and display a table.
+type xlsxTableStyle struct {
+	Name              string `xml:"name,attr,omitempty"`
+	Pivot             int    `xml:"pivot,attr"`
+	Count             int    `xml:"count,attr,omitempty"`
+	Table             bool   `xml:"table,attr,omitempty"`
+	TableStyleElement string `xml:",innerxml"`
+}
+
+// xlsxNumFmts directly maps the numFmts element. This element defines the
+// number formats in this workbook, consisting of a sequence of numFmt records,
+// where each numFmt record defines a particular number format, indicating how
+// to format and render the numeric value of a cell.
+type xlsxNumFmts struct {
+	Count  int           `xml:"count,attr"`
+	NumFmt []*xlsxNumFmt `xml:"numFmt,omitempty"`
+}
+
+// xlsxNumFmt directly maps the numFmt element. This element specifies number
+// format properties which indicate how to format and render the numeric value
+// of a cell.
+type xlsxNumFmt struct {
+	NumFmtID   int    `xml:"numFmtId,attr"`
+	FormatCode string `xml:"formatCode,attr,omitempty"`
+}
+
+// xlsxStyleColors directly maps the colors element. Color information
+// associated with this stylesheet. This collection is written whenever the
+// legacy color palette has been modified (backwards compatibility settings) or
+// a custom color has been selected while using this workbook.
+type xlsxStyleColors struct {
+	Color string `xml:",innerxml"`
+}
+
+// Alignment directly maps the alignment settings of the cells.
+type Alignment struct {
+	Horizontal      string `json:"horizontal"`
+	Indent          int    `json:"indent"`
+	JustifyLastLine bool   `json:"justify_last_line"`
+	ReadingOrder    uint64 `json:"reading_order"`
+	RelativeIndent  int    `json:"relative_indent"`
+	ShrinkToFit     bool   `json:"shrink_to_fit"`
+	TextRotation    int    `json:"text_rotation"`
+	Vertical        string `json:"vertical"`
+	WrapText        bool   `json:"wrap_text"`
+}
+
+// Border directly maps the border settings of the cells.
+type Border struct {
+	Type  string `json:"type"`
+	Color string `json:"color"`
+	Style int    `json:"style"`
+}
+
+// Font directly maps the font settings of the fonts.
+type Font struct {
+	Bold      bool    `json:"bold"`
+	Italic    bool    `json:"italic"`
+	Underline string  `json:"underline"`
+	Family    string  `json:"family"`
+	Size      float64 `json:"size"`
+	Strike    bool    `json:"strike"`
+	Color     string  `json:"color"`
+}
+
+// Fill directly maps the fill settings of the cells.
+type Fill struct {
+	Type    string   `json:"type"`
+	Pattern int      `json:"pattern"`
+	Color   []string `json:"color"`
+	Shading int      `json:"shading"`
+}
+
+// Protection directly maps the protection settings of the cells.
+type Protection struct {
+	Hidden bool `json:"hidden"`
+	Locked bool `json:"locked"`
+}
+
+// Style directly maps the style settings of the cells.
+type Style struct {
+	Border        []Border    `json:"border"`
+	Fill          Fill        `json:"fill"`
+	Font          *Font       `json:"font"`
+	Alignment     *Alignment  `json:"alignment"`
+	Protection    *Protection `json:"protection"`
+	NumFmt        int         `json:"number_format"`
+	DecimalPlaces int         `json:"decimal_places"`
+	CustomNumFmt  *string     `json:"custom_number_format"`
+	Lang          string      `json:"lang"`
+	NegRed        bool        `json:"negred"`
+}

+ 217 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlTable.go

@@ -0,0 +1,217 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// xlsxTable directly maps the table element. A table helps organize and provide
+// structure to lists of information in a worksheet. Tables have clearly labeled
+// columns, rows, and data regions. Tables make it easier for users to sort,
+// analyze, format, manage, add, and delete information. This element is the
+// root element for a table that is not a single cell XML table.
+type xlsxTable struct {
+	XMLName              xml.Name            `xml:"table"`
+	XMLNS                string              `xml:"xmlns,attr"`
+	DataCellStyle        string              `xml:"dataCellStyle,attr,omitempty"`
+	DataDxfID            int                 `xml:"dataDxfId,attr,omitempty"`
+	DisplayName          string              `xml:"displayName,attr,omitempty"`
+	HeaderRowBorderDxfID int                 `xml:"headerRowBorderDxfId,attr,omitempty"`
+	HeaderRowCellStyle   string              `xml:"headerRowCellStyle,attr,omitempty"`
+	HeaderRowCount       int                 `xml:"headerRowCount,attr,omitempty"`
+	HeaderRowDxfID       int                 `xml:"headerRowDxfId,attr,omitempty"`
+	ID                   int                 `xml:"id,attr"`
+	InsertRow            bool                `xml:"insertRow,attr,omitempty"`
+	InsertRowShift       bool                `xml:"insertRowShift,attr,omitempty"`
+	Name                 string              `xml:"name,attr"`
+	Published            bool                `xml:"published,attr,omitempty"`
+	Ref                  string              `xml:"ref,attr"`
+	TotalsRowCount       int                 `xml:"totalsRowCount,attr,omitempty"`
+	TotalsRowDxfID       int                 `xml:"totalsRowDxfId,attr,omitempty"`
+	TotalsRowShown       bool                `xml:"totalsRowShown,attr"`
+	AutoFilter           *xlsxAutoFilter     `xml:"autoFilter"`
+	TableColumns         *xlsxTableColumns   `xml:"tableColumns"`
+	TableStyleInfo       *xlsxTableStyleInfo `xml:"tableStyleInfo"`
+}
+
+// xlsxAutoFilter temporarily hides rows based on a filter criteria, which is
+// applied column by column to a table of data in the worksheet. This collection
+// expresses AutoFilter settings.
+type xlsxAutoFilter struct {
+	XMLName      xml.Name          `xml:"autoFilter"`
+	Ref          string            `xml:"ref,attr"`
+	FilterColumn *xlsxFilterColumn `xml:"filterColumn"`
+}
+
+// xlsxFilterColumn directly maps the filterColumn element. The filterColumn
+// collection identifies a particular column in the AutoFilter range and
+// specifies filter information that has been applied to this column. If a
+// column in the AutoFilter range has no criteria specified, then there is no
+// corresponding filterColumn collection expressed for that column.
+type xlsxFilterColumn struct {
+	ColID         int                `xml:"colId,attr"`
+	HiddenButton  bool               `xml:"hiddenButton,attr,omitempty"`
+	ShowButton    bool               `xml:"showButton,attr,omitempty"`
+	CustomFilters *xlsxCustomFilters `xml:"customFilters"`
+	Filters       *xlsxFilters       `xml:"filters"`
+	ColorFilter   *xlsxColorFilter   `xml:"colorFilter"`
+	DynamicFilter *xlsxDynamicFilter `xml:"dynamicFilter"`
+	IconFilter    *xlsxIconFilter    `xml:"iconFilter"`
+	Top10         *xlsxTop10         `xml:"top10"`
+}
+
+// xlsxCustomFilters directly maps the customFilters element. When there is more
+// than one custom filter criteria to apply (an 'and' or 'or' joining two
+// criteria), then this element groups the customFilter elements together.
+type xlsxCustomFilters struct {
+	And          bool                `xml:"and,attr,omitempty"`
+	CustomFilter []*xlsxCustomFilter `xml:"customFilter"`
+}
+
+// xlsxCustomFilter directly maps the customFilter element. A custom AutoFilter
+// specifies an operator and a value. There can be at most two customFilters
+// specified, and in that case the parent element specifies whether the two
+// conditions are joined by 'and' or 'or'. For any cells whose values do not
+// meet the specified criteria, the corresponding rows shall be hidden from view
+// when the filter is applied.
+type xlsxCustomFilter struct {
+	Operator string `xml:"operator,attr,omitempty"`
+	Val      string `xml:"val,attr,omitempty"`
+}
+
+// xlsxFilters directly maps the filters (Filter Criteria) element. When
+// multiple values are chosen to filter by, or when a group of date values are
+// chosen to filter by, this element groups those criteria together.
+type xlsxFilters struct {
+	Blank         bool                 `xml:"blank,attr,omitempty"`
+	CalendarType  string               `xml:"calendarType,attr,omitempty"`
+	Filter        []*xlsxFilter        `xml:"filter"`
+	DateGroupItem []*xlsxDateGroupItem `xml:"dateGroupItem"`
+}
+
+// xlsxFilter directly maps the filter element. This element expresses a filter
+// criteria value.
+type xlsxFilter struct {
+	Val string `xml:"val,attr,omitempty"`
+}
+
+// xlsxColorFilter directly maps the colorFilter element. This element specifies
+// the color to filter by and whether to use the cell's fill or font color in
+// the filter criteria. If the cell's font or fill color does not match the
+// color specified in the criteria, the rows corresponding to those cells are
+// hidden from view.
+type xlsxColorFilter struct {
+	CellColor bool `xml:"cellColor,attr"`
+	DxfID     int  `xml:"dxfId,attr"`
+}
+
+// xlsxDynamicFilter directly maps the dynamicFilter element. This collection
+// specifies dynamic filter criteria. These criteria are considered dynamic
+// because they can change, either with the data itself (e.g., "above average")
+// or with the current system date (e.g., show values for "today"). For any
+// cells whose values do not meet the specified criteria, the corresponding rows
+// shall be hidden from view when the filter is applied.
+type xlsxDynamicFilter struct {
+	MaxValISO string  `xml:"maxValIso,attr,omitempty"`
+	Type      string  `xml:"type,attr,omitempty"`
+	Val       float64 `xml:"val,attr,omitempty"`
+	ValISO    string  `xml:"valIso,attr,omitempty"`
+}
+
+// xlsxIconFilter directly maps the iconFilter element. This element specifies
+// the icon set and particular icon within that set to filter by. For any cells
+// whose icon does not match the specified criteria, the corresponding rows
+// shall be hidden from view when the filter is applied.
+type xlsxIconFilter struct {
+	IconID  int    `xml:"iconId,attr"`
+	IconSet string `xml:"iconSet,attr,omitempty"`
+}
+
+// xlsxTop10 directly maps the top10 element. This element specifies the top N
+// (percent or number of items) to filter by.
+type xlsxTop10 struct {
+	FilterVal float64 `xml:"filterVal,attr,omitempty"`
+	Percent   bool    `xml:"percent,attr,omitempty"`
+	Top       bool    `xml:"top,attr"`
+	Val       float64 `xml:"val,attr,omitempty"`
+}
+
+// xlsxDateGroupItem directly maps the dateGroupItem element. This collection is
+// used to express a group of dates or times which are used in an AutoFilter
+// criteria. [Note: See parent element for an example. end note] Values are
+// always written in the calendar type of the first date encountered in the
+// filter range, so that all subsequent dates, even when formatted or
+// represented by other calendar types, can be correctly compared for the
+// purposes of filtering.
+type xlsxDateGroupItem struct {
+	DateTimeGrouping string `xml:"dateTimeGrouping,attr,omitempty"`
+	Day              int    `xml:"day,attr,omitempty"`
+	Hour             int    `xml:"hour,attr,omitempty"`
+	Minute           int    `xml:"minute,attr,omitempty"`
+	Month            int    `xml:"month,attr,omitempty"`
+	Second           int    `xml:"second,attr,omitempty"`
+	Year             int    `xml:"year,attr,omitempty"`
+}
+
+// xlsxTableColumns directly maps the element representing the collection of all
+// table columns for this table.
+type xlsxTableColumns struct {
+	Count       int                `xml:"count,attr"`
+	TableColumn []*xlsxTableColumn `xml:"tableColumn"`
+}
+
+// xlsxTableColumn directly maps the element representing a single column for
+// this table.
+type xlsxTableColumn struct {
+	DataCellStyle      string `xml:"dataCellStyle,attr,omitempty"`
+	DataDxfID          int    `xml:"dataDxfId,attr,omitempty"`
+	HeaderRowCellStyle string `xml:"headerRowCellStyle,attr,omitempty"`
+	HeaderRowDxfID     int    `xml:"headerRowDxfId,attr,omitempty"`
+	ID                 int    `xml:"id,attr"`
+	Name               string `xml:"name,attr"`
+	QueryTableFieldID  int    `xml:"queryTableFieldId,attr,omitempty"`
+	TotalsRowCellStyle string `xml:"totalsRowCellStyle,attr,omitempty"`
+	TotalsRowDxfID     int    `xml:"totalsRowDxfId,attr,omitempty"`
+	TotalsRowFunction  string `xml:"totalsRowFunction,attr,omitempty"`
+	TotalsRowLabel     string `xml:"totalsRowLabel,attr,omitempty"`
+	UniqueName         string `xml:"uniqueName,attr,omitempty"`
+}
+
+// xlsxTableStyleInfo directly maps the tableStyleInfo element. This element
+// describes which style is used to display this table, and specifies which
+// portions of the table have the style applied.
+type xlsxTableStyleInfo struct {
+	Name              string `xml:"name,attr,omitempty"`
+	ShowFirstColumn   bool   `xml:"showFirstColumn,attr"`
+	ShowLastColumn    bool   `xml:"showLastColumn,attr"`
+	ShowRowStripes    bool   `xml:"showRowStripes,attr"`
+	ShowColumnStripes bool   `xml:"showColumnStripes,attr"`
+}
+
+// formatTable directly maps the format settings of the table.
+type formatTable struct {
+	TableName         string `json:"table_name"`
+	TableStyle        string `json:"table_style"`
+	ShowFirstColumn   bool   `json:"show_first_column"`
+	ShowLastColumn    bool   `json:"show_last_column"`
+	ShowRowStripes    bool   `json:"show_row_stripes"`
+	ShowColumnStripes bool   `json:"show_column_stripes"`
+}
+
+// formatAutoFilter directly maps the auto filter settings.
+type formatAutoFilter struct {
+	Column     string `json:"column"`
+	Expression string `json:"expression"`
+	FilterList []struct {
+		Column string `json:"column"`
+		Value  []int  `json:"value"`
+	} `json:"filter_list"`
+}

+ 151 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlTheme.go

@@ -0,0 +1,151 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// xlsxTheme directly maps the theme element in the namespace
+// http://schemas.openxmlformats.org/drawingml/2006/main
+type xlsxTheme struct {
+	ThemeElements     xlsxThemeElements     `xml:"themeElements"`
+	ObjectDefaults    xlsxObjectDefaults    `xml:"objectDefaults"`
+	ExtraClrSchemeLst xlsxExtraClrSchemeLst `xml:"extraClrSchemeLst"`
+	ExtLst            *xlsxExtLst           `xml:"extLst"`
+}
+
+// objectDefaults element allows for the definition of default shape, line,
+// and textbox formatting properties. An application can use this information
+// to format a shape (or text) initially on insertion into a document.
+type xlsxObjectDefaults struct {
+	ObjectDefaults string `xml:",innerxml"`
+}
+
+// xlsxExtraClrSchemeLst element is a container for the list of extra color
+// schemes present in a document.
+type xlsxExtraClrSchemeLst struct {
+	ExtraClrSchemeLst string `xml:",innerxml"`
+}
+
+// xlsxThemeElements directly maps the element defines the theme formatting
+// options for the theme and is the workhorse of the theme. This is where the
+// bulk of the shared theme information is contained and used by a document.
+// This element contains the color scheme, font scheme, and format scheme
+// elements which define the different formatting aspects of what a theme
+// defines.
+type xlsxThemeElements struct {
+	ClrScheme  xlsxClrScheme  `xml:"clrScheme"`
+	FontScheme xlsxFontScheme `xml:"fontScheme"`
+	FmtScheme  xlsxFmtScheme  `xml:"fmtScheme"`
+}
+
+// xlsxClrScheme element specifies the theme color, stored in the document's
+// Theme part to which the value of this theme color shall be mapped. This
+// mapping enables multiple theme colors to be chained together.
+type xlsxClrScheme struct {
+	Name     string            `xml:"name,attr"`
+	Children []xlsxClrSchemeEl `xml:",any"`
+}
+
+// xlsxFontScheme element defines the font scheme within the theme. The font
+// scheme consists of a pair of major and minor fonts for which to use in a
+// document. The major font corresponds well with the heading areas of a
+// document, and the minor font corresponds well with the normal text or
+// paragraph areas.
+type xlsxFontScheme struct {
+	Name      string        `xml:"name,attr"`
+	MajorFont xlsxMajorFont `xml:"majorFont"`
+	MinorFont xlsxMinorFont `xml:"minorFont"`
+	ExtLst    *xlsxExtLst   `xml:"extLst"`
+}
+
+// xlsxMajorFont element defines the set of major fonts which are to be used
+// under different languages or locals.
+type xlsxMajorFont struct {
+	Children []xlsxFontSchemeEl `xml:",any"`
+}
+
+// xlsxMinorFont element defines the set of minor fonts that are to be used
+// under different languages or locals.
+type xlsxMinorFont struct {
+	Children []xlsxFontSchemeEl `xml:",any"`
+}
+
+// xlsxFmtScheme element contains the background fill styles, effect styles,
+// fill styles, and line styles which define the style matrix for a theme. The
+// style matrix consists of subtle, moderate, and intense fills, lines, and
+// effects. The background fills are not generally thought of to directly be
+// associated with the matrix, but do play a role in the style of the overall
+// document. Usually, a given object chooses a single line style, a single
+// fill style, and a single effect style in order to define the overall final
+// look of the object.
+type xlsxFmtScheme struct {
+	Name           string             `xml:"name,attr"`
+	FillStyleLst   xlsxFillStyleLst   `xml:"fillStyleLst"`
+	LnStyleLst     xlsxLnStyleLst     `xml:"lnStyleLst"`
+	EffectStyleLst xlsxEffectStyleLst `xml:"effectStyleLst"`
+	BgFillStyleLst xlsxBgFillStyleLst `xml:"bgFillStyleLst"`
+}
+
+// xlsxFillStyleLst element defines a set of three fill styles that are used
+// within a theme. The three fill styles are arranged in order from subtle to
+// moderate to intense.
+type xlsxFillStyleLst struct {
+	FillStyleLst string `xml:",innerxml"`
+}
+
+// xlsxLnStyleLst element defines a list of three line styles for use within a
+// theme. The three line styles are arranged in order from subtle to moderate
+// to intense versions of lines. This list makes up part of the style matrix.
+type xlsxLnStyleLst struct {
+	LnStyleLst string `xml:",innerxml"`
+}
+
+// xlsxEffectStyleLst element defines a set of three effect styles that create
+// the effect style list for a theme. The effect styles are arranged in order
+// of subtle to moderate to intense.
+type xlsxEffectStyleLst struct {
+	EffectStyleLst string `xml:",innerxml"`
+}
+
+// xlsxBgFillStyleLst  element defines a list of background fills that are
+// used within a theme. The background fills consist of three fills, arranged
+// in order from subtle to moderate to intense.
+type xlsxBgFillStyleLst struct {
+	BgFillStyleLst string `xml:",innerxml"`
+}
+
+// xlsxClrScheme specifies the theme color, stored in the document's Theme
+// part to which the value of this theme color shall be mapped. This mapping
+// enables multiple theme colors to be chained together.
+type xlsxClrSchemeEl struct {
+	XMLName xml.Name
+	SysClr  *xlsxSysClr    `xml:"sysClr"`
+	SrgbClr *attrValString `xml:"srgbClr"`
+}
+
+// xlsxFontSchemeEl directly maps the major and minor font of the style's font
+// scheme.
+type xlsxFontSchemeEl struct {
+	XMLName     xml.Name
+	Script      string `xml:"script,attr,omitempty"`
+	Typeface    string `xml:"typeface,attr"`
+	Panose      string `xml:"panose,attr,omitempty"`
+	PitchFamily string `xml:"pitchFamily,attr,omitempty"`
+	Charset     string `xml:"charset,attr,omitempty"`
+}
+
+// xlsxSysClr element specifies a color bound to predefined operating system
+// elements.
+type xlsxSysClr struct {
+	Val     string `xml:"val,attr"`
+	LastClr string `xml:"lastClr,attr"`
+}

+ 301 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlWorkbook.go

@@ -0,0 +1,301 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// xlsxRelationships describe references from parts to other internal resources in the package or to external resources.
+type xlsxRelationships struct {
+	XMLName       xml.Name           `xml:"http://schemas.openxmlformats.org/package/2006/relationships Relationships"`
+	Relationships []xlsxRelationship `xml:"Relationship"`
+}
+
+// xlsxRelationship contains relations which maps id and XML.
+type xlsxRelationship struct {
+	ID         string `xml:"Id,attr"`
+	Target     string `xml:",attr"`
+	Type       string `xml:",attr"`
+	TargetMode string `xml:",attr,omitempty"`
+}
+
+// xlsxWorkbook contains elements and attributes that encompass the data
+// content of the workbook. The workbook's child elements each have their own
+// subclause references.
+type xlsxWorkbook struct {
+	XMLName             xml.Name                 `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main workbook"`
+	FileVersion         *xlsxFileVersion         `xml:"fileVersion"`
+	WorkbookPr          *xlsxWorkbookPr          `xml:"workbookPr"`
+	WorkbookProtection  *xlsxWorkbookProtection  `xml:"workbookProtection"`
+	BookViews           *xlsxBookViews           `xml:"bookViews"`
+	Sheets              xlsxSheets               `xml:"sheets"`
+	ExternalReferences  *xlsxExternalReferences  `xml:"externalReferences"`
+	DefinedNames        *xlsxDefinedNames        `xml:"definedNames"`
+	CalcPr              *xlsxCalcPr              `xml:"calcPr"`
+	CustomWorkbookViews *xlsxCustomWorkbookViews `xml:"customWorkbookViews"`
+	PivotCaches         *xlsxPivotCaches         `xml:"pivotCaches"`
+	ExtLst              *xlsxExtLst              `xml:"extLst"`
+	FileRecoveryPr      *xlsxFileRecoveryPr      `xml:"fileRecoveryPr"`
+}
+
+// xlsxFileRecoveryPr maps sheet recovery information. This element defines
+// properties that track the state of the workbook file, such as whether the
+// file was saved during a crash, or whether it should be opened in auto-recover
+// mode.
+type xlsxFileRecoveryPr struct {
+	AutoRecover     bool `xml:"autoRecover,attr,omitempty"`
+	CrashSave       bool `xml:"crashSave,attr,omitempty"`
+	DataExtractLoad bool `xml:"dataExtractLoad,attr,omitempty"`
+	RepairLoad      bool `xml:"repairLoad,attr,omitempty"`
+}
+
+// xlsxWorkbookProtection directly maps the workbookProtection element. This
+// element specifies options for protecting data in the workbook. Applications
+// might use workbook protection to prevent anyone from accidentally changing,
+// moving, or deleting important data. This protection can be ignored by
+// applications which choose not to support this optional protection mechanism.
+// When a password is to be hashed and stored in this element, it shall be
+// hashed as defined below, starting from a UTF-16LE encoded string value. If
+// there is a leading BOM character (U+FEFF) in the encoded password it is
+// removed before hash calculation.
+type xlsxWorkbookProtection struct {
+	LockRevision           bool   `xml:"lockRevision,attr,omitempty"`
+	LockStructure          bool   `xml:"lockStructure,attr,omitempty"`
+	LockWindows            bool   `xml:"lockWindows,attr,omitempty"`
+	RevisionsAlgorithmName string `xml:"revisionsAlgorithmName,attr,omitempty"`
+	RevisionsHashValue     string `xml:"revisionsHashValue,attr,omitempty"`
+	RevisionsSaltValue     string `xml:"revisionsSaltValue,attr,omitempty"`
+	RevisionsSpinCount     int    `xml:"revisionsSpinCount,attr,omitempty"`
+	WorkbookAlgorithmName  string `xml:"workbookAlgorithmName,attr,omitempty"`
+	WorkbookHashValue      string `xml:"workbookHashValue,attr,omitempty"`
+	WorkbookSaltValue      string `xml:"workbookSaltValue,attr,omitempty"`
+	WorkbookSpinCount      int    `xml:"workbookSpinCount,attr,omitempty"`
+}
+
+// xlsxFileVersion directly maps the fileVersion element. This element defines
+// properties that track which version of the application accessed the data and
+// source code contained in the file.
+type xlsxFileVersion struct {
+	AppName      string `xml:"appName,attr,omitempty"`
+	CodeName     string `xml:"codeName,attr,omitempty"`
+	LastEdited   string `xml:"lastEdited,attr,omitempty"`
+	LowestEdited string `xml:"lowestEdited,attr,omitempty"`
+	RupBuild     string `xml:"rupBuild,attr,omitempty"`
+}
+
+// xlsxWorkbookPr directly maps the workbookPr element from the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main This element
+// defines a collection of workbook properties.
+type xlsxWorkbookPr struct {
+	AllowRefreshQuery          bool   `xml:"allowRefreshQuery,attr,omitempty"`
+	AutoCompressPictures       bool   `xml:"autoCompressPictures,attr,omitempty"`
+	BackupFile                 bool   `xml:"backupFile,attr,omitempty"`
+	CheckCompatibility         bool   `xml:"checkCompatibility,attr,omitempty"`
+	CodeName                   string `xml:"codeName,attr,omitempty"`
+	Date1904                   bool   `xml:"date1904,attr,omitempty"`
+	DefaultThemeVersion        string `xml:"defaultThemeVersion,attr,omitempty"`
+	FilterPrivacy              bool   `xml:"filterPrivacy,attr,omitempty"`
+	HidePivotFieldList         bool   `xml:"hidePivotFieldList,attr,omitempty"`
+	PromptedSolutions          bool   `xml:"promptedSolutions,attr,omitempty"`
+	PublishItems               bool   `xml:"publishItems,attr,omitempty"`
+	RefreshAllConnections      bool   `xml:"refreshAllConnections,attr,omitempty"`
+	SaveExternalLinkValues     bool   `xml:"saveExternalLinkValues,attr,omitempty"`
+	ShowBorderUnselectedTables bool   `xml:"showBorderUnselectedTables,attr,omitempty"`
+	ShowInkAnnotation          bool   `xml:"showInkAnnotation,attr,omitempty"`
+	ShowObjects                string `xml:"showObjects,attr,omitempty"`
+	ShowPivotChartFilter       bool   `xml:"showPivotChartFilter,attr,omitempty"`
+	UpdateLinks                string `xml:"updateLinks,attr,omitempty"`
+}
+
+// xlsxBookViews directly maps the bookViews element. This element specifies the
+// collection of workbook views of the enclosing workbook. Each view can specify
+// a window position, filter options, and other configurations. There is no
+// limit on the number of workbook views that can be defined for a workbook.
+type xlsxBookViews struct {
+	WorkBookView []xlsxWorkBookView `xml:"workbookView"`
+}
+
+// xlsxWorkBookView directly maps the workbookView element from the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main This element
+// specifies a single Workbook view.
+type xlsxWorkBookView struct {
+	ActiveTab              int    `xml:"activeTab,attr,omitempty"`
+	AutoFilterDateGrouping bool   `xml:"autoFilterDateGrouping,attr,omitempty"`
+	FirstSheet             int    `xml:"firstSheet,attr,omitempty"`
+	Minimized              bool   `xml:"minimized,attr,omitempty"`
+	ShowHorizontalScroll   bool   `xml:"showHorizontalScroll,attr,omitempty"`
+	ShowSheetTabs          bool   `xml:"showSheetTabs,attr,omitempty"`
+	ShowVerticalScroll     bool   `xml:"showVerticalScroll,attr,omitempty"`
+	TabRatio               int    `xml:"tabRatio,attr,omitempty"`
+	Visibility             string `xml:"visibility,attr,omitempty"`
+	WindowHeight           int    `xml:"windowHeight,attr,omitempty"`
+	WindowWidth            int    `xml:"windowWidth,attr,omitempty"`
+	XWindow                string `xml:"xWindow,attr,omitempty"`
+	YWindow                string `xml:"yWindow,attr,omitempty"`
+}
+
+// xlsxSheets directly maps the sheets element from the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main.
+type xlsxSheets struct {
+	Sheet []xlsxSheet `xml:"sheet"`
+}
+
+// xlsxSheet defines a sheet in this workbook. Sheet data is stored in a
+// separate part.
+type xlsxSheet struct {
+	Name    string `xml:"name,attr,omitempty"`
+	SheetID int    `xml:"sheetId,attr,omitempty"`
+	ID      string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr"`
+	State   string `xml:"state,attr,omitempty"`
+}
+
+// xlsxExternalReferences directly maps the externalReferences element of the
+// external workbook references part.
+type xlsxExternalReferences struct {
+	ExternalReference []xlsxExternalReference `xml:"externalReference"`
+}
+
+// xlsxExternalReference directly maps the externalReference element of the
+// external workbook references part.
+type xlsxExternalReference struct {
+	RID string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
+}
+
+// xlsxPivotCaches element enumerates pivot cache definition parts used by pivot
+// tables and formulas in this workbook.
+type xlsxPivotCaches struct {
+	PivotCache []xlsxPivotCache `xml:"pivotCache"`
+}
+
+// xlsxPivotCache directly maps the pivotCache element.
+type xlsxPivotCache struct {
+	CacheID int    `xml:"cacheId,attr"`
+	RID     string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
+}
+
+// extLst element provides a convention for extending spreadsheetML in
+// predefined locations. The locations shall be denoted with the extLst element,
+// and are called extension lists. Extension list locations within the markup
+// document are specified in the markup specification and can be used to store
+// extensions to the markup specification, whether those are future version
+// extensions of the markup specification or are private extensions implemented
+// independently from the markup specification. Markup within an extension might
+// not be understood by a consumer.
+type xlsxExtLst struct {
+	Ext string `xml:",innerxml"`
+}
+
+// xlsxDefinedNames directly maps the definedNames element. This element defines
+// the collection of defined names for this workbook. Defined names are
+// descriptive names to represent cells, ranges of cells, formulas, or constant
+// values. Defined names can be used to represent a range on any worksheet.
+type xlsxDefinedNames struct {
+	DefinedName []xlsxDefinedName `xml:"definedName"`
+}
+
+// xlsxDefinedName directly maps the definedName element from the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main This element
+// defines a defined name within this workbook. A defined name is descriptive
+// text that is used to represents a cell, range of cells, formula, or constant
+// value. For a descriptions of the attributes see https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.spreadsheet.definedname
+type xlsxDefinedName struct {
+	Comment           string `xml:"comment,attr,omitempty"`
+	CustomMenu        string `xml:"customMenu,attr,omitempty"`
+	Description       string `xml:"description,attr,omitempty"`
+	Function          bool   `xml:"function,attr,omitempty"`
+	FunctionGroupID   int    `xml:"functionGroupId,attr,omitempty"`
+	Help              string `xml:"help,attr,omitempty"`
+	Hidden            bool   `xml:"hidden,attr,omitempty"`
+	LocalSheetID      *int   `xml:"localSheetId,attr"`
+	Name              string `xml:"name,attr,omitempty"`
+	PublishToServer   bool   `xml:"publishToServer,attr,omitempty"`
+	ShortcutKey       string `xml:"shortcutKey,attr,omitempty"`
+	StatusBar         string `xml:"statusBar,attr,omitempty"`
+	VbProcedure       bool   `xml:"vbProcedure,attr,omitempty"`
+	WorkbookParameter bool   `xml:"workbookParameter,attr,omitempty"`
+	Xlm               bool   `xml:"xml,attr,omitempty"`
+	Data              string `xml:",chardata"`
+}
+
+// xlsxCalcPr directly maps the calcPr element. This element defines the
+// collection of properties the application uses to record calculation status
+// and details. Calculation is the process of computing formulas and then
+// displaying the results as values in the cells that contain the formulas.
+type xlsxCalcPr struct {
+	CalcCompleted         bool    `xml:"calcCompleted,attr,omitempty"`
+	CalcID                string  `xml:"calcId,attr,omitempty"`
+	CalcMode              string  `xml:"calcMode,attr,omitempty"`
+	CalcOnSave            bool    `xml:"calcOnSave,attr,omitempty"`
+	ConcurrentCalc        *bool   `xml:"concurrentCalc,attr"`
+	ConcurrentManualCount int     `xml:"concurrentManualCount,attr,omitempty"`
+	ForceFullCalc         bool    `xml:"forceFullCalc,attr,omitempty"`
+	FullCalcOnLoad        bool    `xml:"fullCalcOnLoad,attr,omitempty"`
+	FullPrecision         bool    `xml:"fullPrecision,attr,omitempty"`
+	Iterate               bool    `xml:"iterate,attr,omitempty"`
+	IterateCount          int     `xml:"iterateCount,attr,omitempty"`
+	IterateDelta          float64 `xml:"iterateDelta,attr,omitempty"`
+	RefMode               string  `xml:"refMode,attr,omitempty"`
+}
+
+// xlsxCustomWorkbookViews defines the collection of custom workbook views that
+// are defined for this workbook. A customWorkbookView is similar in concept to
+// a workbookView in that its attributes contain settings related to the way
+// that the workbook should be displayed on a screen by a spreadsheet
+// application.
+type xlsxCustomWorkbookViews struct {
+	CustomWorkbookView []xlsxCustomWorkbookView `xml:"customWorkbookView"`
+}
+
+// xlsxCustomWorkbookView directly maps the customWorkbookView element. This
+// element specifies a single custom workbook view. A custom workbook view
+// consists of a set of display and print settings that you can name and apply
+// to a workbook. You can create more than one custom workbook view of the same
+// workbook. Custom Workbook Views are not required in order to construct a
+// valid SpreadsheetML document, and are not necessary if the document is never
+// displayed by a spreadsheet application, or if the spreadsheet application has
+// a fixed display for workbooks. However, if a spreadsheet application chooses
+// to implement configurable display modes, the customWorkbookView element
+// should be used to persist the settings for those display modes.
+type xlsxCustomWorkbookView struct {
+	ActiveSheetID        *int    `xml:"activeSheetId,attr"`
+	AutoUpdate           *bool   `xml:"autoUpdate,attr"`
+	ChangesSavedWin      *bool   `xml:"changesSavedWin,attr"`
+	GUID                 *string `xml:"guid,attr"`
+	IncludeHiddenRowCol  *bool   `xml:"includeHiddenRowCol,attr"`
+	IncludePrintSettings *bool   `xml:"includePrintSettings,attr"`
+	Maximized            *bool   `xml:"maximized,attr"`
+	MergeInterval        int     `xml:"mergeInterval,attr"`
+	Minimized            *bool   `xml:"minimized,attr"`
+	Name                 *string `xml:"name,attr"`
+	OnlySync             *bool   `xml:"onlySync,attr"`
+	PersonalView         *bool   `xml:"personalView,attr"`
+	ShowComments         *string `xml:"showComments,attr"`
+	ShowFormulaBar       *bool   `xml:"showFormulaBar,attr"`
+	ShowHorizontalScroll *bool   `xml:"showHorizontalScroll,attr"`
+	ShowObjects          *string `xml:"showObjects,attr"`
+	ShowSheetTabs        *bool   `xml:"showSheetTabs,attr"`
+	ShowStatusbar        *bool   `xml:"showStatusbar,attr"`
+	ShowVerticalScroll   *bool   `xml:"showVerticalScroll,attr"`
+	TabRatio             *int    `xml:"tabRatio,attr"`
+	WindowHeight         *int    `xml:"windowHeight,attr"`
+	WindowWidth          *int    `xml:"windowWidth,attr"`
+	XWindow              *int    `xml:"xWindow,attr"`
+	YWindow              *int    `xml:"yWindow,attr"`
+}
+
+// DefinedName directly maps the name for a cell or cell range on a
+// worksheet.
+type DefinedName struct {
+	Name     string
+	Comment  string
+	RefersTo string
+	Scope    string
+}

+ 864 - 0
serves/excelExportGo/vendor/github.com/360EntSecGroup-Skylar/excelize/v2/xmlWorksheet.go

@@ -0,0 +1,864 @@
+// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
+// this source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+//
+// Package excelize providing a set of functions that allow you to write to
+// and read from XLSX / XLSM / XLTM files. Supports reading and writing
+// spreadsheet documents generated by Microsoft Exce™ 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.10 or later.
+
+package excelize
+
+import "encoding/xml"
+
+// xlsxWorksheet directly maps the worksheet element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main.
+type xlsxWorksheet struct {
+	XMLName               xml.Name                     `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main worksheet"`
+	SheetPr               *xlsxSheetPr                 `xml:"sheetPr"`
+	Dimension             *xlsxDimension               `xml:"dimension"`
+	SheetViews            *xlsxSheetViews              `xml:"sheetViews"`
+	SheetFormatPr         *xlsxSheetFormatPr           `xml:"sheetFormatPr"`
+	Cols                  *xlsxCols                    `xml:"cols"`
+	SheetData             xlsxSheetData                `xml:"sheetData"`
+	SheetCalcPr           *xlsxInnerXML                `xml:"sheetCalcPr"`
+	SheetProtection       *xlsxSheetProtection         `xml:"sheetProtection"`
+	ProtectedRanges       *xlsxInnerXML                `xml:"protectedRanges"`
+	Scenarios             *xlsxInnerXML                `xml:"scenarios"`
+	AutoFilter            *xlsxAutoFilter              `xml:"autoFilter"`
+	SortState             *xlsxSortState               `xml:"sortState"`
+	DataConsolidate       *xlsxInnerXML                `xml:"dataConsolidate"`
+	CustomSheetViews      *xlsxCustomSheetViews        `xml:"customSheetViews"`
+	MergeCells            *xlsxMergeCells              `xml:"mergeCells"`
+	PhoneticPr            *xlsxPhoneticPr              `xml:"phoneticPr"`
+	ConditionalFormatting []*xlsxConditionalFormatting `xml:"conditionalFormatting"`
+	DataValidations       *xlsxDataValidations         `xml:"dataValidations"`
+	Hyperlinks            *xlsxHyperlinks              `xml:"hyperlinks"`
+	PrintOptions          *xlsxPrintOptions            `xml:"printOptions"`
+	PageMargins           *xlsxPageMargins             `xml:"pageMargins"`
+	PageSetUp             *xlsxPageSetUp               `xml:"pageSetup"`
+	HeaderFooter          *xlsxHeaderFooter            `xml:"headerFooter"`
+	RowBreaks             *xlsxBreaks                  `xml:"rowBreaks"`
+	ColBreaks             *xlsxBreaks                  `xml:"colBreaks"`
+	CustomProperties      *xlsxInnerXML                `xml:"customProperties"`
+	CellWatches           *xlsxInnerXML                `xml:"cellWatches"`
+	IgnoredErrors         *xlsxInnerXML                `xml:"ignoredErrors"`
+	SmartTags             *xlsxInnerXML                `xml:"smartTags"`
+	Drawing               *xlsxDrawing                 `xml:"drawing"`
+	LegacyDrawing         *xlsxLegacyDrawing           `xml:"legacyDrawing"`
+	LegacyDrawingHF       *xlsxLegacyDrawingHF         `xml:"legacyDrawingHF"`
+	DrawingHF             *xlsxDrawingHF               `xml:"drawingHF"`
+	Picture               *xlsxPicture                 `xml:"picture"`
+	OleObjects            *xlsxInnerXML                `xml:"oleObjects"`
+	Controls              *xlsxInnerXML                `xml:"controls"`
+	WebPublishItems       *xlsxInnerXML                `xml:"webPublishItems"`
+	TableParts            *xlsxTableParts              `xml:"tableParts"`
+	ExtLst                *xlsxExtLst                  `xml:"extLst"`
+}
+
+// xlsxDrawing change r:id to rid in the namespace.
+type xlsxDrawing struct {
+	XMLName xml.Name `xml:"drawing"`
+	RID     string   `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
+}
+
+// xlsxHeaderFooter directly maps the headerFooter element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main - When printed or
+// viewed in page layout view (§18.18.69), each page of a worksheet can have a
+// page header, a page footer, or both. The headers and footers on odd-numbered
+// pages can differ from those on even-numbered pages, and the headers and
+// footers on the first page can differ from those on odd- and even-numbered
+// pages. In the latter case, the first page is not considered an odd page.
+type xlsxHeaderFooter struct {
+	XMLName          xml.Name       `xml:"headerFooter"`
+	AlignWithMargins bool           `xml:"alignWithMargins,attr,omitempty"`
+	DifferentFirst   bool           `xml:"differentFirst,attr,omitempty"`
+	DifferentOddEven bool           `xml:"differentOddEven,attr,omitempty"`
+	ScaleWithDoc     bool           `xml:"scaleWithDoc,attr,omitempty"`
+	OddHeader        string         `xml:"oddHeader,omitempty"`
+	OddFooter        string         `xml:"oddFooter,omitempty"`
+	EvenHeader       string         `xml:"evenHeader,omitempty"`
+	EvenFooter       string         `xml:"evenFooter,omitempty"`
+	FirstFooter      string         `xml:"firstFooter,omitempty"`
+	FirstHeader      string         `xml:"firstHeader,omitempty"`
+	DrawingHF        *xlsxDrawingHF `xml:"drawingHF"`
+}
+
+// xlsxDrawingHF (Drawing Reference in Header Footer) specifies the usage of
+// drawing objects to be rendered in the headers and footers of the sheet. It
+// specifies an explicit relationship to the part containing the DrawingML
+// shapes used in the headers and footers. It also indicates where in the
+// headers and footers each shape belongs. One drawing object can appear in
+// each of the left section, center section and right section of a header and
+// a footer.
+type xlsxDrawingHF struct {
+	Content string `xml:",innerxml"`
+}
+
+// xlsxPageSetUp directly maps the pageSetup element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main - Page setup
+// settings for the worksheet.
+type xlsxPageSetUp struct {
+	XMLName            xml.Name `xml:"pageSetup"`
+	BlackAndWhite      bool     `xml:"blackAndWhite,attr,omitempty"`
+	CellComments       string   `xml:"cellComments,attr,omitempty"`
+	Copies             int      `xml:"copies,attr,omitempty"`
+	Draft              bool     `xml:"draft,attr,omitempty"`
+	Errors             string   `xml:"errors,attr,omitempty"`
+	FirstPageNumber    int      `xml:"firstPageNumber,attr,omitempty"`
+	FitToHeight        int      `xml:"fitToHeight,attr,omitempty"`
+	FitToWidth         int      `xml:"fitToWidth,attr,omitempty"`
+	HorizontalDPI      int      `xml:"horizontalDpi,attr,omitempty"`
+	RID                string   `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
+	Orientation        string   `xml:"orientation,attr,omitempty"`
+	PageOrder          string   `xml:"pageOrder,attr,omitempty"`
+	PaperHeight        string   `xml:"paperHeight,attr,omitempty"`
+	PaperSize          int      `xml:"paperSize,attr,omitempty"`
+	PaperWidth         string   `xml:"paperWidth,attr,omitempty"`
+	Scale              int      `xml:"scale,attr,omitempty"`
+	UseFirstPageNumber bool     `xml:"useFirstPageNumber,attr,omitempty"`
+	UsePrinterDefaults bool     `xml:"usePrinterDefaults,attr,omitempty"`
+	VerticalDPI        int      `xml:"verticalDpi,attr,omitempty"`
+}
+
+// xlsxPrintOptions directly maps the printOptions element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main - Print options for
+// the sheet. Printer-specific settings are stored separately in the Printer
+// Settings part.
+type xlsxPrintOptions struct {
+	XMLName            xml.Name `xml:"printOptions"`
+	GridLines          bool     `xml:"gridLines,attr,omitempty"`
+	GridLinesSet       bool     `xml:"gridLinesSet,attr,omitempty"`
+	Headings           bool     `xml:"headings,attr,omitempty"`
+	HorizontalCentered bool     `xml:"horizontalCentered,attr,omitempty"`
+	VerticalCentered   bool     `xml:"verticalCentered,attr,omitempty"`
+}
+
+// xlsxPageMargins directly maps the pageMargins element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main - Page margins for
+// a sheet or a custom sheet view.
+type xlsxPageMargins struct {
+	XMLName xml.Name `xml:"pageMargins"`
+	Bottom  float64  `xml:"bottom,attr"`
+	Footer  float64  `xml:"footer,attr"`
+	Header  float64  `xml:"header,attr"`
+	Left    float64  `xml:"left,attr"`
+	Right   float64  `xml:"right,attr"`
+	Top     float64  `xml:"top,attr"`
+}
+
+// xlsxSheetFormatPr directly maps the sheetFormatPr element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main. This element
+// specifies the sheet formatting properties.
+type xlsxSheetFormatPr struct {
+	XMLName          xml.Name `xml:"sheetFormatPr"`
+	BaseColWidth     uint8    `xml:"baseColWidth,attr,omitempty"`
+	DefaultColWidth  float64  `xml:"defaultColWidth,attr,omitempty"`
+	DefaultRowHeight float64  `xml:"defaultRowHeight,attr"`
+	CustomHeight     bool     `xml:"customHeight,attr,omitempty"`
+	ZeroHeight       bool     `xml:"zeroHeight,attr,omitempty"`
+	ThickTop         bool     `xml:"thickTop,attr,omitempty"`
+	ThickBottom      bool     `xml:"thickBottom,attr,omitempty"`
+	OutlineLevelRow  uint8    `xml:"outlineLevelRow,attr,omitempty"`
+	OutlineLevelCol  uint8    `xml:"outlineLevelCol,attr,omitempty"`
+}
+
+// xlsxSheetViews represents worksheet views collection.
+type xlsxSheetViews struct {
+	XMLName   xml.Name        `xml:"sheetViews"`
+	SheetView []xlsxSheetView `xml:"sheetView"`
+}
+
+// xlsxSheetView represents a single sheet view definition. When more than one
+// sheet view is defined in the file, it means that when opening the workbook,
+// each sheet view corresponds to a separate window within the spreadsheet
+// application, where each window is showing the particular sheet containing
+// the same workbookViewId value, the 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.
+type xlsxSheetView struct {
+	WindowProtection         bool             `xml:"windowProtection,attr,omitempty"`
+	ShowFormulas             bool             `xml:"showFormulas,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"`
+	View                     string           `xml:"view,attr,omitempty"`
+	TopLeftCell              string           `xml:"topLeftCell,attr,omitempty"`
+	ColorID                  int              `xml:"colorId,attr,omitempty"`
+	ZoomScale                float64          `xml:"zoomScale,attr,omitempty"`
+	ZoomScaleNormal          float64          `xml:"zoomScaleNormal,attr,omitempty"`
+	ZoomScalePageLayoutView  float64          `xml:"zoomScalePageLayoutView,attr,omitempty"`
+	ZoomScaleSheetLayoutView float64          `xml:"zoomScaleSheetLayoutView,attr,omitempty"`
+	WorkbookViewID           int              `xml:"workbookViewId,attr"`
+	Pane                     *xlsxPane        `xml:"pane,omitempty"`
+	Selection                []*xlsxSelection `xml:"selection"`
+}
+
+// xlsxSelection directly maps the selection element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main - Worksheet view
+// selection.
+type xlsxSelection struct {
+	ActiveCell   string `xml:"activeCell,attr,omitempty"`
+	ActiveCellID *int   `xml:"activeCellId,attr"`
+	Pane         string `xml:"pane,attr,omitempty"`
+	SQRef        string `xml:"sqref,attr,omitempty"`
+}
+
+// xlsxSelection directly maps the selection element. Worksheet view pane.
+type xlsxPane struct {
+	ActivePane  string  `xml:"activePane,attr,omitempty"`
+	State       string  `xml:"state,attr,omitempty"` // Either "split" or "frozen"
+	TopLeftCell string  `xml:"topLeftCell,attr,omitempty"`
+	XSplit      float64 `xml:"xSplit,attr,omitempty"`
+	YSplit      float64 `xml:"ySplit,attr,omitempty"`
+}
+
+// xlsxSheetPr directly maps the sheetPr element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main - Sheet-level
+// properties.
+type xlsxSheetPr struct {
+	XMLName                           xml.Name         `xml:"sheetPr"`
+	SyncHorizontal                    bool             `xml:"syncHorizontal,attr,omitempty"`
+	SyncVertical                      bool             `xml:"syncVertical,attr,omitempty"`
+	SyncRef                           string           `xml:"syncRef,attr,omitempty"`
+	TransitionEvaluation              bool             `xml:"transitionEvaluation,attr,omitempty"`
+	Published                         *bool            `xml:"published,attr"`
+	CodeName                          string           `xml:"codeName,attr,omitempty"`
+	FilterMode                        bool             `xml:"filterMode,attr,omitempty"`
+	EnableFormatConditionsCalculation *bool            `xml:"enableFormatConditionsCalculation,attr"`
+	TransitionEntry                   bool             `xml:"transitionEntry,attr,omitempty"`
+	TabColor                          *xlsxTabColor    `xml:"tabColor,omitempty"`
+	OutlinePr                         *xlsxOutlinePr   `xml:"outlinePr,omitempty"`
+	PageSetUpPr                       *xlsxPageSetUpPr `xml:"pageSetUpPr,omitempty"`
+}
+
+// xlsxOutlinePr maps to the outlinePr element. SummaryBelow allows you to
+// adjust the direction of grouper controls.
+type xlsxOutlinePr struct {
+	SummaryBelow bool `xml:"summaryBelow,attr"`
+}
+
+// xlsxPageSetUpPr expresses page setup properties of the worksheet.
+type xlsxPageSetUpPr struct {
+	AutoPageBreaks bool `xml:"autoPageBreaks,attr,omitempty"`
+	FitToPage      bool `xml:"fitToPage,attr,omitempty"`
+}
+
+// xlsxTabColor represents background color of the sheet tab.
+type xlsxTabColor struct {
+	RGB   string  `xml:"rgb,attr,omitempty"`
+	Theme int     `xml:"theme,attr,omitempty"`
+	Tint  float64 `xml:"tint,attr,omitempty"`
+}
+
+// xlsxCols defines column width and column formatting for one or more columns
+// of the worksheet.
+type xlsxCols struct {
+	XMLName xml.Name  `xml:"cols"`
+	Col     []xlsxCol `xml:"col"`
+}
+
+// xlsxCol directly maps the col (Column Width & Formatting). Defines column
+// width and column formatting for one or more columns of the worksheet.
+type xlsxCol struct {
+	BestFit      bool    `xml:"bestFit,attr,omitempty"`
+	Collapsed    bool    `xml:"collapsed,attr,omitempty"`
+	CustomWidth  bool    `xml:"customWidth,attr,omitempty"`
+	Hidden       bool    `xml:"hidden,attr,omitempty"`
+	Max          int     `xml:"max,attr"`
+	Min          int     `xml:"min,attr"`
+	OutlineLevel uint8   `xml:"outlineLevel,attr,omitempty"`
+	Phonetic     bool    `xml:"phonetic,attr,omitempty"`
+	Style        int     `xml:"style,attr,omitempty"`
+	Width        float64 `xml:"width,attr,omitempty"`
+}
+
+// xlsxDimension directly maps the dimension element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main - This element
+// specifies the used range of the worksheet. It specifies the row and column
+// bounds of used cells in the worksheet. This is optional and is not
+// required. Used cells include cells with formulas, text content, and cell
+// formatting. When an entire column is formatted, only the first cell in that
+// column is considered used.
+type xlsxDimension struct {
+	XMLName xml.Name `xml:"dimension"`
+	Ref     string   `xml:"ref,attr"`
+}
+
+// xlsxSheetData collection represents the cell table itself. This collection
+// expresses information about each cell, grouped together by rows in the
+// worksheet.
+type xlsxSheetData struct {
+	XMLName xml.Name  `xml:"sheetData"`
+	Row     []xlsxRow `xml:"row"`
+}
+
+// xlsxRow directly maps the row element. The element expresses information
+// about an entire row of a worksheet, and contains all cell definitions for a
+// particular row in the worksheet.
+type xlsxRow struct {
+	Collapsed    bool    `xml:"collapsed,attr,omitempty"`
+	CustomFormat bool    `xml:"customFormat,attr,omitempty"`
+	CustomHeight bool    `xml:"customHeight,attr,omitempty"`
+	Hidden       bool    `xml:"hidden,attr,omitempty"`
+	Ht           float64 `xml:"ht,attr,omitempty"`
+	OutlineLevel uint8   `xml:"outlineLevel,attr,omitempty"`
+	Ph           bool    `xml:"ph,attr,omitempty"`
+	R            int     `xml:"r,attr,omitempty"`
+	S            int     `xml:"s,attr,omitempty"`
+	Spans        string  `xml:"spans,attr,omitempty"`
+	ThickBot     bool    `xml:"thickBot,attr,omitempty"`
+	ThickTop     bool    `xml:"thickTop,attr,omitempty"`
+	C            []xlsxC `xml:"c"`
+}
+
+// xlsxSortState directly maps the sortState element. This collection
+// preserves the AutoFilter sort state.
+type xlsxSortState struct {
+	ColumnSort    bool   `xml:"columnSort,attr,omitempty"`
+	CaseSensitive bool   `xml:"caseSensitive,attr,omitempty"`
+	SortMethod    string `xml:"sortMethod,attr,omitempty"`
+	Ref           string `xml:"ref,attr"`
+	Content       string `xml:",innerxml"`
+}
+
+// xlsxCustomSheetViews directly maps the customSheetViews element. This is a
+// collection of custom sheet views.
+type xlsxCustomSheetViews struct {
+	XMLName         xml.Name               `xml:"customSheetViews"`
+	CustomSheetView []*xlsxCustomSheetView `xml:"customSheetView"`
+}
+
+// xlsxBrk directly maps the row or column break to use when paginating a
+// worksheet.
+type xlsxBrk struct {
+	ID  int  `xml:"id,attr,omitempty"`
+	Min int  `xml:"min,attr,omitempty"`
+	Max int  `xml:"max,attr,omitempty"`
+	Man bool `xml:"man,attr,omitempty"`
+	Pt  bool `xml:"pt,attr,omitempty"`
+}
+
+// xlsxBreaks directly maps a collection of the row or column breaks.
+type xlsxBreaks struct {
+	Brk              []*xlsxBrk `xml:"brk"`
+	Count            int        `xml:"count,attr,omitempty"`
+	ManualBreakCount int        `xml:"manualBreakCount,attr,omitempty"`
+}
+
+// xlsxCustomSheetView directly maps the customSheetView element.
+type xlsxCustomSheetView struct {
+	Pane           *xlsxPane         `xml:"pane"`
+	Selection      *xlsxSelection    `xml:"selection"`
+	RowBreaks      *xlsxBreaks       `xml:"rowBreaks"`
+	ColBreaks      *xlsxBreaks       `xml:"colBreaks"`
+	PageMargins    *xlsxPageMargins  `xml:"pageMargins"`
+	PrintOptions   *xlsxPrintOptions `xml:"printOptions"`
+	PageSetup      *xlsxPageSetUp    `xml:"pageSetup"`
+	HeaderFooter   *xlsxHeaderFooter `xml:"headerFooter"`
+	AutoFilter     *xlsxAutoFilter   `xml:"autoFilter"`
+	ExtLst         *xlsxExtLst       `xml:"extLst"`
+	GUID           string            `xml:"guid,attr"`
+	Scale          int               `xml:"scale,attr,omitempty"`
+	ColorID        int               `xml:"colorId,attr,omitempty"`
+	ShowPageBreaks bool              `xml:"showPageBreaks,attr,omitempty"`
+	ShowFormulas   bool              `xml:"showFormulas,attr,omitempty"`
+	ShowGridLines  bool              `xml:"showGridLines,attr,omitempty"`
+	ShowRowCol     bool              `xml:"showRowCol,attr,omitempty"`
+	OutlineSymbols bool              `xml:"outlineSymbols,attr,omitempty"`
+	ZeroValues     bool              `xml:"zeroValues,attr,omitempty"`
+	FitToPage      bool              `xml:"fitToPage,attr,omitempty"`
+	PrintArea      bool              `xml:"printArea,attr,omitempty"`
+	Filter         bool              `xml:"filter,attr,omitempty"`
+	ShowAutoFilter bool              `xml:"showAutoFilter,attr,omitempty"`
+	HiddenRows     bool              `xml:"hiddenRows,attr,omitempty"`
+	HiddenColumns  bool              `xml:"hiddenColumns,attr,omitempty"`
+	State          string            `xml:"state,attr,omitempty"`
+	FilterUnique   bool              `xml:"filterUnique,attr,omitempty"`
+	View           string            `xml:"view,attr,omitempty"`
+	ShowRuler      bool              `xml:"showRuler,attr,omitempty"`
+	TopLeftCell    string            `xml:"topLeftCell,attr,omitempty"`
+}
+
+// xlsxMergeCell directly maps the mergeCell element. A single merged cell.
+type xlsxMergeCell struct {
+	Ref string `xml:"ref,attr,omitempty"`
+}
+
+// xlsxMergeCells directly maps the mergeCells element. This collection
+// expresses all the merged cells in the sheet.
+type xlsxMergeCells struct {
+	XMLName xml.Name         `xml:"mergeCells"`
+	Count   int              `xml:"count,attr,omitempty"`
+	Cells   []*xlsxMergeCell `xml:"mergeCell,omitempty"`
+}
+
+// xlsxDataValidations expresses all data validation information for cells in a
+// sheet which have data validation features applied.
+type xlsxDataValidations struct {
+	XMLName        xml.Name          `xml:"dataValidations"`
+	Count          int               `xml:"count,attr,omitempty"`
+	DisablePrompts bool              `xml:"disablePrompts,attr,omitempty"`
+	XWindow        int               `xml:"xWindow,attr,omitempty"`
+	YWindow        int               `xml:"yWindow,attr,omitempty"`
+	DataValidation []*DataValidation `xml:"dataValidation"`
+}
+
+// DataValidation directly maps the a single item of data validation defined
+// on a range of the worksheet.
+type DataValidation struct {
+	AllowBlank       bool    `xml:"allowBlank,attr"`
+	Error            *string `xml:"error,attr"`
+	ErrorStyle       *string `xml:"errorStyle,attr"`
+	ErrorTitle       *string `xml:"errorTitle,attr"`
+	Operator         string  `xml:"operator,attr,omitempty"`
+	Prompt           *string `xml:"prompt,attr"`
+	PromptTitle      *string `xml:"promptTitle,attr"`
+	ShowDropDown     bool    `xml:"showDropDown,attr,omitempty"`
+	ShowErrorMessage bool    `xml:"showErrorMessage,attr,omitempty"`
+	ShowInputMessage bool    `xml:"showInputMessage,attr,omitempty"`
+	Sqref            string  `xml:"sqref,attr"`
+	Type             string  `xml:"type,attr,omitempty"`
+	Formula1         string  `xml:",innerxml"`
+	Formula2         string  `xml:",innerxml"`
+}
+
+// xlsxC collection represents a cell in the worksheet. Information about the
+// cell's location (reference), value, data type, formatting, and formula is
+// expressed here.
+//
+// This simple type is restricted to the values listed in the following table:
+//
+//      Enumeration Value         | Description
+//     ---------------------------+---------------------------------
+//      b (Boolean)               | Cell containing a boolean.
+//      d (Date)                  | Cell contains a date in the ISO 8601 format.
+//      e (Error)                 | Cell containing an error.
+//      inlineStr (Inline String) | Cell containing an (inline) rich string, i.e., one not in the shared string table. If this cell type is used, then the cell value is in the is element rather than the v element in the cell (c element).
+//      n (Number)                | Cell containing a number.
+//      s (Shared String)         | Cell containing a shared string.
+//      str (String)              | Cell containing a formula string.
+//
+type xlsxC struct {
+	XMLName  xml.Name `xml:"c"`
+	XMLSpace xml.Attr `xml:"space,attr,omitempty"`
+	R        string   `xml:"r,attr,omitempty"` // Cell ID, e.g. A1
+	S        int      `xml:"s,attr,omitempty"` // Style reference.
+	// Str string `xml:"str,attr,omitempty"` // Style reference.
+	T  string  `xml:"t,attr,omitempty"` // Type.
+	F  *xlsxF  `xml:"f,omitempty"`      // Formula
+	V  string  `xml:"v,omitempty"`      // Value
+	IS *xlsxSI `xml:"is"`
+}
+
+func (c *xlsxC) hasValue() bool {
+	return c.S != 0 || c.V != "" || c.F != nil || c.T != ""
+}
+
+// xlsxF represents a formula for the cell. The formula expression is
+// contained in the character node of this element.
+type xlsxF struct {
+	Content string `xml:",chardata"`
+	T       string `xml:"t,attr,omitempty"`   // Formula type
+	Ref     string `xml:"ref,attr,omitempty"` // Shared formula ref
+	Si      string `xml:"si,attr,omitempty"`  // Shared formula index
+}
+
+// xlsxSheetProtection collection expresses the sheet protection options to
+// enforce when the sheet is protected.
+type xlsxSheetProtection struct {
+	XMLName             xml.Name `xml:"sheetProtection"`
+	AlgorithmName       string   `xml:"algorithmName,attr,omitempty"`
+	Password            string   `xml:"password,attr,omitempty"`
+	HashValue           string   `xml:"hashValue,attr,omitempty"`
+	SaltValue           string   `xml:"saltValue,attr,omitempty"`
+	SpinCount           int      `xml:"spinCount,attr,omitempty"`
+	Sheet               bool     `xml:"sheet,attr"`
+	Objects             bool     `xml:"objects,attr"`
+	Scenarios           bool     `xml:"scenarios,attr"`
+	FormatCells         bool     `xml:"formatCells,attr"`
+	FormatColumns       bool     `xml:"formatColumns,attr"`
+	FormatRows          bool     `xml:"formatRows,attr"`
+	InsertColumns       bool     `xml:"insertColumns,attr"`
+	InsertRows          bool     `xml:"insertRows,attr"`
+	InsertHyperlinks    bool     `xml:"insertHyperlinks,attr"`
+	DeleteColumns       bool     `xml:"deleteColumns,attr"`
+	DeleteRows          bool     `xml:"deleteRows,attr"`
+	SelectLockedCells   bool     `xml:"selectLockedCells,attr"`
+	Sort                bool     `xml:"sort,attr"`
+	AutoFilter          bool     `xml:"autoFilter,attr"`
+	PivotTables         bool     `xml:"pivotTables,attr"`
+	SelectUnlockedCells bool     `xml:"selectUnlockedCells,attr"`
+}
+
+// xlsxPhoneticPr (Phonetic Properties) represents a collection of phonetic
+// properties that affect the display of phonetic text for this String Item
+// (si). Phonetic text is used to give hints as to the pronunciation of an East
+// Asian language, and the hints are displayed as text within the spreadsheet
+// cells across the top portion of the cell. Since the phonetic hints are text,
+// every phonetic hint is expressed as a phonetic run (rPh), and these
+// properties specify how to display that phonetic run.
+type xlsxPhoneticPr struct {
+	XMLName   xml.Name `xml:"phoneticPr"`
+	Alignment string   `xml:"alignment,attr,omitempty"`
+	FontID    *int     `xml:"fontId,attr"`
+	Type      string   `xml:"type,attr,omitempty"`
+}
+
+// A Conditional Format is a format, such as cell shading or font color, that a
+// spreadsheet application can automatically apply to cells if a specified
+// condition is true. This collection expresses conditional formatting rules
+// applied to a particular cell or range.
+type xlsxConditionalFormatting struct {
+	XMLName xml.Name      `xml:"conditionalFormatting"`
+	SQRef   string        `xml:"sqref,attr,omitempty"`
+	CfRule  []*xlsxCfRule `xml:"cfRule"`
+}
+
+// xlsxCfRule (Conditional Formatting Rule) represents a description of a
+// conditional formatting rule.
+type xlsxCfRule struct {
+	AboveAverage *bool           `xml:"aboveAverage,attr"`
+	Bottom       bool            `xml:"bottom,attr,omitempty"`
+	DxfID        *int            `xml:"dxfId,attr"`
+	EqualAverage bool            `xml:"equalAverage,attr,omitempty"`
+	Operator     string          `xml:"operator,attr,omitempty"`
+	Percent      bool            `xml:"percent,attr,omitempty"`
+	Priority     int             `xml:"priority,attr,omitempty"`
+	Rank         int             `xml:"rank,attr,omitempty"`
+	StdDev       int             `xml:"stdDev,attr,omitempty"`
+	StopIfTrue   bool            `xml:"stopIfTrue,attr,omitempty"`
+	Text         string          `xml:"text,attr,omitempty"`
+	TimePeriod   string          `xml:"timePeriod,attr,omitempty"`
+	Type         string          `xml:"type,attr,omitempty"`
+	Formula      []string        `xml:"formula,omitempty"`
+	ColorScale   *xlsxColorScale `xml:"colorScale"`
+	DataBar      *xlsxDataBar    `xml:"dataBar"`
+	IconSet      *xlsxIconSet    `xml:"iconSet"`
+	ExtLst       *xlsxExtLst     `xml:"extLst"`
+}
+
+// xlsxColorScale (Color Scale) describes a gradated color scale in this
+// conditional formatting rule.
+type xlsxColorScale struct {
+	Cfvo  []*xlsxCfvo  `xml:"cfvo"`
+	Color []*xlsxColor `xml:"color"`
+}
+
+// dataBar (Data Bar) describes a data bar conditional formatting rule.
+type xlsxDataBar struct {
+	MaxLength int          `xml:"maxLength,attr,omitempty"`
+	MinLength int          `xml:"minLength,attr,omitempty"`
+	ShowValue bool         `xml:"showValue,attr,omitempty"`
+	Cfvo      []*xlsxCfvo  `xml:"cfvo"`
+	Color     []*xlsxColor `xml:"color"`
+}
+
+// xlsxIconSet (Icon Set) describes an icon set conditional formatting rule.
+type xlsxIconSet struct {
+	Cfvo      []*xlsxCfvo `xml:"cfvo"`
+	IconSet   string      `xml:"iconSet,attr,omitempty"`
+	ShowValue bool        `xml:"showValue,attr,omitempty"`
+	Percent   bool        `xml:"percent,attr,omitempty"`
+	Reverse   bool        `xml:"reverse,attr,omitempty"`
+}
+
+// cfvo (Conditional Format Value Object) describes the values of the
+// interpolation points in a gradient scale.
+type xlsxCfvo struct {
+	Gte    bool        `xml:"gte,attr,omitempty"`
+	Type   string      `xml:"type,attr,omitempty"`
+	Val    string      `xml:"val,attr,omitempty"`
+	ExtLst *xlsxExtLst `xml:"extLst"`
+}
+
+// xlsxHyperlinks directly maps the hyperlinks element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main - A hyperlink can
+// be stored in a package as a relationship. Hyperlinks shall be identified by
+// containing a target which specifies the destination of the given hyperlink.
+type xlsxHyperlinks struct {
+	XMLName   xml.Name        `xml:"hyperlinks"`
+	Hyperlink []xlsxHyperlink `xml:"hyperlink"`
+}
+
+// xlsxHyperlink directly maps the hyperlink element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main
+type xlsxHyperlink struct {
+	Ref      string `xml:"ref,attr"`
+	Location string `xml:"location,attr,omitempty"`
+	Display  string `xml:"display,attr,omitempty"`
+	RID      string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
+}
+
+// xlsxTableParts directly maps the tableParts element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main - The table element
+// has several attributes applied to identify the table and the data range it
+// covers. The table id attribute needs to be unique across all table parts, the
+// same goes for the name and displayName. The displayName has the further
+// restriction that it must be unique across all defined names in the workbook.
+// Later on we will see that you can define names for many elements, such as
+// cells or formulas. The name value is used for the object model in Microsoft
+// Office Excel. The displayName is used for references in formulas. The ref
+// attribute is used to identify the cell range that the table covers. This
+// includes not only the table data, but also the table header containing column
+// names.
+// To add columns to your table you add new tableColumn elements to the
+// tableColumns container. Similar to the shared string table the collection
+// keeps a count attribute identifying the number of columns. Besides the table
+// definition in the table part there is also the need to identify which tables
+// are displayed in the worksheet. The worksheet part has a separate element
+// tableParts to store this information. Each table part is referenced through
+// the relationship ID and again a count of the number of table parts is
+// maintained. The following markup sample is taken from the documents
+// accompanying this book. The sheet data element has been removed to reduce the
+// size of the sample. To reference the table, just add the tableParts element,
+// of course after having created and stored the table part. For example:
+//
+//    <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
+//        ...
+//        <tableParts count="1">
+// 		      <tablePart r:id="rId1" />
+//        </tableParts>
+//    </worksheet>
+//
+type xlsxTableParts struct {
+	XMLName    xml.Name         `xml:"tableParts"`
+	Count      int              `xml:"count,attr,omitempty"`
+	TableParts []*xlsxTablePart `xml:"tablePart"`
+}
+
+// xlsxTablePart directly maps the tablePart element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main
+type xlsxTablePart struct {
+	RID string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
+}
+
+// xlsxPicture directly maps the picture element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main - Background sheet
+// image. For example:
+//
+//    <picture r:id="rId1"/>
+//
+type xlsxPicture struct {
+	XMLName xml.Name `xml:"picture"`
+	RID     string   `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
+}
+
+// xlsxLegacyDrawing directly maps the legacyDrawing element in the namespace
+// http://schemas.openxmlformats.org/spreadsheetml/2006/main - A comment is a
+// rich text note that is attached to, and associated with, a cell, separate
+// from other cell content. Comment content is stored separate from the cell,
+// and is displayed in a drawing object (like a text box) that is separate from,
+// but associated with, a cell. Comments are used as reminders, such as noting
+// how a complex formula works, or to provide feedback to other users. Comments
+// can also be used to explain assumptions made in a formula or to call out
+// something special about the cell.
+type xlsxLegacyDrawing struct {
+	XMLName xml.Name `xml:"legacyDrawing"`
+	RID     string   `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
+}
+
+// xlsxLegacyDrawingHF specifies the explicit relationship to the part
+// containing the VML defining pictures rendered in the header / footer of the
+// sheet.
+type xlsxLegacyDrawingHF struct {
+	XMLName xml.Name `xml:"legacyDrawingHF"`
+	RID     string   `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
+}
+
+type xlsxInnerXML struct {
+	Content string `xml:",innerxml"`
+}
+
+// xlsxWorksheetExt directly maps the ext element in the worksheet.
+type xlsxWorksheetExt struct {
+	XMLName xml.Name `xml:"ext"`
+	URI     string   `xml:"uri,attr"`
+	Content string   `xml:",innerxml"`
+}
+
+// decodeWorksheetExt directly maps the ext element.
+type decodeWorksheetExt struct {
+	XMLName xml.Name            `xml:"extLst"`
+	Ext     []*xlsxWorksheetExt `xml:"ext"`
+}
+
+// decodeX14SparklineGroups directly maps the sparklineGroups element.
+type decodeX14SparklineGroups struct {
+	XMLName xml.Name `xml:"sparklineGroups"`
+	XMLNSXM string   `xml:"xmlns:xm,attr"`
+	Content string   `xml:",innerxml"`
+}
+
+// xlsxX14SparklineGroups directly maps the sparklineGroups element.
+type xlsxX14SparklineGroups struct {
+	XMLName         xml.Name                 `xml:"x14:sparklineGroups"`
+	XMLNSXM         string                   `xml:"xmlns:xm,attr"`
+	SparklineGroups []*xlsxX14SparklineGroup `xml:"x14:sparklineGroup"`
+	Content         string                   `xml:",innerxml"`
+}
+
+// xlsxX14SparklineGroup directly maps the sparklineGroup element.
+type xlsxX14SparklineGroup struct {
+	XMLName             xml.Name          `xml:"x14:sparklineGroup"`
+	ManualMax           int               `xml:"manualMax,attr,omitempty"`
+	ManualMin           int               `xml:"manualMin,attr,omitempty"`
+	LineWeight          float64           `xml:"lineWeight,attr,omitempty"`
+	Type                string            `xml:"type,attr,omitempty"`
+	DateAxis            bool              `xml:"dateAxis,attr,omitempty"`
+	DisplayEmptyCellsAs string            `xml:"displayEmptyCellsAs,attr,omitempty"`
+	Markers             bool              `xml:"markers,attr,omitempty"`
+	High                bool              `xml:"high,attr,omitempty"`
+	Low                 bool              `xml:"low,attr,omitempty"`
+	First               bool              `xml:"first,attr,omitempty"`
+	Last                bool              `xml:"last,attr,omitempty"`
+	Negative            bool              `xml:"negative,attr,omitempty"`
+	DisplayXAxis        bool              `xml:"displayXAxis,attr,omitempty"`
+	DisplayHidden       bool              `xml:"displayHidden,attr,omitempty"`
+	MinAxisType         string            `xml:"minAxisType,attr,omitempty"`
+	MaxAxisType         string            `xml:"maxAxisType,attr,omitempty"`
+	RightToLeft         bool              `xml:"rightToLeft,attr,omitempty"`
+	ColorSeries         *xlsxTabColor     `xml:"x14:colorSeries"`
+	ColorNegative       *xlsxTabColor     `xml:"x14:colorNegative"`
+	ColorAxis           *xlsxColor        `xml:"x14:colorAxis"`
+	ColorMarkers        *xlsxTabColor     `xml:"x14:colorMarkers"`
+	ColorFirst          *xlsxTabColor     `xml:"x14:colorFirst"`
+	ColorLast           *xlsxTabColor     `xml:"x14:colorLast"`
+	ColorHigh           *xlsxTabColor     `xml:"x14:colorHigh"`
+	ColorLow            *xlsxTabColor     `xml:"x14:colorLow"`
+	Sparklines          xlsxX14Sparklines `xml:"x14:sparklines"`
+}
+
+// xlsxX14Sparklines directly maps the sparklines element.
+type xlsxX14Sparklines struct {
+	Sparkline []*xlsxX14Sparkline `xml:"x14:sparkline"`
+}
+
+// xlsxX14Sparkline directly maps the sparkline element.
+type xlsxX14Sparkline struct {
+	F     string `xml:"xm:f"`
+	Sqref string `xml:"xm:sqref"`
+}
+
+// SparklineOption directly maps the settings of the sparkline.
+type SparklineOption struct {
+	Location      []string
+	Range         []string
+	Max           int
+	CustMax       int
+	Min           int
+	CustMin       int
+	Type          string
+	Weight        float64
+	DateAxis      bool
+	Markers       bool
+	High          bool
+	Low           bool
+	First         bool
+	Last          bool
+	Negative      bool
+	Axis          bool
+	Hidden        bool
+	Reverse       bool
+	Style         int
+	SeriesColor   string
+	NegativeColor string
+	MarkersColor  string
+	FirstColor    string
+	LastColor     string
+	HightColor    string
+	LowColor      string
+	EmptyCells    string
+}
+
+// formatPanes directly maps the settings of the panes.
+type formatPanes struct {
+	Freeze      bool   `json:"freeze"`
+	Split       bool   `json:"split"`
+	XSplit      int    `json:"x_split"`
+	YSplit      int    `json:"y_split"`
+	TopLeftCell string `json:"top_left_cell"`
+	ActivePane  string `json:"active_pane"`
+	Panes       []struct {
+		SQRef      string `json:"sqref"`
+		ActiveCell string `json:"active_cell"`
+		Pane       string `json:"pane"`
+	} `json:"panes"`
+}
+
+// formatConditional directly maps the conditional format settings of the cells.
+type formatConditional struct {
+	Type         string `json:"type"`
+	AboveAverage bool   `json:"above_average"`
+	Percent      bool   `json:"percent"`
+	Format       int    `json:"format"`
+	Criteria     string `json:"criteria"`
+	Value        string `json:"value,omitempty"`
+	Minimum      string `json:"minimum,omitempty"`
+	Maximum      string `json:"maximum,omitempty"`
+	MinType      string `json:"min_type,omitempty"`
+	MidType      string `json:"mid_type,omitempty"`
+	MaxType      string `json:"max_type,omitempty"`
+	MinValue     string `json:"min_value,omitempty"`
+	MidValue     string `json:"mid_value,omitempty"`
+	MaxValue     string `json:"max_value,omitempty"`
+	MinColor     string `json:"min_color,omitempty"`
+	MidColor     string `json:"mid_color,omitempty"`
+	MaxColor     string `json:"max_color,omitempty"`
+	MinLength    string `json:"min_length,omitempty"`
+	MaxLength    string `json:"max_length,omitempty"`
+	MultiRange   string `json:"multi_range,omitempty"`
+	BarColor     string `json:"bar_color,omitempty"`
+}
+
+// FormatSheetProtection directly maps the settings of worksheet protection.
+type FormatSheetProtection struct {
+	AutoFilter          bool
+	DeleteColumns       bool
+	DeleteRows          bool
+	EditObjects         bool
+	EditScenarios       bool
+	FormatCells         bool
+	FormatColumns       bool
+	FormatRows          bool
+	InsertColumns       bool
+	InsertHyperlinks    bool
+	InsertRows          bool
+	Password            string
+	PivotTables         bool
+	SelectLockedCells   bool
+	SelectUnlockedCells bool
+	Sort                bool
+}
+
+// FormatHeaderFooter directly maps the settings of header and footer.
+type FormatHeaderFooter struct {
+	AlignWithMargins bool
+	DifferentFirst   bool
+	DifferentOddEven bool
+	ScaleWithDoc     bool
+	OddHeader        string
+	OddFooter        string
+	EvenHeader       string
+	EvenFooter       string
+	FirstFooter      string
+	FirstHeader      string
+}
+
+// FormatPageMargins directly maps the settings of page margins
+type FormatPageMargins struct {
+	Bottom string
+	Footer string
+	Header string
+	Left   string
+	Right  string
+	Top    string
+}

+ 1 - 0
serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/.gitignore

@@ -0,0 +1 @@
+.vscode/

+ 18 - 0
serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/.travis.yml

@@ -0,0 +1,18 @@
+language: go
+sudo: false
+go:
+  - "1.7.x"
+  - "1.8.x"
+  - "1.9.x"
+  - "1.10.x"
+  - "1.11.x"
+  - "1.12.x"
+  - "1.13.x"
+  - "tip"
+
+before_install:
+  - go get github.com/mattn/goveralls
+  - go get golang.org/x/tools/cmd/cover
+
+script:
+  - goveralls -service=travis-ci

+ 48 - 0
serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/CHANGELOG.md

@@ -0,0 +1,48 @@
+# Changelog
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [0.5.0] - 2020-01-03
+
+### Changed
+- Remove the dependency on github.com/kr/logfmt by [@ChrisHines]
+- Move fuzz code to github.com/go-logfmt/fuzzlogfmt by [@ChrisHines]
+
+## [0.4.0] - 2018-11-21
+
+### Added
+- Go module support by [@ChrisHines]
+- CHANGELOG by [@ChrisHines]
+
+### Changed
+- Drop invalid runes from keys instead of returning ErrInvalidKey by [@ChrisHines]
+- On panic while printing, attempt to print panic value by [@bboreham]
+
+## [0.3.0] - 2016-11-15
+### Added
+- Pool buffers for quoted strings and byte slices by [@nussjustin]
+### Fixed
+- Fuzz fix, quote invalid UTF-8 values by [@judwhite]
+
+## [0.2.0] - 2016-05-08
+### Added
+- Encoder.EncodeKeyvals by [@ChrisHines]
+
+## [0.1.0] - 2016-03-28
+### Added
+- Encoder by [@ChrisHines]
+- Decoder by [@ChrisHines]
+- MarshalKeyvals by [@ChrisHines]
+
+[0.5.0]: https://github.com/go-logfmt/logfmt/compare/v0.4.0...v0.5.0
+[0.4.0]: https://github.com/go-logfmt/logfmt/compare/v0.3.0...v0.4.0
+[0.3.0]: https://github.com/go-logfmt/logfmt/compare/v0.2.0...v0.3.0
+[0.2.0]: https://github.com/go-logfmt/logfmt/compare/v0.1.0...v0.2.0
+[0.1.0]: https://github.com/go-logfmt/logfmt/commits/v0.1.0
+
+[@ChrisHines]: https://github.com/ChrisHines
+[@bboreham]: https://github.com/bboreham
+[@judwhite]: https://github.com/judwhite
+[@nussjustin]: https://github.com/nussjustin

+ 22 - 0
serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/LICENSE

@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 go-logfmt
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+

+ 33 - 0
serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/README.md

@@ -0,0 +1,33 @@
+[![GoDoc](https://godoc.org/github.com/go-logfmt/logfmt?status.svg)](https://godoc.org/github.com/go-logfmt/logfmt)
+[![Go Report Card](https://goreportcard.com/badge/go-logfmt/logfmt)](https://goreportcard.com/report/go-logfmt/logfmt)
+[![TravisCI](https://travis-ci.org/go-logfmt/logfmt.svg?branch=master)](https://travis-ci.org/go-logfmt/logfmt)
+[![Coverage Status](https://coveralls.io/repos/github/go-logfmt/logfmt/badge.svg?branch=master)](https://coveralls.io/github/go-logfmt/logfmt?branch=master)
+
+# logfmt
+
+Package logfmt implements utilities to marshal and unmarshal data in the [logfmt
+format](https://brandur.org/logfmt). It provides an API similar to
+[encoding/json](http://golang.org/pkg/encoding/json/) and
+[encoding/xml](http://golang.org/pkg/encoding/xml/).
+
+The logfmt format was first documented by Brandur Leach in [this
+article](https://brandur.org/logfmt). The format has not been formally
+standardized. The most authoritative public specification to date has been the
+documentation of a Go Language [package](http://godoc.org/github.com/kr/logfmt)
+written by Blake Mizerany and Keith Rarick.
+
+## Goals
+
+This project attempts to conform as closely as possible to the prior art, while
+also removing ambiguity where necessary to provide well behaved encoder and
+decoder implementations.
+
+## Non-goals
+
+This project does not attempt to formally standardize the logfmt format. In the
+event that logfmt is standardized this project would take conforming to the
+standard as a goal.
+
+## Versioning
+
+Package logfmt publishes releases via [semver](http://semver.org/) compatible Git tags prefixed with a single 'v'.

+ 237 - 0
serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/decode.go

@@ -0,0 +1,237 @@
+package logfmt
+
+import (
+	"bufio"
+	"bytes"
+	"fmt"
+	"io"
+	"unicode/utf8"
+)
+
+// A Decoder reads and decodes logfmt records from an input stream.
+type Decoder struct {
+	pos     int
+	key     []byte
+	value   []byte
+	lineNum int
+	s       *bufio.Scanner
+	err     error
+}
+
+// NewDecoder returns a new decoder that reads from r.
+//
+// The decoder introduces its own buffering and may read data from r beyond
+// the logfmt records requested.
+func NewDecoder(r io.Reader) *Decoder {
+	dec := &Decoder{
+		s: bufio.NewScanner(r),
+	}
+	return dec
+}
+
+// ScanRecord advances the Decoder to the next record, which can then be
+// parsed with the ScanKeyval method. It returns false when decoding stops,
+// either by reaching the end of the input or an error. After ScanRecord
+// returns false, the Err method will return any error that occurred during
+// decoding, except that if it was io.EOF, Err will return nil.
+func (dec *Decoder) ScanRecord() bool {
+	if dec.err != nil {
+		return false
+	}
+	if !dec.s.Scan() {
+		dec.err = dec.s.Err()
+		return false
+	}
+	dec.lineNum++
+	dec.pos = 0
+	return true
+}
+
+// ScanKeyval advances the Decoder to the next key/value pair of the current
+// record, which can then be retrieved with the Key and Value methods. It
+// returns false when decoding stops, either by reaching the end of the
+// current record or an error.
+func (dec *Decoder) ScanKeyval() bool {
+	dec.key, dec.value = nil, nil
+	if dec.err != nil {
+		return false
+	}
+
+	line := dec.s.Bytes()
+
+	// garbage
+	for p, c := range line[dec.pos:] {
+		if c > ' ' {
+			dec.pos += p
+			goto key
+		}
+	}
+	dec.pos = len(line)
+	return false
+
+key:
+	const invalidKeyError = "invalid key"
+
+	start, multibyte := dec.pos, false
+	for p, c := range line[dec.pos:] {
+		switch {
+		case c == '=':
+			dec.pos += p
+			if dec.pos > start {
+				dec.key = line[start:dec.pos]
+				if multibyte && bytes.ContainsRune(dec.key, utf8.RuneError) {
+					dec.syntaxError(invalidKeyError)
+					return false
+				}
+			}
+			if dec.key == nil {
+				dec.unexpectedByte(c)
+				return false
+			}
+			goto equal
+		case c == '"':
+			dec.pos += p
+			dec.unexpectedByte(c)
+			return false
+		case c <= ' ':
+			dec.pos += p
+			if dec.pos > start {
+				dec.key = line[start:dec.pos]
+				if multibyte && bytes.ContainsRune(dec.key, utf8.RuneError) {
+					dec.syntaxError(invalidKeyError)
+					return false
+				}
+			}
+			return true
+		case c >= utf8.RuneSelf:
+			multibyte = true
+		}
+	}
+	dec.pos = len(line)
+	if dec.pos > start {
+		dec.key = line[start:dec.pos]
+		if multibyte && bytes.ContainsRune(dec.key, utf8.RuneError) {
+			dec.syntaxError(invalidKeyError)
+			return false
+		}
+	}
+	return true
+
+equal:
+	dec.pos++
+	if dec.pos >= len(line) {
+		return true
+	}
+	switch c := line[dec.pos]; {
+	case c <= ' ':
+		return true
+	case c == '"':
+		goto qvalue
+	}
+
+	// value
+	start = dec.pos
+	for p, c := range line[dec.pos:] {
+		switch {
+		case c == '=' || c == '"':
+			dec.pos += p
+			dec.unexpectedByte(c)
+			return false
+		case c <= ' ':
+			dec.pos += p
+			if dec.pos > start {
+				dec.value = line[start:dec.pos]
+			}
+			return true
+		}
+	}
+	dec.pos = len(line)
+	if dec.pos > start {
+		dec.value = line[start:dec.pos]
+	}
+	return true
+
+qvalue:
+	const (
+		untermQuote  = "unterminated quoted value"
+		invalidQuote = "invalid quoted value"
+	)
+
+	hasEsc, esc := false, false
+	start = dec.pos
+	for p, c := range line[dec.pos+1:] {
+		switch {
+		case esc:
+			esc = false
+		case c == '\\':
+			hasEsc, esc = true, true
+		case c == '"':
+			dec.pos += p + 2
+			if hasEsc {
+				v, ok := unquoteBytes(line[start:dec.pos])
+				if !ok {
+					dec.syntaxError(invalidQuote)
+					return false
+				}
+				dec.value = v
+			} else {
+				start++
+				end := dec.pos - 1
+				if end > start {
+					dec.value = line[start:end]
+				}
+			}
+			return true
+		}
+	}
+	dec.pos = len(line)
+	dec.syntaxError(untermQuote)
+	return false
+}
+
+// Key returns the most recent key found by a call to ScanKeyval. The returned
+// slice may point to internal buffers and is only valid until the next call
+// to ScanRecord.  It does no allocation.
+func (dec *Decoder) Key() []byte {
+	return dec.key
+}
+
+// Value returns the most recent value found by a call to ScanKeyval. The
+// returned slice may point to internal buffers and is only valid until the
+// next call to ScanRecord.  It does no allocation when the value has no
+// escape sequences.
+func (dec *Decoder) Value() []byte {
+	return dec.value
+}
+
+// Err returns the first non-EOF error that was encountered by the Scanner.
+func (dec *Decoder) Err() error {
+	return dec.err
+}
+
+func (dec *Decoder) syntaxError(msg string) {
+	dec.err = &SyntaxError{
+		Msg:  msg,
+		Line: dec.lineNum,
+		Pos:  dec.pos + 1,
+	}
+}
+
+func (dec *Decoder) unexpectedByte(c byte) {
+	dec.err = &SyntaxError{
+		Msg:  fmt.Sprintf("unexpected %q", c),
+		Line: dec.lineNum,
+		Pos:  dec.pos + 1,
+	}
+}
+
+// A SyntaxError represents a syntax error in the logfmt input stream.
+type SyntaxError struct {
+	Msg  string
+	Line int
+	Pos  int
+}
+
+func (e *SyntaxError) Error() string {
+	return fmt.Sprintf("logfmt syntax error at pos %d on line %d: %s", e.Pos, e.Line, e.Msg)
+}

+ 6 - 0
serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/doc.go

@@ -0,0 +1,6 @@
+// Package logfmt implements utilities to marshal and unmarshal data in the
+// logfmt format. The logfmt format records key/value pairs in a way that
+// balances readability for humans and simplicity of computer parsing. It is
+// most commonly used as a more human friendly alternative to JSON for
+// structured logging.
+package logfmt

+ 322 - 0
serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/encode.go

@@ -0,0 +1,322 @@
+package logfmt
+
+import (
+	"bytes"
+	"encoding"
+	"errors"
+	"fmt"
+	"io"
+	"reflect"
+	"strings"
+	"unicode/utf8"
+)
+
+// MarshalKeyvals returns the logfmt encoding of keyvals, a variadic sequence
+// of alternating keys and values.
+func MarshalKeyvals(keyvals ...interface{}) ([]byte, error) {
+	buf := &bytes.Buffer{}
+	if err := NewEncoder(buf).EncodeKeyvals(keyvals...); err != nil {
+		return nil, err
+	}
+	return buf.Bytes(), nil
+}
+
+// An Encoder writes logfmt data to an output stream.
+type Encoder struct {
+	w       io.Writer
+	scratch bytes.Buffer
+	needSep bool
+}
+
+// NewEncoder returns a new encoder that writes to w.
+func NewEncoder(w io.Writer) *Encoder {
+	return &Encoder{
+		w: w,
+	}
+}
+
+var (
+	space   = []byte(" ")
+	equals  = []byte("=")
+	newline = []byte("\n")
+	null    = []byte("null")
+)
+
+// EncodeKeyval writes the logfmt encoding of key and value to the stream. A
+// single space is written before the second and subsequent keys in a record.
+// Nothing is written if a non-nil error is returned.
+func (enc *Encoder) EncodeKeyval(key, value interface{}) error {
+	enc.scratch.Reset()
+	if enc.needSep {
+		if _, err := enc.scratch.Write(space); err != nil {
+			return err
+		}
+	}
+	if err := writeKey(&enc.scratch, key); err != nil {
+		return err
+	}
+	if _, err := enc.scratch.Write(equals); err != nil {
+		return err
+	}
+	if err := writeValue(&enc.scratch, value); err != nil {
+		return err
+	}
+	_, err := enc.w.Write(enc.scratch.Bytes())
+	enc.needSep = true
+	return err
+}
+
+// EncodeKeyvals writes the logfmt encoding of keyvals to the stream. Keyvals
+// is a variadic sequence of alternating keys and values. Keys of unsupported
+// type are skipped along with their corresponding value. Values of
+// unsupported type or that cause a MarshalerError are replaced by their error
+// but do not cause EncodeKeyvals to return an error. If a non-nil error is
+// returned some key/value pairs may not have be written.
+func (enc *Encoder) EncodeKeyvals(keyvals ...interface{}) error {
+	if len(keyvals) == 0 {
+		return nil
+	}
+	if len(keyvals)%2 == 1 {
+		keyvals = append(keyvals, nil)
+	}
+	for i := 0; i < len(keyvals); i += 2 {
+		k, v := keyvals[i], keyvals[i+1]
+		err := enc.EncodeKeyval(k, v)
+		if err == ErrUnsupportedKeyType {
+			continue
+		}
+		if _, ok := err.(*MarshalerError); ok || err == ErrUnsupportedValueType {
+			v = err
+			err = enc.EncodeKeyval(k, v)
+		}
+		if err != nil {
+			return err
+		}
+	}
+	return nil
+}
+
+// MarshalerError represents an error encountered while marshaling a value.
+type MarshalerError struct {
+	Type reflect.Type
+	Err  error
+}
+
+func (e *MarshalerError) Error() string {
+	return "error marshaling value of type " + e.Type.String() + ": " + e.Err.Error()
+}
+
+// ErrNilKey is returned by Marshal functions and Encoder methods if a key is
+// a nil interface or pointer value.
+var ErrNilKey = errors.New("nil key")
+
+// ErrInvalidKey is returned by Marshal functions and Encoder methods if, after
+// dropping invalid runes, a key is empty.
+var ErrInvalidKey = errors.New("invalid key")
+
+// ErrUnsupportedKeyType is returned by Encoder methods if a key has an
+// unsupported type.
+var ErrUnsupportedKeyType = errors.New("unsupported key type")
+
+// ErrUnsupportedValueType is returned by Encoder methods if a value has an
+// unsupported type.
+var ErrUnsupportedValueType = errors.New("unsupported value type")
+
+func writeKey(w io.Writer, key interface{}) error {
+	if key == nil {
+		return ErrNilKey
+	}
+
+	switch k := key.(type) {
+	case string:
+		return writeStringKey(w, k)
+	case []byte:
+		if k == nil {
+			return ErrNilKey
+		}
+		return writeBytesKey(w, k)
+	case encoding.TextMarshaler:
+		kb, err := safeMarshal(k)
+		if err != nil {
+			return err
+		}
+		if kb == nil {
+			return ErrNilKey
+		}
+		return writeBytesKey(w, kb)
+	case fmt.Stringer:
+		ks, ok := safeString(k)
+		if !ok {
+			return ErrNilKey
+		}
+		return writeStringKey(w, ks)
+	default:
+		rkey := reflect.ValueOf(key)
+		switch rkey.Kind() {
+		case reflect.Array, reflect.Chan, reflect.Func, reflect.Map, reflect.Slice, reflect.Struct:
+			return ErrUnsupportedKeyType
+		case reflect.Ptr:
+			if rkey.IsNil() {
+				return ErrNilKey
+			}
+			return writeKey(w, rkey.Elem().Interface())
+		}
+		return writeStringKey(w, fmt.Sprint(k))
+	}
+}
+
+// keyRuneFilter returns r for all valid key runes, and -1 for all invalid key
+// runes. When used as the mapping function for strings.Map and bytes.Map
+// functions it causes them to remove invalid key runes from strings or byte
+// slices respectively.
+func keyRuneFilter(r rune) rune {
+	if r <= ' ' || r == '=' || r == '"' || r == utf8.RuneError {
+		return -1
+	}
+	return r
+}
+
+func writeStringKey(w io.Writer, key string) error {
+	k := strings.Map(keyRuneFilter, key)
+	if k == "" {
+		return ErrInvalidKey
+	}
+	_, err := io.WriteString(w, k)
+	return err
+}
+
+func writeBytesKey(w io.Writer, key []byte) error {
+	k := bytes.Map(keyRuneFilter, key)
+	if len(k) == 0 {
+		return ErrInvalidKey
+	}
+	_, err := w.Write(k)
+	return err
+}
+
+func writeValue(w io.Writer, value interface{}) error {
+	switch v := value.(type) {
+	case nil:
+		return writeBytesValue(w, null)
+	case string:
+		return writeStringValue(w, v, true)
+	case []byte:
+		return writeBytesValue(w, v)
+	case encoding.TextMarshaler:
+		vb, err := safeMarshal(v)
+		if err != nil {
+			return err
+		}
+		if vb == nil {
+			vb = null
+		}
+		return writeBytesValue(w, vb)
+	case error:
+		se, ok := safeError(v)
+		return writeStringValue(w, se, ok)
+	case fmt.Stringer:
+		ss, ok := safeString(v)
+		return writeStringValue(w, ss, ok)
+	default:
+		rvalue := reflect.ValueOf(value)
+		switch rvalue.Kind() {
+		case reflect.Array, reflect.Chan, reflect.Func, reflect.Map, reflect.Slice, reflect.Struct:
+			return ErrUnsupportedValueType
+		case reflect.Ptr:
+			if rvalue.IsNil() {
+				return writeBytesValue(w, null)
+			}
+			return writeValue(w, rvalue.Elem().Interface())
+		}
+		return writeStringValue(w, fmt.Sprint(v), true)
+	}
+}
+
+func needsQuotedValueRune(r rune) bool {
+	return r <= ' ' || r == '=' || r == '"' || r == utf8.RuneError
+}
+
+func writeStringValue(w io.Writer, value string, ok bool) error {
+	var err error
+	if ok && value == "null" {
+		_, err = io.WriteString(w, `"null"`)
+	} else if strings.IndexFunc(value, needsQuotedValueRune) != -1 {
+		_, err = writeQuotedString(w, value)
+	} else {
+		_, err = io.WriteString(w, value)
+	}
+	return err
+}
+
+func writeBytesValue(w io.Writer, value []byte) error {
+	var err error
+	if bytes.IndexFunc(value, needsQuotedValueRune) != -1 {
+		_, err = writeQuotedBytes(w, value)
+	} else {
+		_, err = w.Write(value)
+	}
+	return err
+}
+
+// EndRecord writes a newline character to the stream and resets the encoder
+// to the beginning of a new record.
+func (enc *Encoder) EndRecord() error {
+	_, err := enc.w.Write(newline)
+	if err == nil {
+		enc.needSep = false
+	}
+	return err
+}
+
+// Reset resets the encoder to the beginning of a new record.
+func (enc *Encoder) Reset() {
+	enc.needSep = false
+}
+
+func safeError(err error) (s string, ok bool) {
+	defer func() {
+		if panicVal := recover(); panicVal != nil {
+			if v := reflect.ValueOf(err); v.Kind() == reflect.Ptr && v.IsNil() {
+				s, ok = "null", false
+			} else {
+				s, ok = fmt.Sprintf("PANIC:%v", panicVal), false
+			}
+		}
+	}()
+	s, ok = err.Error(), true
+	return
+}
+
+func safeString(str fmt.Stringer) (s string, ok bool) {
+	defer func() {
+		if panicVal := recover(); panicVal != nil {
+			if v := reflect.ValueOf(str); v.Kind() == reflect.Ptr && v.IsNil() {
+				s, ok = "null", false
+			} else {
+				s, ok = fmt.Sprintf("PANIC:%v", panicVal), true
+			}
+		}
+	}()
+	s, ok = str.String(), true
+	return
+}
+
+func safeMarshal(tm encoding.TextMarshaler) (b []byte, err error) {
+	defer func() {
+		if panicVal := recover(); panicVal != nil {
+			if v := reflect.ValueOf(tm); v.Kind() == reflect.Ptr && v.IsNil() {
+				b, err = nil, nil
+			} else {
+				b, err = nil, fmt.Errorf("panic when marshalling: %s", panicVal)
+			}
+		}
+	}()
+	b, err = tm.MarshalText()
+	if err != nil {
+		return nil, &MarshalerError{
+			Type: reflect.TypeOf(tm),
+			Err:  err,
+		}
+	}
+	return
+}

+ 3 - 0
serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/go.mod

@@ -0,0 +1,3 @@
+module github.com/go-logfmt/logfmt
+
+go 1.13

+ 277 - 0
serves/excelExportGo/vendor/github.com/go-logfmt/logfmt/jsonstring.go

@@ -0,0 +1,277 @@
+package logfmt
+
+import (
+	"bytes"
+	"io"
+	"strconv"
+	"sync"
+	"unicode"
+	"unicode/utf16"
+	"unicode/utf8"
+)
+
+// Taken from Go's encoding/json and modified for use here.
+
+// Copyright 2010 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+var hex = "0123456789abcdef"
+
+var bufferPool = sync.Pool{
+	New: func() interface{} {
+		return &bytes.Buffer{}
+	},
+}
+
+func getBuffer() *bytes.Buffer {
+	return bufferPool.Get().(*bytes.Buffer)
+}
+
+func poolBuffer(buf *bytes.Buffer) {
+	buf.Reset()
+	bufferPool.Put(buf)
+}
+
+// NOTE: keep in sync with writeQuotedBytes below.
+func writeQuotedString(w io.Writer, s string) (int, error) {
+	buf := getBuffer()
+	buf.WriteByte('"')
+	start := 0
+	for i := 0; i < len(s); {
+		if b := s[i]; b < utf8.RuneSelf {
+			if 0x20 <= b && b != '\\' && b != '"' {
+				i++
+				continue
+			}
+			if start < i {
+				buf.WriteString(s[start:i])
+			}
+			switch b {
+			case '\\', '"':
+				buf.WriteByte('\\')
+				buf.WriteByte(b)
+			case '\n':
+				buf.WriteByte('\\')
+				buf.WriteByte('n')
+			case '\r':
+				buf.WriteByte('\\')
+				buf.WriteByte('r')
+			case '\t':
+				buf.WriteByte('\\')
+				buf.WriteByte('t')
+			default:
+				// This encodes bytes < 0x20 except for \n, \r, and \t.
+				buf.WriteString(`\u00`)
+				buf.WriteByte(hex[b>>4])
+				buf.WriteByte(hex[b&0xF])
+			}
+			i++
+			start = i
+			continue
+		}
+		c, size := utf8.DecodeRuneInString(s[i:])
+		if c == utf8.RuneError {
+			if start < i {
+				buf.WriteString(s[start:i])
+			}
+			buf.WriteString(`\ufffd`)
+			i += size
+			start = i
+			continue
+		}
+		i += size
+	}
+	if start < len(s) {
+		buf.WriteString(s[start:])
+	}
+	buf.WriteByte('"')
+	n, err := w.Write(buf.Bytes())
+	poolBuffer(buf)
+	return n, err
+}
+
+// NOTE: keep in sync with writeQuoteString above.
+func writeQuotedBytes(w io.Writer, s []byte) (int, error) {
+	buf := getBuffer()
+	buf.WriteByte('"')
+	start := 0
+	for i := 0; i < len(s); {
+		if b := s[i]; b < utf8.RuneSelf {
+			if 0x20 <= b && b != '\\' && b != '"' {
+				i++
+				continue
+			}
+			if start < i {
+				buf.Write(s[start:i])
+			}
+			switch b {
+			case '\\', '"':
+				buf.WriteByte('\\')
+				buf.WriteByte(b)
+			case '\n':
+				buf.WriteByte('\\')
+				buf.WriteByte('n')
+			case '\r':
+				buf.WriteByte('\\')
+				buf.WriteByte('r')
+			case '\t':
+				buf.WriteByte('\\')
+				buf.WriteByte('t')
+			default:
+				// This encodes bytes < 0x20 except for \n, \r, and \t.
+				buf.WriteString(`\u00`)
+				buf.WriteByte(hex[b>>4])
+				buf.WriteByte(hex[b&0xF])
+			}
+			i++
+			start = i
+			continue
+		}
+		c, size := utf8.DecodeRune(s[i:])
+		if c == utf8.RuneError {
+			if start < i {
+				buf.Write(s[start:i])
+			}
+			buf.WriteString(`\ufffd`)
+			i += size
+			start = i
+			continue
+		}
+		i += size
+	}
+	if start < len(s) {
+		buf.Write(s[start:])
+	}
+	buf.WriteByte('"')
+	n, err := w.Write(buf.Bytes())
+	poolBuffer(buf)
+	return n, err
+}
+
+// getu4 decodes \uXXXX from the beginning of s, returning the hex value,
+// or it returns -1.
+func getu4(s []byte) rune {
+	if len(s) < 6 || s[0] != '\\' || s[1] != 'u' {
+		return -1
+	}
+	r, err := strconv.ParseUint(string(s[2:6]), 16, 64)
+	if err != nil {
+		return -1
+	}
+	return rune(r)
+}
+
+func unquoteBytes(s []byte) (t []byte, ok bool) {
+	if len(s) < 2 || s[0] != '"' || s[len(s)-1] != '"' {
+		return
+	}
+	s = s[1 : len(s)-1]
+
+	// Check for unusual characters. If there are none,
+	// then no unquoting is needed, so return a slice of the
+	// original bytes.
+	r := 0
+	for r < len(s) {
+		c := s[r]
+		if c == '\\' || c == '"' || c < ' ' {
+			break
+		}
+		if c < utf8.RuneSelf {
+			r++
+			continue
+		}
+		rr, size := utf8.DecodeRune(s[r:])
+		if rr == utf8.RuneError {
+			break
+		}
+		r += size
+	}
+	if r == len(s) {
+		return s, true
+	}
+
+	b := make([]byte, len(s)+2*utf8.UTFMax)
+	w := copy(b, s[0:r])
+	for r < len(s) {
+		// Out of room?  Can only happen if s is full of
+		// malformed UTF-8 and we're replacing each
+		// byte with RuneError.
+		if w >= len(b)-2*utf8.UTFMax {
+			nb := make([]byte, (len(b)+utf8.UTFMax)*2)
+			copy(nb, b[0:w])
+			b = nb
+		}
+		switch c := s[r]; {
+		case c == '\\':
+			r++
+			if r >= len(s) {
+				return
+			}
+			switch s[r] {
+			default:
+				return
+			case '"', '\\', '/', '\'':
+				b[w] = s[r]
+				r++
+				w++
+			case 'b':
+				b[w] = '\b'
+				r++
+				w++
+			case 'f':
+				b[w] = '\f'
+				r++
+				w++
+			case 'n':
+				b[w] = '\n'
+				r++
+				w++
+			case 'r':
+				b[w] = '\r'
+				r++
+				w++
+			case 't':
+				b[w] = '\t'
+				r++
+				w++
+			case 'u':
+				r--
+				rr := getu4(s[r:])
+				if rr < 0 {
+					return
+				}
+				r += 6
+				if utf16.IsSurrogate(rr) {
+					rr1 := getu4(s[r:])
+					if dec := utf16.DecodeRune(rr, rr1); dec != unicode.ReplacementChar {
+						// A valid pair; consume.
+						r += 6
+						w += utf8.EncodeRune(b[w:], dec)
+						break
+					}
+					// Invalid surrogate; fall back to replacement rune.
+					rr = unicode.ReplacementChar
+				}
+				w += utf8.EncodeRune(b[w:], rr)
+			}
+
+		// Quote, control characters are invalid.
+		case c == '"', c < ' ':
+			return
+
+		// ASCII
+		case c < utf8.RuneSelf:
+			b[w] = c
+			r++
+			w++
+
+		// Coerce to well-formed UTF-8.
+		default:
+			rr, size := utf8.DecodeRune(s[r:])
+			r += size
+			w += utf8.EncodeRune(b[w:], rr)
+		}
+	}
+	return b[0:w], true
+}

+ 9 - 0
serves/excelExportGo/vendor/github.com/go-sql-driver/mysql/.gitignore

@@ -0,0 +1,9 @@
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+Icon?
+ehthumbs.db
+Thumbs.db
+.idea

+ 129 - 0
serves/excelExportGo/vendor/github.com/go-sql-driver/mysql/.travis.yml

@@ -0,0 +1,129 @@
+sudo: false
+language: go
+go:
+  - 1.10.x
+  - 1.11.x
+  - 1.12.x
+  - 1.13.x
+  - master
+
+before_install:
+  - go get golang.org/x/tools/cmd/cover
+  - go get github.com/mattn/goveralls
+
+before_script:
+  - echo -e "[server]\ninnodb_log_file_size=256MB\ninnodb_buffer_pool_size=512MB\nmax_allowed_packet=16MB" | sudo tee -a /etc/mysql/my.cnf
+  - sudo service mysql restart
+  - .travis/wait_mysql.sh
+  - mysql -e 'create database gotest;'
+
+matrix:
+  include:
+    - env: DB=MYSQL8
+      sudo: required
+      dist: trusty
+      go: 1.10.x
+      services:
+        - docker
+      before_install:
+        - go get golang.org/x/tools/cmd/cover
+        - go get github.com/mattn/goveralls
+        - docker pull mysql:8.0
+        - docker run -d -p 127.0.0.1:3307:3306 --name mysqld -e MYSQL_DATABASE=gotest -e MYSQL_USER=gotest -e MYSQL_PASSWORD=secret -e MYSQL_ROOT_PASSWORD=verysecret
+          mysql:8.0 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB --local-infile=1
+        - cp .travis/docker.cnf ~/.my.cnf
+        - .travis/wait_mysql.sh
+      before_script:
+        - export MYSQL_TEST_USER=gotest
+        - export MYSQL_TEST_PASS=secret
+        - export MYSQL_TEST_ADDR=127.0.0.1:3307
+        - export MYSQL_TEST_CONCURRENT=1
+
+    - env: DB=MYSQL57
+      sudo: required
+      dist: trusty
+      go: 1.10.x
+      services:
+        - docker
+      before_install:
+        - go get golang.org/x/tools/cmd/cover
+        - go get github.com/mattn/goveralls
+        - docker pull mysql:5.7
+        - docker run -d -p 127.0.0.1:3307:3306 --name mysqld -e MYSQL_DATABASE=gotest -e MYSQL_USER=gotest -e MYSQL_PASSWORD=secret -e MYSQL_ROOT_PASSWORD=verysecret
+          mysql:5.7 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB --local-infile=1
+        - cp .travis/docker.cnf ~/.my.cnf
+        - .travis/wait_mysql.sh
+      before_script:
+        - export MYSQL_TEST_USER=gotest
+        - export MYSQL_TEST_PASS=secret
+        - export MYSQL_TEST_ADDR=127.0.0.1:3307
+        - export MYSQL_TEST_CONCURRENT=1
+
+    - env: DB=MARIA55
+      sudo: required
+      dist: trusty
+      go: 1.10.x
+      services:
+        - docker
+      before_install:
+        - go get golang.org/x/tools/cmd/cover
+        - go get github.com/mattn/goveralls
+        - docker pull mariadb:5.5
+        - docker run -d -p 127.0.0.1:3307:3306 --name mysqld -e MYSQL_DATABASE=gotest -e MYSQL_USER=gotest -e MYSQL_PASSWORD=secret -e MYSQL_ROOT_PASSWORD=verysecret
+          mariadb:5.5 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB --local-infile=1
+        - cp .travis/docker.cnf ~/.my.cnf
+        - .travis/wait_mysql.sh
+      before_script:
+        - export MYSQL_TEST_USER=gotest
+        - export MYSQL_TEST_PASS=secret
+        - export MYSQL_TEST_ADDR=127.0.0.1:3307
+        - export MYSQL_TEST_CONCURRENT=1
+
+    - env: DB=MARIA10_1
+      sudo: required
+      dist: trusty
+      go: 1.10.x
+      services:
+        - docker
+      before_install:
+        - go get golang.org/x/tools/cmd/cover
+        - go get github.com/mattn/goveralls
+        - docker pull mariadb:10.1
+        - docker run -d -p 127.0.0.1:3307:3306 --name mysqld -e MYSQL_DATABASE=gotest -e MYSQL_USER=gotest -e MYSQL_PASSWORD=secret -e MYSQL_ROOT_PASSWORD=verysecret
+          mariadb:10.1 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB --local-infile=1
+        - cp .travis/docker.cnf ~/.my.cnf
+        - .travis/wait_mysql.sh
+      before_script:
+        - export MYSQL_TEST_USER=gotest
+        - export MYSQL_TEST_PASS=secret
+        - export MYSQL_TEST_ADDR=127.0.0.1:3307
+        - export MYSQL_TEST_CONCURRENT=1
+
+    - os: osx
+      osx_image: xcode10.1
+      addons:
+        homebrew:
+          packages:
+            - mysql
+          update: true
+      go: 1.12.x
+      before_install:
+        - go get golang.org/x/tools/cmd/cover
+        - go get github.com/mattn/goveralls
+      before_script:
+        - echo -e "[server]\ninnodb_log_file_size=256MB\ninnodb_buffer_pool_size=512MB\nmax_allowed_packet=16MB\nlocal_infile=1" >> /usr/local/etc/my.cnf
+        - mysql.server start
+        - mysql -uroot -e 'CREATE USER gotest IDENTIFIED BY "secret"'
+        - mysql -uroot -e 'GRANT ALL ON *.* TO gotest'
+        - mysql -uroot -e 'create database gotest;'
+        - export MYSQL_TEST_USER=gotest
+        - export MYSQL_TEST_PASS=secret
+        - export MYSQL_TEST_ADDR=127.0.0.1:3306
+        - export MYSQL_TEST_CONCURRENT=1
+
+script:
+  - go test -v -covermode=count -coverprofile=coverage.out
+  - go vet ./...
+  - .travis/gofmt.sh
+after_script:
+  - $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci

+ 105 - 0
serves/excelExportGo/vendor/github.com/go-sql-driver/mysql/AUTHORS

@@ -0,0 +1,105 @@
+# This is the official list of Go-MySQL-Driver authors for copyright purposes.
+
+# If you are submitting a patch, please add your name or the name of the
+# organization which holds the copyright to this list in alphabetical order.
+
+# Names should be added to this file as
+#	Name <email address>
+# The email address is not required for organizations.
+# Please keep the list sorted.
+
+
+# Individual Persons
+
+Aaron Hopkins <go-sql-driver at die.net>
+Achille Roussel <achille.roussel at gmail.com>
+Alexey Palazhchenko <alexey.palazhchenko at gmail.com>
+Andrew Reid <andrew.reid at tixtrack.com>
+Arne Hormann <arnehormann at gmail.com>
+Asta Xie <xiemengjun at gmail.com>
+Bulat Gaifullin <gaifullinbf at gmail.com>
+Carlos Nieto <jose.carlos at menteslibres.net>
+Chris Moos <chris at tech9computers.com>
+Craig Wilson <craiggwilson at gmail.com>
+Daniel Montoya <dsmontoyam at gmail.com>
+Daniel Nichter <nil at codenode.com>
+Daniël van Eeden <git at myname.nl>
+Dave Protasowski <dprotaso at gmail.com>
+DisposaBoy <disposaboy at dby.me>
+Egor Smolyakov <egorsmkv at gmail.com>
+Erwan Martin <hello at erwan.io>
+Evan Shaw <evan at vendhq.com>
+Frederick Mayle <frederickmayle at gmail.com>
+Gustavo Kristic <gkristic at gmail.com>
+Hajime Nakagami <nakagami at gmail.com>
+Hanno Braun <mail at hannobraun.com>
+Henri Yandell <flamefew at gmail.com>
+Hirotaka Yamamoto <ymmt2005 at gmail.com>
+Huyiguang <hyg at webterren.com>
+ICHINOSE Shogo <shogo82148 at gmail.com>
+Ilia Cimpoes <ichimpoesh at gmail.com>
+INADA Naoki <songofacandy at gmail.com>
+Jacek Szwec <szwec.jacek at gmail.com>
+James Harr <james.harr at gmail.com>
+Jeff Hodges <jeff at somethingsimilar.com>
+Jeffrey Charles <jeffreycharles at gmail.com>
+Jerome Meyer <jxmeyer at gmail.com>
+Jiajia Zhong <zhong2plus at gmail.com>
+Jian Zhen <zhenjl at gmail.com>
+Joshua Prunier <joshua.prunier at gmail.com>
+Julien Lefevre <julien.lefevr at gmail.com>
+Julien Schmidt <go-sql-driver at julienschmidt.com>
+Justin Li <jli at j-li.net>
+Justin Nuß <nuss.justin at gmail.com>
+Kamil Dziedzic <kamil at klecza.pl>
+Kevin Malachowski <kevin at chowski.com>
+Kieron Woodhouse <kieron.woodhouse at infosum.com>
+Lennart Rudolph <lrudolph at hmc.edu>
+Leonardo YongUk Kim <dalinaum at gmail.com>
+Linh Tran Tuan <linhduonggnu at gmail.com>
+Lion Yang <lion at aosc.xyz>
+Luca Looz <luca.looz92 at gmail.com>
+Lucas Liu <extrafliu at gmail.com>
+Luke Scott <luke at webconnex.com>
+Maciej Zimnoch <maciej.zimnoch at codilime.com>
+Michael Woolnough <michael.woolnough at gmail.com>
+Nathanial Murphy <nathanial.murphy at gmail.com>
+Nicola Peduzzi <thenikso at gmail.com>
+Olivier Mengué <dolmen at cpan.org>
+oscarzhao <oscarzhaosl at gmail.com>
+Paul Bonser <misterpib at gmail.com>
+Peter Schultz <peter.schultz at classmarkets.com>
+Rebecca Chin <rchin at pivotal.io>
+Reed Allman <rdallman10 at gmail.com>
+Richard Wilkes <wilkes at me.com>
+Robert Russell <robert at rrbrussell.com>
+Runrioter Wung <runrioter at gmail.com>
+Shuode Li <elemount at qq.com>
+Simon J Mudd <sjmudd at pobox.com>
+Soroush Pour <me at soroushjp.com>
+Stan Putrya <root.vagner at gmail.com>
+Stanley Gunawan <gunawan.stanley at gmail.com>
+Steven Hartland <steven.hartland at multiplay.co.uk>
+Thomas Wodarek <wodarekwebpage at gmail.com>
+Tim Ruffles <timruffles at gmail.com>
+Tom Jenkinson <tom at tjenkinson.me>
+Vladimir Kovpak <cn007b at gmail.com>
+Xiangyu Hu <xiangyu.hu at outlook.com>
+Xiaobing Jiang <s7v7nislands at gmail.com>
+Xiuming Chen <cc at cxm.cc>
+Zhenye Xie <xiezhenye at gmail.com>
+
+# Organizations
+
+Barracuda Networks, Inc.
+Counting Ltd.
+DigitalOcean Inc.
+Facebook Inc.
+GitHub Inc.
+Google Inc.
+InfoSum Ltd.
+Keybase Inc.
+Multiplay Ltd.
+Percona LLC
+Pivotal Inc.
+Stripe Inc.

+ 206 - 0
serves/excelExportGo/vendor/github.com/go-sql-driver/mysql/CHANGELOG.md

@@ -0,0 +1,206 @@
+## Version 1.5 (2020-01-07)
+
+Changes:
+
+  - Dropped support Go 1.9 and lower (#823, #829, #886, #1016, #1017)
+  - Improve buffer handling (#890)
+  - Document potentially insecure TLS configs (#901)
+  - Use a double-buffering scheme to prevent data races (#943)
+  - Pass uint64 values without converting them to string (#838, #955)
+  - Update collations and make utf8mb4 default (#877, #1054)
+  - Make NullTime compatible with sql.NullTime in Go 1.13+ (#995)
+  - Removed CloudSQL support (#993, #1007)
+  - Add Go Module support (#1003)
+
+New Features:
+
+  - Implement support of optional TLS (#900)
+  - Check connection liveness (#934, #964, #997, #1048, #1051, #1052)
+  - Implement Connector Interface (#941, #958, #1020, #1035)
+
+Bugfixes:
+
+  - Mark connections as bad on error during ping (#875)
+  - Mark connections as bad on error during dial (#867)
+  - Fix connection leak caused by rapid context cancellation (#1024)
+  - Mark connections as bad on error during Conn.Prepare (#1030)
+
+
+## Version 1.4.1 (2018-11-14)
+
+Bugfixes:
+
+ - Fix TIME format for binary columns (#818)
+ - Fix handling of empty auth plugin names (#835)
+ - Fix caching_sha2_password with empty password (#826)
+ - Fix canceled context broke mysqlConn (#862)
+ - Fix OldAuthSwitchRequest support (#870)
+ - Fix Auth Response packet for cleartext password (#887)
+
+## Version 1.4 (2018-06-03)
+
+Changes:
+
+ - Documentation fixes (#530, #535, #567)
+ - Refactoring (#575, #579, #580, #581, #603, #615, #704)
+ - Cache column names (#444)
+ - Sort the DSN parameters in DSNs generated from a config (#637)
+ - Allow native password authentication by default (#644)
+ - Use the default port if it is missing in the DSN (#668)
+ - Removed the `strict` mode (#676)
+ - Do not query `max_allowed_packet` by default (#680)
+ - Dropped support Go 1.6 and lower (#696)
+ - Updated `ConvertValue()` to match the database/sql/driver implementation (#760)
+ - Document the usage of `0000-00-00T00:00:00` as the time.Time zero value (#783)
+ - Improved the compatibility of the authentication system (#807)
+
+New Features:
+
+ - Multi-Results support (#537)
+ - `rejectReadOnly` DSN option (#604)
+ - `context.Context` support (#608, #612, #627, #761)
+ - Transaction isolation level support (#619, #744)
+ - Read-Only transactions support (#618, #634)
+ - `NewConfig` function which initializes a config with default values (#679)
+ - Implemented the `ColumnType` interfaces (#667, #724)
+ - Support for custom string types in `ConvertValue` (#623)
+ - Implemented `NamedValueChecker`, improving support for uint64 with high bit set (#690, #709, #710)
+ - `caching_sha2_password` authentication plugin support (#794, #800, #801, #802)
+ - Implemented `driver.SessionResetter` (#779)
+ - `sha256_password` authentication plugin support (#808)
+
+Bugfixes:
+
+ - Use the DSN hostname as TLS default ServerName if `tls=true` (#564, #718)
+ - Fixed LOAD LOCAL DATA INFILE for empty files (#590)
+ - Removed columns definition cache since it sometimes cached invalid data (#592)
+ - Don't mutate registered TLS configs (#600)
+ - Make RegisterTLSConfig concurrency-safe (#613)
+ - Handle missing auth data in the handshake packet correctly (#646)
+ - Do not retry queries when data was written to avoid data corruption (#302, #736)
+ - Cache the connection pointer for error handling before invalidating it (#678)
+ - Fixed imports for appengine/cloudsql (#700)
+ - Fix sending STMT_LONG_DATA for 0 byte data (#734)
+ - Set correct capacity for []bytes read from length-encoded strings (#766)
+ - Make RegisterDial concurrency-safe (#773)
+
+
+## Version 1.3 (2016-12-01)
+
+Changes:
+
+ - Go 1.1 is no longer supported
+ - Use decimals fields in MySQL to format time types (#249)
+ - Buffer optimizations (#269)
+ - TLS ServerName defaults to the host (#283)
+ - Refactoring (#400, #410, #437)
+ - Adjusted documentation for second generation CloudSQL (#485)
+ - Documented DSN system var quoting rules (#502)
+ - Made statement.Close() calls idempotent to avoid errors in Go 1.6+ (#512)
+
+New Features:
+
+ - Enable microsecond resolution on TIME, DATETIME and TIMESTAMP (#249)
+ - Support for returning table alias on Columns() (#289, #359, #382)
+ - Placeholder interpolation, can be actived with the DSN parameter `interpolateParams=true` (#309, #318, #490)
+ - Support for uint64 parameters with high bit set (#332, #345)
+ - Cleartext authentication plugin support (#327)
+ - Exported ParseDSN function and the Config struct (#403, #419, #429)
+ - Read / Write timeouts (#401)
+ - Support for JSON field type (#414)
+ - Support for multi-statements and multi-results (#411, #431)
+ - DSN parameter to set the driver-side max_allowed_packet value manually (#489)
+ - Native password authentication plugin support (#494, #524)
+
+Bugfixes:
+
+ - Fixed handling of queries without columns and rows (#255)
+ - Fixed a panic when SetKeepAlive() failed (#298)
+ - Handle ERR packets while reading rows (#321)
+ - Fixed reading NULL length-encoded integers in MySQL 5.6+ (#349)
+ - Fixed absolute paths support in LOAD LOCAL DATA INFILE (#356)
+ - Actually zero out bytes in handshake response (#378)
+ - Fixed race condition in registering LOAD DATA INFILE handler (#383)
+ - Fixed tests with MySQL 5.7.9+ (#380)
+ - QueryUnescape TLS config names (#397)
+ - Fixed "broken pipe" error by writing to closed socket (#390)
+ - Fixed LOAD LOCAL DATA INFILE buffering (#424)
+ - Fixed parsing of floats into float64 when placeholders are used (#434)
+ - Fixed DSN tests with Go 1.7+ (#459)
+ - Handle ERR packets while waiting for EOF (#473)
+ - Invalidate connection on error while discarding additional results (#513)
+ - Allow terminating packets of length 0 (#516)
+
+
+## Version 1.2 (2014-06-03)
+
+Changes:
+
+ - We switched back to a "rolling release". `go get` installs the current master branch again
+ - Version v1 of the driver will not be maintained anymore. Go 1.0 is no longer supported by this driver
+ - Exported errors to allow easy checking from application code
+ - Enabled TCP Keepalives on TCP connections
+ - Optimized INFILE handling (better buffer size calculation, lazy init, ...)
+ - The DSN parser also checks for a missing separating slash
+ - Faster binary date / datetime to string formatting
+ - Also exported the MySQLWarning type
+ - mysqlConn.Close returns the first error encountered instead of ignoring all errors
+ - writePacket() automatically writes the packet size to the header
+ - readPacket() uses an iterative approach instead of the recursive approach to merge splitted packets
+
+New Features:
+
+ - `RegisterDial` allows the usage of a custom dial function to establish the network connection
+ - Setting the connection collation is possible with the `collation` DSN parameter. This parameter should be preferred over the `charset` parameter
+ - Logging of critical errors is configurable with `SetLogger`
+ - Google CloudSQL support
+
+Bugfixes:
+
+ - Allow more than 32 parameters in prepared statements
+ - Various old_password fixes
+ - Fixed TestConcurrent test to pass Go's race detection
+ - Fixed appendLengthEncodedInteger for large numbers
+ - Renamed readLengthEnodedString to readLengthEncodedString and skipLengthEnodedString to skipLengthEncodedString (fixed typo)
+
+
+## Version 1.1 (2013-11-02)
+
+Changes:
+
+  - Go-MySQL-Driver now requires Go 1.1
+  - Connections now use the collation `utf8_general_ci` by default. Adding `&charset=UTF8` to the DSN should not be necessary anymore
+  - Made closing rows and connections error tolerant. This allows for example deferring rows.Close() without checking for errors
+  - `[]byte(nil)` is now treated as a NULL value. Before, it was treated like an empty string / `[]byte("")`
+  - DSN parameter values must now be url.QueryEscape'ed. This allows text values to contain special characters, such as '&'.
+  - Use the IO buffer also for writing. This results in zero allocations (by the driver) for most queries
+  - Optimized the buffer for reading
+  - stmt.Query now caches column metadata
+  - New Logo
+  - Changed the copyright header to include all contributors
+  - Improved the LOAD INFILE documentation
+  - The driver struct is now exported to make the driver directly accessible
+  - Refactored the driver tests
+  - Added more benchmarks and moved all to a separate file
+  - Other small refactoring
+
+New Features:
+
+  - Added *old_passwords* support: Required in some cases, but must be enabled by adding `allowOldPasswords=true` to the DSN since it is insecure
+  - Added a `clientFoundRows` parameter: Return the number of matching rows instead of the number of rows changed on UPDATEs
+  - Added TLS/SSL support: Use a TLS/SSL encrypted connection to the server. Custom TLS configs can be registered and used
+
+Bugfixes:
+
+  - Fixed MySQL 4.1 support: MySQL 4.1 sends packets with lengths which differ from the specification
+  - Convert to DB timezone when inserting `time.Time`
+  - Splitted packets (more than 16MB) are now merged correctly
+  - Fixed false positive `io.EOF` errors when the data was fully read
+  - Avoid panics on reuse of closed connections
+  - Fixed empty string producing false nil values
+  - Fixed sign byte for positive TIME fields
+
+
+## Version 1.0 (2013-05-14)
+
+Initial Release

+ 373 - 0
serves/excelExportGo/vendor/github.com/go-sql-driver/mysql/LICENSE

@@ -0,0 +1,373 @@
+Mozilla Public License Version 2.0
+==================================
+
+1. Definitions
+--------------
+
+1.1. "Contributor"
+    means each individual or legal entity that creates, contributes to
+    the creation of, or owns Covered Software.
+
+1.2. "Contributor Version"
+    means the combination of the Contributions of others (if any) used
+    by a Contributor and that particular Contributor's Contribution.
+
+1.3. "Contribution"
+    means Covered Software of a particular Contributor.
+
+1.4. "Covered Software"
+    means Source Code Form to which the initial Contributor has attached
+    the notice in Exhibit A, the Executable Form of such Source Code
+    Form, and Modifications of such Source Code Form, in each case
+    including portions thereof.
+
+1.5. "Incompatible With Secondary Licenses"
+    means
+
+    (a) that the initial Contributor has attached the notice described
+        in Exhibit B to the Covered Software; or
+
+    (b) that the Covered Software was made available under the terms of
+        version 1.1 or earlier of the License, but not also under the
+        terms of a Secondary License.
+
+1.6. "Executable Form"
+    means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+    means a work that combines Covered Software with other material, in 
+    a separate file or files, that is not Covered Software.
+
+1.8. "License"
+    means this document.
+
+1.9. "Licensable"
+    means having the right to grant, to the maximum extent possible,
+    whether at the time of the initial grant or subsequently, any and
+    all of the rights conveyed by this License.
+
+1.10. "Modifications"
+    means any of the following:
+
+    (a) any file in Source Code Form that results from an addition to,
+        deletion from, or modification of the contents of Covered
+        Software; or
+
+    (b) any new file in Source Code Form that contains any Covered
+        Software.
+
+1.11. "Patent Claims" of a Contributor
+    means any patent claim(s), including without limitation, method,
+    process, and apparatus claims, in any patent Licensable by such
+    Contributor that would be infringed, but for the grant of the
+    License, by the making, using, selling, offering for sale, having
+    made, import, or transfer of either its Contributions or its
+    Contributor Version.
+
+1.12. "Secondary License"
+    means either the GNU General Public License, Version 2.0, the GNU
+    Lesser General Public License, Version 2.1, the GNU Affero General
+    Public License, Version 3.0, or any later versions of those
+    licenses.
+
+1.13. "Source Code Form"
+    means the form of the work preferred for making modifications.
+
+1.14. "You" (or "Your")
+    means an individual or a legal entity exercising rights under this
+    License. For legal entities, "You" includes any entity that
+    controls, is controlled by, or is under common control with You. For
+    purposes of this definition, "control" means (a) the power, direct
+    or indirect, to cause the direction or management of such entity,
+    whether by contract or otherwise, or (b) ownership of more than
+    fifty percent (50%) of the outstanding shares or beneficial
+    ownership of such entity.
+
+2. License Grants and Conditions
+--------------------------------
+
+2.1. Grants
+
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark)
+    Licensable by such Contributor to use, reproduce, make available,
+    modify, display, perform, distribute, and otherwise exploit its
+    Contributions, either on an unmodified basis, with Modifications, or
+    as part of a Larger Work; and
+
+(b) under Patent Claims of such Contributor to make, use, sell, offer
+    for sale, have made, import, and otherwise transfer either its
+    Contributions or its Contributor Version.
+
+2.2. Effective Date
+
+The licenses granted in Section 2.1 with respect to any Contribution
+become effective for each Contribution on the date the Contributor first
+distributes such Contribution.
+
+2.3. Limitations on Grant Scope
+
+The licenses granted in this Section 2 are the only rights granted under
+this License. No additional rights or licenses will be implied from the
+distribution or licensing of Covered Software under this License.
+Notwithstanding Section 2.1(b) above, no patent license is granted by a
+Contributor:
+
+(a) for any code that a Contributor has removed from Covered Software;
+    or
+
+(b) for infringements caused by: (i) Your and any other third party's
+    modifications of Covered Software, or (ii) the combination of its
+    Contributions with other software (except as part of its Contributor
+    Version); or
+
+(c) under Patent Claims infringed by Covered Software in the absence of
+    its Contributions.
+
+This License does not grant any rights in the trademarks, service marks,
+or logos of any Contributor (except as may be necessary to comply with
+the notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+No Contributor makes additional grants as a result of Your choice to
+distribute the Covered Software under a subsequent version of this
+License (see Section 10.2) or under the terms of a Secondary License (if
+permitted under the terms of Section 3.3).
+
+2.5. Representation
+
+Each Contributor represents that the Contributor believes its
+Contributions are its original creation(s) or it has sufficient rights
+to grant the rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+This License is not intended to limit any rights You have under
+applicable copyright doctrines of fair use, fair dealing, or other
+equivalents.
+
+2.7. Conditions
+
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
+in Section 2.1.
+
+3. Responsibilities
+-------------------
+
+3.1. Distribution of Source Form
+
+All distribution of Covered Software in Source Code Form, including any
+Modifications that You create or to which You contribute, must be under
+the terms of this License. You must inform recipients that the Source
+Code Form of the Covered Software is governed by the terms of this
+License, and how they can obtain a copy of this License. You may not
+attempt to alter or restrict the recipients' rights in the Source Code
+Form.
+
+3.2. Distribution of Executable Form
+
+If You distribute Covered Software in Executable Form then:
+
+(a) such Covered Software must also be made available in Source Code
+    Form, as described in Section 3.1, and You must inform recipients of
+    the Executable Form how they can obtain a copy of such Source Code
+    Form by reasonable means in a timely manner, at a charge no more
+    than the cost of distribution to the recipient; and
+
+(b) You may distribute such Executable Form under the terms of this
+    License, or sublicense it under different terms, provided that the
+    license for the Executable Form does not attempt to limit or alter
+    the recipients' rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+You may create and distribute a Larger Work under terms of Your choice,
+provided that You also comply with the requirements of this License for
+the Covered Software. If the Larger Work is a combination of Covered
+Software with a work governed by one or more Secondary Licenses, and the
+Covered Software is not Incompatible With Secondary Licenses, this
+License permits You to additionally distribute such Covered Software
+under the terms of such Secondary License(s), so that the recipient of
+the Larger Work may, at their option, further distribute the Covered
+Software under the terms of either this License or such Secondary
+License(s).
+
+3.4. Notices
+
+You may not remove or alter the substance of any license notices
+(including copyright notices, patent notices, disclaimers of warranty,
+or limitations of liability) contained within the Source Code Form of
+the Covered Software, except that You may alter any license notices to
+the extent required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered
+Software. However, You may do so only on Your own behalf, and not on
+behalf of any Contributor. You must make it absolutely clear that any
+such warranty, support, indemnity, or liability obligation is offered by
+You alone, and You hereby agree to indemnify every Contributor for any
+liability incurred by such Contributor as a result of warranty, support,
+indemnity or liability terms You offer. You may include additional
+disclaimers of warranty and limitations of liability specific to any
+jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+---------------------------------------------------
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description must
+be placed in a text file included with all distributions of the Covered
+Software under this License. Except to the extent prohibited by statute
+or regulation, such description must be sufficiently detailed for a
+recipient of ordinary skill to be able to understand it.
+
+5. Termination
+--------------
+
+5.1. The rights granted under this License will terminate automatically
+if You fail to comply with any of its terms. However, if You become
+compliant, then the rights granted under this License from a particular
+Contributor are reinstated (a) provisionally, unless and until such
+Contributor explicitly and finally terminates Your grants, and (b) on an
+ongoing basis, if such Contributor fails to notify You of the
+non-compliance by some reasonable means prior to 60 days after You have
+come back into compliance. Moreover, Your grants from a particular
+Contributor are reinstated on an ongoing basis if such Contributor
+notifies You of the non-compliance by some reasonable means, this is the
+first time You have received notice of non-compliance with this License
+from such Contributor, and You become compliant prior to 30 days after
+Your receipt of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+infringement claim (excluding declaratory judgment actions,
+counter-claims, and cross-claims) alleging that a Contributor Version
+directly or indirectly infringes any patent, then the rights granted to
+You by any and all Contributors for the Covered Software under Section
+2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or Your distributors under this License
+prior to termination shall survive termination.
+
+************************************************************************
+*                                                                      *
+*  6. Disclaimer of Warranty                                           *
+*  -------------------------                                           *
+*                                                                      *
+*  Covered Software is provided under this License on an "as is"       *
+*  basis, without warranty of any kind, either expressed, implied, or  *
+*  statutory, including, without limitation, warranties that the       *
+*  Covered Software is free of defects, merchantable, fit for a        *
+*  particular purpose or non-infringing. The entire risk as to the     *
+*  quality and performance of the Covered Software is with You.        *
+*  Should any Covered Software prove defective in any respect, You     *
+*  (not any Contributor) assume the cost of any necessary servicing,   *
+*  repair, or correction. This disclaimer of warranty constitutes an   *
+*  essential part of this License. No use of any Covered Software is   *
+*  authorized under this License except under this disclaimer.         *
+*                                                                      *
+************************************************************************
+
+************************************************************************
+*                                                                      *
+*  7. Limitation of Liability                                          *
+*  --------------------------                                          *
+*                                                                      *
+*  Under no circumstances and under no legal theory, whether tort      *
+*  (including negligence), contract, or otherwise, shall any           *
+*  Contributor, or anyone who distributes Covered Software as          *
+*  permitted above, be liable to You for any direct, indirect,         *
+*  special, incidental, or consequential damages of any character      *
+*  including, without limitation, damages for lost profits, loss of    *
+*  goodwill, work stoppage, computer failure or malfunction, or any    *
+*  and all other commercial damages or losses, even if such party      *
+*  shall have been informed of the possibility of such damages. This   *
+*  limitation of liability shall not apply to liability for death or   *
+*  personal injury resulting from such party's negligence to the       *
+*  extent applicable law prohibits such limitation. Some               *
+*  jurisdictions do not allow the exclusion or limitation of           *
+*  incidental or consequential damages, so this exclusion and          *
+*  limitation may not apply to You.                                    *
+*                                                                      *
+************************************************************************
+
+8. Litigation
+-------------
+
+Any litigation relating to this License may be brought only in the
+courts of a jurisdiction where the defendant maintains its principal
+place of business and such litigation shall be governed by laws of that
+jurisdiction, without reference to its conflict-of-law provisions.
+Nothing in this Section shall prevent a party's ability to bring
+cross-claims or counter-claims.
+
+9. Miscellaneous
+----------------
+
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+shall not be used to construe this License against a Contributor.
+
+10. Versions of the License
+---------------------------
+
+10.1. New Versions
+
+Mozilla Foundation is the license steward. Except as provided in Section
+10.3, no one other than the license steward has the right to modify or
+publish new versions of this License. Each version will be given a
+distinguishing version number.
+
+10.2. Effect of New Versions
+
+You may distribute the Covered Software under the terms of the version
+of the License under which You originally received the Covered Software,
+or under the terms of any subsequent version published by the license
+steward.
+
+10.3. Modified Versions
+
+If you create software not governed by this License, and you want to
+create a new license for such software, you may create and use a
+modified version of this License if you rename the license and remove
+any references to the name of the license steward (except to note that
+such modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary
+Licenses
+
+If You choose to distribute Source Code Form that is Incompatible With
+Secondary Licenses under the terms of this version of the License, the
+notice described in Exhibit B of this License must be attached.
+
+Exhibit A - Source Code Form License Notice
+-------------------------------------------
+
+  This Source Code Form is subject to the terms of the Mozilla Public
+  License, v. 2.0. If a copy of the MPL was not distributed with this
+  file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular
+file, then You may include the notice in a location (such as a LICENSE
+file in a relevant directory) where a recipient would be likely to look
+for such a notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - "Incompatible With Secondary Licenses" Notice
+---------------------------------------------------------
+
+  This Source Code Form is "Incompatible With Secondary Licenses", as
+  defined by the Mozilla Public License, v. 2.0.

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini