变量

  1. var (
  2. // ErrStreamSetColWidth 定义了在流式写入模式下设置列宽度时的错误提示信息
  3. ErrStreamSetColWidth = errors.New("must call the SetColWidth function before the SetRow function")
  4. // ErrColumnNumber 定义了收到无效列名时的错误提示信息
  5. ErrColumnNumber = errors.New("column number exceeds maximum limit")
  6. // ErrColumnWidth 定义了收到无效列宽度时的错误提示信息
  7. ErrColumnWidth = fmt.Errorf("the width of the column must be smaller than or equal to %d characters", MaxColumnWidth)
  8. // ErrOutlineLevel 定义了在数据分组时收到无效级别时的错误提示信息
  9. ErrOutlineLevel = errors.New("invalid outline level")
  10. // ErrCoordinates 定义了收到无效单元格坐标元组时的错误提示信息
  11. ErrCoordinates = errors.New("coordinates length must be 4")
  12. // ErrExistsWorksheet 定义了检测到已有相同名称工作表存在时的错误提示信息
  13. ErrExistsWorksheet = errors.New("the same name worksheet already exists")
  14. // ErrTotalSheetHyperlinks 定义了工作表包含的超链接总数超出最大限制时的错误提示信息
  15. ErrTotalSheetHyperlinks = errors.New("over maximum limit hyperlinks in a worksheet")
  16. // ErrInvalidFormula 定义了收到无效公式时的错误提示信息
  17. ErrInvalidFormula = errors.New("formula not valid")
  18. // ErrAddVBAProject 定义了向工作簿嵌入 VBA 项目发生异常时的错误提示信息
  19. ErrAddVBAProject = errors.New("unsupported VBA project extension")
  20. // ErrMaxRows 定义了当行号超出最大限制时的错误提示信息
  21. ErrMaxRows = errors.New("row number exceeds maximum limit")
  22. // ErrMaxRowHeight 定义了收到无效行高度时的错误提示信息
  23. ErrMaxRowHeight = errors.New("the height of the row must be smaller than or equal to 409 points")
  24. // ErrImgExt 定义了不受支持的图片扩展名的错误提示信息
  25. ErrImgExt = errors.New("unsupported image extension")
  26. // ErrMaxFileNameLength 定义了工作簿文件名长度超出最大限制时的错误提示信息
  27. ErrMaxFileNameLength = errors.New("file name length exceeds maximum limit")
  28. // ErrEncrypt 定义了加密工作簿时的错误提示信息
  29. ErrEncrypt = errors.New("not support encryption currently")
  30. // ErrUnknownEncryptMechanism 定义了检测到未知加密机制时的错误提示信息
  31. ErrUnknownEncryptMechanism = errors.New("unknown encryption mechanism")
  32. // ErrUnsupportedEncryptMechanism 定义了检测到不受支持的加密机制时的错误提示信息
  33. ErrUnsupportedEncryptMechanism = errors.New("unsupport encryption mechanism")
  34. // ErrParameterRequired 定义了必要参数为空时的错误提示信息
  35. ErrParameterRequired = errors.New("parameter is required")
  36. // ErrParameterInvalid 定义了收到无效参数时的错误提示信息
  37. ErrParameterInvalid = errors.New("parameter is invalid")
  38. // ErrDefinedNameScope 定义了在给定范围内找不到指定名称时的错误提示信息
  39. ErrDefinedNameScope = errors.New("no defined name on the scope")
  40. // ErrDefinedNameDuplicate 定义了在给定范围内已经存在相同指定名称时的错误提示信息
  41. ErrDefinedNameDuplicate = errors.New("the same name already exists on the scope")
  42. // ErrCustomNumFmt 定义了指定自定义数字格式表达式为空时的错误提示信息
  43. ErrCustomNumFmt = errors.New("custom number format can not be empty")
  44. // ErrFontLength 定义了字体名称长度超出最大限制时的错误提示信息
  45. ErrFontLength = errors.New("the length of the font family name must be smaller than or equal to 31")
  46. // ErrFontSize 定义了收到无效字号时的错误提示信息
  47. ErrFontSize = errors.New("font size must be between 1 and 409 points")
  48. // ErrSheetIdx 定义了收到了无效工作表索引时的错误提示信息
  49. ErrSheetIdx = errors.New("invalid worksheet index")
  50. // ErrUnprotectSheet 定义了取消保护工作表时的错误提示信息
  51. ErrUnprotectSheet = errors.New("worksheet has set no protect")
  52. // ErrUnprotectSheetPassword 定义了通过密码验证取消保护工作表失败时的错误提示信息
  53. ErrUnprotectSheetPassword = errors.New("worksheet protect password not match")
  54. // ErrGroupSheets 定义了工作表分组异常时的错误提示信息
  55. ErrGroupSheets = errors.New("group worksheet must contain an active worksheet")
  56. // ErrDataValidationFormulaLength 定义了数据验证公式长度超出最大限制时错误提示信息
  57. ErrDataValidationFormulaLength = errors.New("data validation must be 0-255 characters")
  58. // ErrDataValidationRange 定义了指定数据验证小数范围无效时的错误提示信息
  59. ErrDataValidationRange = errors.New("data validation range exceeds limit")
  60. // ErrCellCharsLength 定义了单个单元格字符长度超出最大限制时的错误提示信息
  61. ErrCellCharsLength = fmt.Errorf("cell value must be 0-%d characters", TotalCellChars)
  62. // ErrOptionsUnzipSizeLimit
  63. // 定义了打开工作簿时,“用以指定打开电子表格文档时的解压缩大小限制参数”和“用以指定解压每个工作表时的内存限制参数”产生冲突时的错误提示信息
  64. ErrOptionsUnzipSizeLimit = errors.New("the value of UnzipSizeLimit should be greater than or equal to UnzipXMLSizeLimit")
  65. // ErrSave 定义了保存工作簿时的错误提示信息
  66. ErrSave = errors.New("no path defined for file, consider File.WriteTo or File.Write")
  67. // ErrAttrValBool 定义了序列化或反序列化 XML 布尔类型值失败时的错误提示信息
  68. ErrAttrValBool = errors.New("unexpected child of attrValBool")
  69. // ErrSparklineType 定义了创建迷你图收到无效参数时的错误提示信息
  70. ErrSparklineType = errors.New("parameter 'Type' must be 'line', 'column' or 'win_loss'")
  71. // ErrSparklineLocation 定义了创建迷你图参数缺少 Location 字段时的错误提示信息
  72. ErrSparklineLocation = errors.New("parameter 'Location' is required")
  73. // ErrSparklineRange 定义了创建迷你图参数缺少 Range 字段时的错误提示信息
  74. ErrSparklineRange = errors.New("parameter 'Range' is required")
  75. // ErrSparkline 定义了收到无效迷你图创建参数时的错误提示信息
  76. ErrSparkline = errors.New("must have the same number of 'Location' and 'Range' parameters")
  77. // ErrSparklineStyle 定义了收到无效迷你图创建样式参数时的错误提示信息
  78. ErrSparklineStyle = errors.New("parameter 'Style' must between 0-35")
  79. )

