コード例 #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>();
        }
コード例 #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));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #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);
        }
コード例 #6
0
            private static void CreateSheet1(Sheet sheet, WorksheetPart worksheetPart)
            {
                uint currentRow = 1;

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