Convert Cell Format to number using OpenXmlAttribute in C# RRS feed

  • Question

  • Hi All,

    I have exported the data table to excel but i found that numbers created as text 

    How can i convert these cells to numbers 

    Attached is my function to add cell

    Thanks in advance

            public static void WriteCellValueSax(OpenXmlWriter writer, string cellValue) 
                List<OpenXmlAttribute> attributes = new List<OpenXmlAttribute>
                    new OpenXmlAttribute("t", null, "inlineStr")
                writer.WriteStartElement(new Cell(), attributes);
                writer.WriteElement(new InlineString(new Text(cellValue)));

    Wednesday, February 5, 2020 4:03 PM