当前位置: 首页>>代码示例>>C#>>正文


C# ISheet类代码示例

本文整理汇总了C#中ISheet的典型用法代码示例。如果您正苦于以下问题:C# ISheet类的具体用法?C# ISheet怎么用?C# ISheet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ISheet类属于命名空间,在下文中一共展示了ISheet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddDateRangetoExcelSheet

        public void AddDateRangetoExcelSheet(HSSFWorkbook workbook, ISheet sheet)
        {
            //Create a Title row
            var titleFont = workbook.CreateFont();
            titleFont.Boldweight = (short)NPOI.SS.UserModel.FontBoldWeight.Bold;
            titleFont.FontHeightInPoints = 11;
            titleFont.Underline = NPOI.SS.UserModel.FontUnderlineType.Single;

            var titleStyle = workbook.CreateCellStyle();
            titleStyle.SetFont(titleFont);

            var row = sheet.CreateRow(rowCount++);
            var cell = row.CreateCell(0);
            cell.CellStyle = titleStyle;
            cell.SetCellValue("Date Range");

            row = sheet.CreateRow(rowCount++);
            cell = row.CreateCell(0);
            var value = string.Format("Start Date: {0}", StartDate.ToString("MM-dd-yyyy"));
            cell.SetCellValue(value);
            row = sheet.CreateRow(rowCount++);
            cell = row.CreateCell(0);
            value = string.Format("End Date: {0}", EndDate.ToString("MM-dd-yyyy"));
            cell.SetCellValue(value);
        }
开发者ID:chuckfrazier,项目名称:DataPlatform,代码行数:25,代码来源:ServiceLineExplorerExplorerExcelExporter.cs

示例2: NpoiWorksheet

		public NpoiWorksheet(HSSFWorkbook book, ISheet sheet) {
			sheet.ForceFormulaRecalculation = true;
			Book = book;
			Sheet = sheet;
			Index = book.GetSheetIndex(sheet);
			Name = book.GetSheetName(Index);
		}
开发者ID:manologomez,项目名称:ISpreadsheet.net,代码行数:7,代码来源:NpoiWorksheet.cs

示例3: ReadSheet

		//シートの読み込み
		static StringGrid ReadSheet(ISheet sheet, string path)
		{
			int lastRowNum = sheet.LastRowNum;

			StringGrid grid = new StringGrid(path + ":" + sheet.SheetName, CsvType.Tsv);
			for (int rowIndex = sheet.FirstRowNum; rowIndex <= lastRowNum; ++rowIndex)
			{
				IRow row = sheet.GetRow(rowIndex);

				List<string> stringList = new List<string>();
				if (row != null)
				{
					foreach (var cell in row.Cells)
					{
						for (int i = stringList.Count; i < cell.ColumnIndex; ++i)
						{
							stringList.Add("");
						}
						stringList.Add(cell.ToString());
					}
				}
				grid.AddRow(stringList);
			}
			grid.ParseHeader();
			return grid;
		}
开发者ID:OsamaRazaAnsari,项目名称:2DDressUpGame,代码行数:27,代码来源:ExcelParser.cs

示例4: GetChambrePMZ

        private ChambrePA GetChambrePMZ(ISheet sheet)
        {
            var geofibrePMZ = sheet.GetRow(10).GetCell(11).ToString();
            var identifiantPMZ = sheet.GetRow(10).GetCell(13).ToString();

            return new ChambrePA(geofibrePMZ, identifiantPMZ);
        }
开发者ID:baptisteMillot,项目名称:Synoptique,代码行数:7,代码来源:GetPageDeGarde.cs

示例5: GetChambrePA

        private ChambrePointAboutement GetChambrePA(ISheet sheet)
        {
            var geofibrePA = sheet.GetRow(11).GetCell(11).ToString();
            var chambrePA = sheet.GetRow(13).GetCell(10).ToString();

            return new ChambrePointAboutement(geofibrePA, chambrePA);
        }
开发者ID:baptisteMillot,项目名称:Synoptique,代码行数:7,代码来源:GetPageDeGarde.cs

示例6: OutputDateRow

        private static void OutputDateRow(ISheet sheet, IEnumerable<string> distinctDates, int rowIndex)
        {
            var colSpan = 3;
            var startCol = 1;

            var dateRow = sheet.CreateRow(rowIndex);
            var headerRow = sheet.CreateRow(rowIndex + 1);

            dateRow.CreateCell(0).SetCellValue("");
            headerRow.CreateCell(0).SetCellValue("");

            for (var i = 0; i < distinctDates.Count(); i++)
            {
                var cell = dateRow.CreateCell(startCol);
                cell.SetCellValue(distinctDates.ElementAt(i));
                sheet.AddMergedRegion(new CellRangeAddress(rowIndex, rowIndex, startCol, colSpan * (i + 1)));

                headerRow.CreateCell(startCol).SetCellValue(ValueHeader);
                headerRow.CreateCell(startCol + 1).SetCellValue(PrefixHeader);
                headerRow.CreateCell(startCol + 2).SetCellValue(DlHeader);

                startCol = startCol + colSpan;
            }

        }
