Casewhere.Runtime.IO Namespace |
Class | Description | |
---|---|---|
Readers |
A factory to create an excel reader.
| |
Writers |
A factory to create an excel writer.
|
Interface | Description | |
---|---|---|
IExcelCellWriter |
Provide methods for working with an excel cell.
| |
IExcelReader |
Provide methods for reading an excel file.
Examples var reader = Readers.GetExcelReader(); using(reader.Open(documentApi.OpenRead(ctx.Input.DocumentAttribute))) { var workSheetReader = reader.GetSheet(0); var rowCount = workSheetReader.RowCount; var columnCount = workSheetReader.ColumnCount; for (int row = 0; row < rowCount; row++) { for (int col = 0; col < columnCount; col++) { var value = workSheetReader.Read<string>(row, col); } } } | |
IExcelSheetWriter | ||
IExcelWriter |
Provide methods for write data to an excel file.
Examples var filter = FilterBuilder.Create().Build(); var schools = dataApi.Search(DataObjectApiQuery.For("School").FilterBy(filter)).Data; using(var stream = new MemoryStream()) { using (var writer = Writers.GetExcelWriter()) { writer.Open(stream); var sheetWriter = writer.AddSheet("Sheet1"); var row = 0; foreach(dynamic school in schools) { sheetWriter.Write(row, 0, school.Name); sheetWriter.Write(row, 1, school.Description); row ++; } } // Note: MUST move the cursor to the beginning of the stream before storing. stream.Seek(0, SeekOrigin.Begin); var documentInfo = documentApi.Create("Sample.xlsx"); documentApi.Store(documentInfo, stream); } | |
IIOApi | ||
IWorkSheetReader |
Provide methods for reading data in a worksheet.
|
Enumeration | Description | |
---|---|---|
Alignment |
Alignment types in horizontal.
| |
VAlignment |
Alignment types in vertical.
|