public static void Run() { // ExStart:ExampleTitle // The path to the documents directory. string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); LoadOptions opts = new LoadOptions(); LightCellsDataHandlerVisitCells v = new LightCellsDataHandlerVisitCells(); opts.LightCellsDataHandler = v; Workbook wb = new Workbook(dataDir + "LargeBook1.xlsx", opts); int sheetCount = wb.Worksheets.Count; Console.WriteLine("Total sheets: " + sheetCount + ", cells: " + v.CellCount + ", strings: " + v.StringCount + ", formulas: " + v.FormulaCount); }
public static void Run() { //Source directory string sourceDir = RunExamples.Get_SourceDirectory(); LightCellsDataHandlerVisitCells v = new LightCellsDataHandlerVisitCells(); LoadOptions opts = new LoadOptions(); opts.LightCellsDataHandler = v; Workbook wb = new Workbook(sourceDir + "sampleReadUsingLightCellsApi.xlsx", opts); int sheetCount = wb.Worksheets.Count; Console.WriteLine("Total sheets: " + sheetCount + ", cells: " + v.CellCount + ", strings: " + v.StringCount + ", formulas: " + v.FormulaCount); Console.WriteLine("ReadUsingLightCellsApi executed successfully."); }
public static void Run() { // ExStart:ExampleTitle // The path to the documents directory. string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); LoadOptions opts = new LoadOptions(); LightCellsDataHandlerVisitCells v = new LightCellsDataHandlerVisitCells(); opts.LightCellsDataHandler = v; Workbook wb = new Workbook(dataDir + "LargeBook1.xlsx", opts); int sheetCount = wb.Worksheets.Count; Console.WriteLine("Total sheets: " + sheetCount + ", cells: " + v.CellCount + ", strings: " + v.StringCount + ", formulas: " + v.FormulaCount); }