开发者ID:gvassas,项目名称:Hatfield.EnviroData.MVC,代码行数:25,代码来源:SpreadsheetHelper.cs

示例7: WriteHeaderRow

 static void WriteHeaderRow(IWorkbook wb, ISheet sheet)
 {
     sheet.SetColumnWidth(0, 6000);
     sheet.SetColumnWidth(1, 6000);
     sheet.SetColumnWidth(2, 3600);
     sheet.SetColumnWidth(3, 3600);
     sheet.SetColumnWidth(4, 2400);
     sheet.SetColumnWidth(5, 2400);
     sheet.SetColumnWidth(6, 2400);
     sheet.SetColumnWidth(7, 2400);
     sheet.SetColumnWidth(8, 2400);
     IRow row = sheet.CreateRow(0);
     ICellStyle style = wb.CreateCellStyle();
     IFont font = wb.CreateFont();
     font.Boldweight = (short)FontBoldWeight.BOLD;
     style.SetFont(font);
     WriteHeaderCell(row, 0, "Raw Long Bits A", style);
     WriteHeaderCell(row, 1, "Raw Long Bits B", style);
     WriteHeaderCell(row, 2, "Value A", style);
     WriteHeaderCell(row, 3, "Value B", style);
     WriteHeaderCell(row, 4, "Exp Cmp", style);
     WriteHeaderCell(row, 5, "LT", style);
     WriteHeaderCell(row, 6, "EQ", style);
     WriteHeaderCell(row, 7, "GT", style);
     WriteHeaderCell(row, 8, "Check", style);
 }
开发者ID:xoposhiy,项目名称:npoi,代码行数:26,代码来源:NumberComparingSpreadsheetGenerator.cs

示例8: PositionnementEtudeCreator

 public PositionnementEtudeCreator(ISheet sheet, XSSFWorkbook workbook)
 {
     _sheet = sheet;
     _workbook = workbook;
     _cadreCreator = new Cadre(workbook, sheet);
     _lineCreator = new DataLineStyle(workbook, sheet);
 }
开发者ID:baptisteMillot,项目名称:Synoptique,代码行数:7,代码来源:PositionnementEtudeCreator.cs

示例9: CadrePA

 public CadrePA(ISheet sheet, XSSFWorkbook workbook)
 {
     _sheet = sheet;
     _workbook = workbook;
     _lineCreator = new DataLineStyle(workbook, sheet);
     _cadreCreator = new Cadre(workbook, sheet);
 }
开发者ID:baptisteMillot,项目名称:Synoptique,代码行数:7,代码来源:CadrePA.cs

示例10: CreateChart

          static void CreateChart(IDrawing drawing, ISheet sheet, IClientAnchor anchor, string serie1, string serie2)
        {


            IChart chart = drawing.CreateChart(anchor);
            IChartLegend legend = chart.GetOrCreateLegend();
            legend.Position = LegendPosition.TopRight;

            ILineChartData<double, double> data = chart.ChartDataFactory.CreateLineChartData<double, double>();

            // Use a category axis for the bottom axis.
            IChartAxis bottomAxis = chart.ChartAxisFactory.CreateCategoryAxis(AxisPosition.Bottom);
            IValueAxis leftAxis = chart.ChartAxisFactory.CreateValueAxis(AxisPosition.Left);
            leftAxis.Crosses = AxisCrosses.AutoZero;

            IChartDataSource<double> xs = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(0, 0, 0, NUM_OF_COLUMNS - 1));
            IChartDataSource<double> ys1 = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(1, 1, 0, NUM_OF_COLUMNS - 1));
            IChartDataSource<double> ys2 = DataSources.FromNumericCellRange(sheet, new CellRangeAddress(2, 2, 0, NUM_OF_COLUMNS - 1));


            var s1 = data.AddSeries(xs, ys1);
            s1.SetTitle(serie1);
            var s2 = data.AddSeries(xs, ys2);
            s2.SetTitle(serie2);

            chart.Plot(data, bottomAxis, leftAxis);
        }
开发者ID:Reinakumiko,项目名称:npoi,代码行数:27,代码来源:Program.cs

