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(); }
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(); }
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(); }
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(); }