コード例 #1
0
        public void WriteCell(OpenXmlWriter writer, object value)
        {
            var dateTime = (DateTime) value;

            writer.WriteStartElement(new Cell(), new [] { new OpenXmlAttribute("s", null, "1"), });

            writer.WriteStartElement(new CellValue());
            writer.WriteString(dateTime.ToOADate().ToString(CultureInfo.InvariantCulture));
            writer.WriteEndElement();

            writer.WriteEndElement();
        }
コード例 #2
0
ファイル: StringCellWriter.cs プロジェクト: rasmuskl/ExStream
        public void WriteCell(OpenXmlWriter writer, object value)
        {
            writer.WriteStartElement(new Cell(), CellAttributes);

            writer.WriteStartElement(new InlineString());
            writer.WriteStartElement(new Text());
            writer.WriteString(value.ToString());
            writer.WriteEndElement();
            writer.WriteEndElement();

            writer.WriteEndElement();
        }
コード例 #3
0
        public void WriteCell(OpenXmlWriter writer, object value)
        {
            writer.WriteStartElement(new Cell(), new [] { new OpenXmlAttribute("t", null, "b"),  });

            var b = (bool) value;

            writer.WriteStartElement(new CellValue());
            writer.WriteString(BooleanValue.FromBoolean(b).ToString());
            writer.WriteEndElement();

            writer.WriteEndElement();
        }
コード例 #4
-1
ファイル: NumberCellWriter.cs プロジェクト: rasmuskl/ExStream
        public void WriteCell(OpenXmlWriter writer, object value)
        {
            writer.WriteStartElement(new Cell());

            writer.WriteStartElement(new CellValue());
            writer.WriteString(string.Format(CultureInfo.InvariantCulture, "{0}", value));
            writer.WriteEndElement();

            writer.WriteEndElement();
        }