下列变量定义了 XML 源关系和命名空间列表、相关前缀和引入它的模式:

  1. var (
  2. SourceRelationship = xml.Attr{Name: xml.Name{Local: "r", Space: "xmlns"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"}
  3. SourceRelationshipCompatibility = xml.Attr{Name: xml.Name{Local: "mc", Space: "xmlns"}, Value: "http://schemas.openxmlformats.org/markup-compatibility/2006"}
  4. SourceRelationshipChart20070802 = xml.Attr{Name: xml.Name{Local: "c14", Space: "xmlns"}, Value: "http://schemas.microsoft.com/office/drawing/2007/8/2/chart"}
  5. SourceRelationshipChart2014 = xml.Attr{Name: xml.Name{Local: "c16", Space: "xmlns"}, Value: "http://schemas.microsoft.com/office/drawing/2014/chart"}
  6. SourceRelationshipChart201506 = xml.Attr{Name: xml.Name{Local: "c16r2", Space: "xmlns"}, Value: "http://schemas.microsoft.com/office/drawing/2015/06/chart"}
  7. NameSpaceSpreadSheet = xml.Attr{Name: xml.Name{Local: "xmlns"}, Value: "http://schemas.openxmlformats.org/spreadsheetml/2006/main"}
  8. NameSpaceSpreadSheetX14 = xml.Attr{Name: xml.Name{Local: "x14", Space: "xmlns"}, Value: "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}
  9. NameSpaceDrawingML = xml.Attr{Name: xml.Name{Local: "a", Space: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/main"}
  10. NameSpaceDrawingMLChart = xml.Attr{Name: xml.Name{Local: "c", Space: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/chart"}
  11. NameSpaceDrawingMLSpreadSheet = xml.Attr{Name: xml.Name{Local: "xdr", Space: "xmlns"}, Value: "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"}
  12. NameSpaceSpreadSheetX15 = xml.Attr{Name: xml.Name{Local: "x15", Space: "xmlns"}, Value: "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"}
  13. NameSpaceSpreadSheetExcel2006Main = xml.Attr{Name: xml.Name{Local: "xne", Space: "xmlns"}, Value: "http://schemas.microsoft.com/office/excel/2006/main"}
  14. NameSpaceMacExcel2008Main = xml.Attr{Name: xml.Name{Local: "mx", Space: "xmlns"}, Value: "http://schemas.microsoft.com/office/mac/excel/2008/main"}
  15. NameSpaceDocumentPropertiesVariantTypes = xml.Attr{Name: xml.Name{Local: "vt", Space: "xmlns"}, Value: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}
  16. )