Ejemplo n.º 1
0
        private static void CreateSheetOne(Sheet sheet, WorksheetPart worksheetPart)
        {
            uint currentRow = 1;
            var  titleCell  = worksheetPart.InsertCellInWorksheet("A", currentRow, "Title");

            var test = sheet.GetFirstChild <SheetData>();
        }
Ejemplo n.º 2
0
 /// <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));
 }
Ejemplo n.º 3
0
 /// <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));
 }
Ejemplo n.º 4
0
 /// <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));
 }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
            private static void CreateSheet1(Sheet sheet, WorksheetPart worksheetPart)
            {
                uint currentRow = 1;

                worksheetPart.InsertCellInWorksheet("A", currentRow, "title");
            }