Ejemplo n.º 1
0
 public LoadFromText(ExcelRangeBase range, string text, LoadFromTextParams parameters)
 {
     _range     = range;
     _worksheet = range.Worksheet;
     _text      = text;
     if (parameters.Format == null)
     {
         _format = new ExcelTextFormat();
     }
     else
     {
         _format = parameters.Format;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Loads a CSV text into a range starting from the top left cell.
        /// </summary>
        /// <param name="Text">The Text</param>
        /// <param name="Format">Information how to load the text</param>
        /// <returns>The range containing the data</returns>
        public ExcelRangeBase LoadFromText(string Text, ExcelTextFormat Format)
        {
            if (string.IsNullOrEmpty(Text))
            {
                var r = _worksheet.Cells[_fromRow, _fromCol];
                r.Value = "";
                return(r);
            }
            var parameters = new LoadFromTextParams
            {
                Format = Format
            };
            var func = new LoadFromText(this, Text, parameters);

            return(func.Load());
        }