办公室打开excel设置单个decimla的百分比的地方

我正在使用OPENXML来创buildExcel文档,我想显示百分比单个小数位的百分比格式,如“85.5%”。 我无法find任何适当的解决scheme。

以下是我创build样式表的function。

private Stylesheet GenerateStyleSheet(NumberingFormat nf2decimal) { return new Stylesheet( new Fonts( new Font(new FontSize() { Val = 11 }, new Color() { Rgb = new HexBinaryValue() { Value = "000000" } }, new FontName() { Val = "Calibri" }), new Font(new Bold(), new FontSize() { Val = 12 }, new Color() { Rgb = new HexBinaryValue() { Value = "000000" } }, new FontName() { Val = "Calibri" }), new Font(new Bold(), new FontSize() { Val = 11 }, new Color() { Rgb = new HexBinaryValue() { Value = "FCCB02" } }, new FontName() { Val = "Calibri" }), new Font(new Bold(), new FontSize() { Val = 11 }, new Color() { Rgb = new HexBinaryValue() { Value = "000000" } }, new FontName() { Val = "Calibri" }), new Font(new Italic(), new FontSize() { Val = 11 }, new Color() { Rgb = new HexBinaryValue() { Value = "008000" } }, new FontName() { Val = "Calibri" }), new Font(new Bold(), new FontSize() { Val = 14 }, new Color() { Rgb = new HexBinaryValue() { Value = "008000" } }, new FontName() { Val = "Calibri" }) ), new Fills( new Fill(new PatternFill() { PatternType = PatternValues.None }), new Fill(new PatternFill() { PatternType = PatternValues.Gray125 }), new Fill(new PatternFill(new ForegroundColor() { Rgb = new HexBinaryValue() { Value = "6E6E6E" } }) { PatternType = PatternValues.Solid }), new Fill(new PatternFill(new ForegroundColor() { Rgb = new HexBinaryValue() { Value = "FFB3B3" } }) { PatternType = PatternValues.Solid }), new Fill(new PatternFill(new ForegroundColor() { Rgb = new HexBinaryValue() { Value = "B3FFB3" } }) { PatternType = PatternValues.Solid }), new Fill(new PatternFill(new ForegroundColor() { Rgb = new HexBinaryValue() { Value = "FFDB99" } }) { PatternType = PatternValues.Solid }), new Fill(new PatternFill(new ForegroundColor() { Rgb = new HexBinaryValue() { Value = "EAEAEA" } }) { PatternType = PatternValues.Solid }) ), new Borders( new Border(new LeftBorder(), new RightBorder(), new TopBorder(), new BottomBorder(), new DiagonalBorder()), new Border(new LeftBorder() { Style = BorderStyleValues.Thick }, new RightBorder() { Style = BorderStyleValues.Thick }, new TopBorder() { Style = BorderStyleValues.Thick }, new BottomBorder() { Style = BorderStyleValues.Thick }, new DiagonalBorder()), new Border(new LeftBorder() { Style = BorderStyleValues.Thin }, new RightBorder() { Style = BorderStyleValues.Thin }, new TopBorder() { Style = BorderStyleValues.Thin }, new BottomBorder() { Style = BorderStyleValues.Thin }, new DiagonalBorder()) , new Border(new LeftBorder(), new RightBorder(), new TopBorder(), new BottomBorder(), new DiagonalBorder()) ), new CellFormats( //0 new CellFormat() { FontId = 0, FillId = 0, BorderId = 0 }, //1 new CellFormat(new Alignment() { Horizontal = HorizontalAlignmentValues.Center, Vertical = VerticalAlignmentValues.Center, WrapText = true }) { FontId = 1, FillId = 0, BorderId = 1, ApplyBorder = true, }, //2 new CellFormat(new Alignment() { Horizontal = HorizontalAlignmentValues.Left, Vertical = VerticalAlignmentValues.Center, WrapText = true }) { FontId = 3, FillId = 0, BorderId = 2, ApplyFill = false, ApplyBorder = true }, //3 new CellFormat(new Alignment() { Horizontal = HorizontalAlignmentValues.Left, Vertical = VerticalAlignmentValues.Center, WrapText = true }) { FontId = 5, FillId = 6, BorderId = 2, ApplyBorder = true, ApplyFill = true }, //4 new CellFormat(new Alignment() { Horizontal = HorizontalAlignmentValues.Left, Vertical = VerticalAlignmentValues.Center, WrapText = true }) { FontId = 2, FillId = 2, BorderId = 2, ApplyFill = true, ApplyBorder = true }, //5 new CellFormat(new Alignment() { Horizontal = HorizontalAlignmentValues.Center, Vertical = VerticalAlignmentValues.Center, WrapText = true }) { FontId = 3, FillId = 0, BorderId = 2, ApplyFill = false, ApplyBorder = true }, //6 new CellFormat(new Alignment() { WrapText = true }) { FontId = 0, FillId = 0, BorderId = 2, ApplyFill = false, ApplyBorder = true, ApplyNumberFormat = true, NumberFormatId = 3 }, //7 new CellFormat(new Alignment() { WrapText = true }) { FontId = 0, FillId = 0, BorderId = 2, ApplyFill = false, ApplyBorder = true, ApplyNumberFormat = true, NumberFormatId = 10 }, //8 new CellFormat(new Alignment() { WrapText = true }) { FontId = 0, FillId = 0, BorderId = 2, ApplyFill = false, ApplyBorder = true, ApplyNumberFormat = true, NumberFormatId = 9 }, //9 new CellFormat(new Alignment() { WrapText = true }) { FontId = 4, FillId = 3, BorderId = 2, ApplyFill = false, ApplyBorder = true, ApplyNumberFormat = true, NumberFormatId = 3 }, //10 new CellFormat(new Alignment() { WrapText = true }) { FontId = 4, FillId = 3, BorderId = 2, ApplyFill = false, ApplyBorder = true, ApplyNumberFormat = true, NumberFormatId = 9 }, //11 new CellFormat(new Alignment() { WrapText = true }) { FontId = 4, FillId = 4, BorderId = 2, ApplyFill = false, ApplyBorder = true, ApplyNumberFormat = true, NumberFormatId = 3 }, //12 new CellFormat(new Alignment() { WrapText = true }) { FontId = 4, FillId = 4, BorderId = 2, ApplyFill = false, ApplyBorder = true, ApplyNumberFormat = true, NumberFormatId = 9 }, //13 new CellFormat(new Alignment() { WrapText = true }) { FontId = 4, FillId = 5, BorderId = 2, ApplyFill = false, ApplyBorder = true, ApplyNumberFormat = true, NumberFormatId = 3 }, //14 new CellFormat(new Alignment() { WrapText = true }) { FontId = 4, FillId = 5, BorderId = 2, ApplyFill = false, ApplyBorder = true, ApplyNumberFormat = true, NumberFormatId = nf2decimal.NumberFormatId }, //15 new CellFormat(new Alignment() { Horizontal = HorizontalAlignmentValues.Left, Vertical = VerticalAlignmentValues.Center, WrapText = true }) { FontId = 0, FillId = 0, BorderId = 2, ApplyFill = false, ApplyBorder = true }, //16 new CellFormat(new Alignment() { Vertical = VerticalAlignmentValues.Center, WrapText = true }) { FontId = 0, FillId = 0, BorderId = 2, ApplyFill = false, ApplyBorder = true, ApplyNumberFormat = true, NumberFormatId = 3 } ) ); // return } 

谁能帮帮我吗?