{"record":{"id":"fdaa7c93136c069e","repo":"iOfficeAI/OfficeCLI","slug":"unknown-displayemptycellsas-value-deca-valid","errorCode":null,"errorMessage":"Unknown displayEmptyCellsAs value '{deca}'. Valid: gap, span, zero.","messagePattern":"Unknown displayEmptyCellsAs value '(.+?)'\\. Valid: gap, span, zero\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/officecli/Handlers/Excel/ExcelHandler.Add.Drawings.cs","lineNumber":1063,"sourceCode":"            spkGroup.FirstMarkerColor = new X14.FirstMarkerColor { Rgb = ParseHelpers.NormalizeArgbColor(firstMC) };\n        if (properties.TryGetValue(\"lastmarkercolor\", out var lastMC))\n            spkGroup.LastMarkerColor = new X14.LastMarkerColor { Rgb = ParseHelpers.NormalizeArgbColor(lastMC) };\n        if (properties.TryGetValue(\"markerscolor\", out var markersMC))\n            spkGroup.MarkersColor = new X14.MarkersColor { Rgb = ParseHelpers.NormalizeArgbColor(markersMC) };\n\n        // Line weight\n        if (properties.TryGetValue(\"lineweight\", out var lwVal) && double.TryParse(lwVal, out var lw))\n            spkGroup.LineWeight = lw;\n\n        // Group-level axis / empty-cell / RTL attributes.\n        if (properties.TryGetValue(\"displayemptycellsas\", out var deca))\n        {\n            spkGroup.DisplayEmptyCellsAs = deca.Trim().ToLowerInvariant() switch\n            {\n                \"span\" => X14.DisplayBlanksAsValues.Span,\n                \"zero\" => X14.DisplayBlanksAsValues.Zero,\n                \"gap\" => X14.DisplayBlanksAsValues.Gap,\n                _ => throw new ArgumentException(\n                    $\"Unknown displayEmptyCellsAs value '{deca}'. Valid: gap, span, zero.\"),\n            };\n        }\n        if (properties.TryGetValue(\"displayxaxis\", out var dxa) && ParseHelpers.IsTruthy(dxa))\n            spkGroup.DisplayXAxis = true;\n        if (properties.TryGetValue(\"righttoleft\", out var rtl) && ParseHelpers.IsTruthy(rtl))\n            spkGroup.RightToLeft = true;\n        if (properties.TryGetValue(\"dateaxis\", out var dax) && ParseHelpers.IsTruthy(dax))\n            spkGroup.DateAxis = true;\n\n        // Build the Sparkline element\n        // Ensure range includes sheet reference. Validate the range shape\n        // first: an arbitrary string (\"NOTAREF!!!\") landed verbatim in\n        // <xne:f> and real Excel refused the file (0x800A03EC) while schema\n        // validation stayed green.\n        ValidateSparklineRange(spkRange);\n        var spkFormulaRef = spkRange.Contains('!') ? spkRange : $\"{spkSheetName}!{spkRange}\";\n        var sparkline = new X14.Sparkline","sourceCodeStart":1045,"sourceCodeEnd":1081,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Handlers/Excel/ExcelHandler.Add.Drawings.cs#L1045-L1081","documentation":"Thrown when the sparkline group's `displayEmptyCellsAs=` property is present but not one of gap/span/zero. These map directly to X14 DisplayBlanksAsValues. The switch is case-insensitive (Trim().ToLowerInvariant()) but only accepts the three canonical tokens — no aliases. Any other value hits the default arm and throws.","triggerScenarios":"Passing `--prop displayEmptyCellsAs=blank`, `=skip`, `=interpolate`, or `=none`. The property key itself is matched case-insensitively against `displayemptycellsas`, so `displayEmptyCellsAs=` and `DisplayEmptyCellsAs=` both resolve; only the VALUE is constrained.","commonSituations":"Carrying vocabulary from chart blank-cell handling in other tools; assuming `blank` is accepted as a synonym for `gap`.","solutions":["Use gap (default Excel behavior), span, or zero.","Omit the property if the default (gap) is acceptable."],"exampleFix":"// before\nadd ./book.xlsx /Sheet1 sparkline --prop location=F1 --prop dataRange=A1:E1 --prop displayEmptyCellsAs=blank\n// after\nadd ./book.xlsx /Sheet1 sparkline --prop location=F1 --prop dataRange=A1:E1 --prop displayEmptyCellsAs=zero","handlingStrategy":"type-guard","validationCode":"var validDeca = new[]{\"gap\",\"span\",\"zero\"};\nif (!validDeca.Contains((deca ?? \"\").Trim().ToLowerInvariant()))\n    throw new InvalidOperationException($\"Invalid displayEmptyCellsAs '{deca}'\");","typeGuard":"static readonly HashSet<string> DecaTokens = new(StringComparer.OrdinalIgnoreCase)\n    {\"gap\",\"span\",\"zero\"};\nstatic bool IsValidDisplayBlanks(string? v) => v is null || DecaTokens.Contains(v?.Trim());","tryCatchPattern":"try { handler.AddSparkline(...); }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"displayEmptyCellsAs\"))\n{ /* default to gap or reprompt */ }","preventionTips":["The accepted values are gap/span/zero with no aliases.","Omit the property entirely if gap (Excel's default) is fine."],"tags":["excel","sparkline","enum-value","input-validation"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}