コード例 #1
0
ファイル: TestExl.cs プロジェクト: vinhphu3000/unitylib
        public static void TestCodeGen()
        {
            string fileName = Application.dataPath + "/Tests/Editor/Test1.xlsx";

            IWorkbook workbook = ExcelHelper.Load(fileName);
            EDReader  reader   = new EDReader(workbook);

            ISheet dataSheet = workbook.GetSheetAt(0);

            Debug.Log(dataSheet.FirstRowNum + "," + dataSheet.LastRowNum);

            IRow row = dataSheet.GetRow(0);

            Debug.Log(row.FirstCellNum + "," + row.LastCellNum);
            row = dataSheet.GetRow(1);
            Debug.Log(row.FirstCellNum + "," + row.LastCellNum);
            row = dataSheet.GetRow(2);
            Debug.Log(row.FirstCellNum + "," + row.LastCellNum);
        }
コード例 #2
0
ファイル: TestExl.cs プロジェクト: vinhphu3000/unitylib
        public static void TestCell()
        {
            string fileName = Application.dataPath + "/Tests/Editor/Test.xlsx";

            IWorkbook workbook = ExcelHelper.Load(fileName);
            EDReader  reader   = new EDReader(workbook);

            ISheet dataSheet = workbook.GetSheetAt(0);

            IRow row = dataSheet.GetRow(0);

            for (int i = row.FirstCellNum; i < row.LastCellNum; ++i)
            {
                ICell cell = row.GetCell(i);
                if (cell.Hyperlink != null)
                {
                    Debug.LogFormat("Hype:{0},{1},{2},{3},{4},{5}", cell.Hyperlink.Label, cell.Hyperlink.Address, cell.Hyperlink.FirstRow, cell.Hyperlink.FirstColumn, cell.Hyperlink.LastRow, cell.Hyperlink.LastColumn);
                }

                Debug.LogFormat("Cell:{0},{1}", cell.CellType, cell.ColumnIndex);
            }
        }