private static void CreateSheetOne(Sheet sheet, WorksheetPart worksheetPart) { uint currentRow = 1; var titleCell = worksheetPart.InsertCellInWorksheet("A", currentRow, "Title"); var test = sheet.GetFirstChild <SheetData>(); }
/// <summary> /// Inserts a cell into a worksheet with a specified value. /// </summary> /// <param name="worksheetPart">The worksheet part.</param> /// <param name="columnName">Name of the column.</param> /// <param name="rowIndex">The row index. 1 based.</param> /// <param name="value">The value to enter.</param> /// <returns>The created or updated cell.</returns> public static Cell InsertCellInWorksheet( this WorksheetPart worksheetPart, string columnName, uint rowIndex, DateTimeOffset value) { return(worksheetPart.InsertCellInWorksheet( columnName, rowIndex, value.ToString(NumberFormatInfo.InvariantInfo), CellValues.Date)); }
/// <summary> /// Inserts a cell into a worksheet with a specified value. /// </summary> /// <param name="worksheetPart">The worksheet part.</param> /// <param name="columnName">Name of the column.</param> /// <param name="rowIndex">The row index. 1 based.</param> /// <param name="value">The value to enter.</param> /// <returns>The created or updated cell.</returns> public static Cell InsertCellInWorksheet( this WorksheetPart worksheetPart, string columnName, uint rowIndex, bool value) { return(worksheetPart.InsertCellInWorksheet( columnName, rowIndex, value ? "1" : "0", CellValues.Boolean)); }
/// <summary> /// Inserts a cell into a worksheet with a specified value. /// </summary> /// <param name="worksheetPart">The worksheet part.</param> /// <param name="columnName">Name of the column.</param> /// <param name="rowIndex">The row index. 1 based.</param> /// <param name="value">The value to enter.</param> /// <returns>The created or updated cell.</returns> public static Cell InsertCellInWorksheet( this WorksheetPart worksheetPart, string columnName, uint rowIndex, string value) { return(worksheetPart.InsertCellInWorksheet( columnName, rowIndex, value, CellValues.String)); }
private static Cell InsertCellInWorksheet( this WorksheetPart worksheetPart, string columnName, uint rowIndex, string value, CellValues cellValues) { var cell = worksheetPart.InsertCellInWorksheet(columnName, rowIndex); cell.CellValue = new CellValue(value); cell.DataType = new EnumValue <CellValues>(cellValues); return(cell); }
private static void CreateSheet1(Sheet sheet, WorksheetPart worksheetPart) { uint currentRow = 1; worksheetPart.InsertCellInWorksheet("A", currentRow, "title"); }