Exemplo n.º 1
0
        public void WorksheetPasteDate()
        {
            MemoryStream        stream        = SpreadsheetReader.Create();
            SpreadsheetDocument doc           = SpreadsheetDocument.Open(stream, true);
            WorksheetPart       worksheetPart = SpreadsheetReader.GetWorksheetPartByName(doc, "Sheet1");

            WorksheetWriter writer = new WorksheetWriter(doc, worksheetPart);

            Cell cell = writer.PasteDate("D3", new DateTime(2009, 12, 20, 15, 23, 05));

            //Save to the memory stream, and then to a file
            SpreadsheetWriter.Save(doc);
            SpreadsheetWriter.StreamToFile(string.Format("{0}\\date.xlsx", GetOutputFolder()), stream);
        }