/// <summary> /// The first row of each sheet is considered as a title row /// </summary> /// <param name='asset'> /// Asset. /// </param> public void Add(byte[] bytes, SpreadSheetSourceType sourceType = SpreadSheetSourceType.CSV) { SpreadSheet xls = new SpreadSheet(bytes, sourceType); for (int i = 0; i < xls.GetSheetCount(); ++i) { xls.SetSheet(i); LexPage p = new LexPage(xls, pages.Count); p.SetLanguage(lang); pages.Add(p); } PageNo = 0; }
public SpreadSheet(byte[] bytes, Encoding encoding, SpreadSheetSourceType srcType = SpreadSheetSourceType.CSV) { SpreadSheetParser parser = null; if (srcType == SpreadSheetSourceType.CSV) { parser = new SpreadSheetCsvParser(true); } else if (srcType == SpreadSheetSourceType.XML) { parser = new SpreadSheetXMLParser(); } this.encoding = encoding; parser.preprocessor = preprocessor; sheets.AddRange(parser.ParseSheet(bytes, encoding)); SetSheet(0); }
public SpreadSheet(byte[] bytes, SpreadSheetSourceType srcType = SpreadSheetSourceType.CSV) : this(bytes, Encoding.UTF8, srcType) { }