示例11: CreateHeaderRow

    static void CreateHeaderRow(ISheet _sheet)
    {
        IRow header = _sheet.CreateRow(1);

        int cellIdx = 1;

        // name
        ICell nameCell = header.CreateCell(cellIdx++);
        nameCell.SetCellValue("name");

        // hp
        ICell hpCell = header.CreateCell(cellIdx++);
        hpCell.SetCellValue("hp");

        // x
        ICell posxCell = header.CreateCell(cellIdx++);
        posxCell.SetCellValue("x");

        // y
        ICell posyCell = header.CreateCell(cellIdx++);
        posyCell.SetCellValue("y");

        // z
        ICell poszCell = header.CreateCell(cellIdx++);
        poszCell.SetCellValue("z");
    }
开发者ID:KzoNag,项目名称:unity-github-test,代码行数:26,代码来源:ExcelExporter.cs

示例12: WriteData

        public void WriteData(ISheet sheet, object model, IList<Property> properties)
        {
            var singleVals = new List<Property>();
            var listVals = new List<Property>();
            foreach (var p in properties)
            {
                if (p.IsArray)
                {
                    listVals.Add(p);
                }
                else
                {
                    singleVals.Add(p);
                }
            }

            foreach (var singleProp in singleVals)
            {
                WriteSingle(sheet, singleProp.RowIndex, singleProp.ColumnIndex, GetPropertyVal(model, singleProp.Name));
            }
            foreach (var listProp in listVals)
            {
                WriteArray(sheet, listProp.RowIndex, listProp.ColumnIndex, GetPropertyVals(model, listProp.Name));
            }
        }
开发者ID:ChrizLee,项目名称:excel-it,代码行数:25,代码来源:Writer.cs

示例13: GetCellNumic

        public static double GetCellNumic(ISheet sheet, char x, int y)
        {
            double _r = double.MinValue;

            ICell cell = sheet.GetRow(y - 1).GetCell(GetCellIntFromChar(x) - 1);
            if (cell != null)
                switch (cell.CellType)
                {
                    case CellType.String:
                        {
                            _r = double.Parse(cell.StringCellValue.Trim());

                        }
                        break;
                    case CellType.Numeric:
                        {
                            _r = cell.NumericCellValue;
                        }
                        break;
                    default:
                        {

                        }
                        break;
                }

            return _r;

        }
开发者ID:sloww,项目名称:tslinkcn.tools,代码行数:29,代码来源:PublicTools.cs

示例14: AddBorder

    /// <summary>
    /// 加边框
    /// </summary>
    /// <param Name="rowindex">1开始</param>
    /// <param Name="cellIndex">1开始</param>
    public void AddBorder( ISheet sheet, HSSFWorkbook workbook)
    {
        ICellStyle styel = workbook.CreateCellStyle();
        styel.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; // ------------------
        IFont font1 = workbook.CreateFont();
        font1.FontHeightInPoints = 11;

        font1.Boldweight = 600;
        font1.FontName = "宋体";
        styel.SetFont(font1);
        for (int rowindex=1;rowindex<sheet.LastRowNum+1;rowindex++)
        {
            for (int cellIndex =0; cellIndex < dcs.Count;cellIndex++ )
            {
                sheet.GetRow(rowindex).RowStyle = styel;
                ICell cell = sheet.GetRow(rowindex ).GetCell(cellIndex );

                HSSFCellStyle Style = workbook.CreateCellStyle() as HSSFCellStyle;

                Style.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
                Style.VerticalAlignment = VerticalAlignment.Center;
                Style.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
                Style.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
                Style.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
                Style.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
                Style.DataFormat = 0;
                Style.SetFont(font1);
                cell.CellStyle = Style;
            }
         }
    }
开发者ID:konglinghai123,项目名称:SAS,代码行数:36,代码来源:ExcelHelper.cs

示例15: AddListToExcelSheet

        public void AddListToExcelSheet(HSSFWorkbook workbook, ISheet sheet, string Title, Dictionary<string, bool> list)
        {
            //Create a Title row
            var titleFont = workbook.CreateFont();
            titleFont.Boldweight = (short)NPOI.SS.UserModel.FontBoldWeight.Bold;
            titleFont.FontHeightInPoints = 11;
            titleFont.Underline = NPOI.SS.UserModel.FontUnderlineType.Single;

            var titleStyle = workbook.CreateCellStyle();
            titleStyle.SetFont(titleFont);

            var row = sheet.CreateRow(rowCount++);
            row = sheet.CreateRow(rowCount++);
            var cell = row.CreateCell(0);
            cell.CellStyle = titleStyle;
            cell.SetCellValue(Title);
            foreach (var org in list)
            {
                if (org.Value == true)
                {
                    row = sheet.CreateRow(rowCount++);
                    cell = row.CreateCell(0);
                    cell.SetCellValue(org.Key);
                }
            }
        }
开发者ID:chuckfrazier,项目名称:DataPlatform,代码行数:26,代码来源:ServiceLineExplorerExplorerExcelExporter.cs


注:本文中的ISheet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。