示例#1
0
        ///<summary>
        ///Loads the existing XLS file (optionally preserving MS Excel records).
        ///</summary>
        ///<remarks>
        ///<p>If the only purpose of loading the file is to read data values and formatting using
        ///ExcelLite API, you should use <i>xlsOptions</i> set to <see cref="MB.WinEIDrive.Excel.XlsOptions.None">XlsOptions.None</see>
        ///as this will speed up the loading process.</p>
        ///<p>If you load the existing file to use it as template for a new file, you can choose
        ///whether you want to preserve specific MS Excel records not recognized by ExcelLite API.</p>
        ///</remarks>
        ///<param name="fileName">Existing XLS file name (opened for reading).</param>
        ///<param name="xlsOptions">XLS options.</param>
        public void LoadXls(string fileName, XlsOptions xlsOptions)
        {
            this.Reset();
            AbsXLSRecords records1 = ExcelFile.ReadHelper(fileName, (xlsOptions & XlsOptions.PreserveSummaries) != XlsOptions.None, ref this.summaryStream, ref this.documentSummaryStream);
            XLSFileReader reader1  = new XLSFileReader(this, xlsOptions);

            reader1.ImportRecords(records1, fileName);
        }
示例#2
0
        public void LoadXls(Stream stream, XlsOptions xlsOptions)
        {
            this.FileName = "Stream";
            this.Reset();
            AbsXLSRecords records = ReadStreamHelper(this, stream, (xlsOptions & XlsOptions.PreserveSummaries) != XlsOptions.None, ref this.summaryStream, ref this.documentSummaryStream, ref this.macrosesStream);

            this.FillChachedMsoRecords(records);
            new XLSFileReader(this, xlsOptions, this.FileName).ImportRecords(records, this.FileName);
        }
示例#3
0
 public ExcelFile(string fileName, XlsOptions xlsOptions)
 {
     this.rowColumnResolutionMethod      = MB.WinEIDrive.Excel.RowColumnResolutionMethod.RowOverColumn;
     this.groupMethodsAffectedCellsLimit = 0x2710;
     this.HashFactorA = 0x65;
     this.HashFactorB = 0x33;
     this.IDText      = "MB.WinEIDrive.Excel Free 2.3 for .NET 1.1, Version=23.1.5000.1000";
     this.Initialize();
     this.LoadXls(fileName, xlsOptions);
 }
示例#4
0
        public void LoadXls(string fileName, XlsOptions xlsOptions)
        {
            this.FileName = fileName;
            this.Reset();
            AbsXLSRecords records = null;

            using (FileStream stream = new FileStream(fileName, FileMode.Open))
            {
                records = ReadStreamHelper(this, stream, (xlsOptions & XlsOptions.PreserveSummaries) != XlsOptions.None, ref this.summaryStream, ref this.documentSummaryStream, ref this.macrosesStream);
            }
            this.FillChachedMsoRecords(records);
            new XLSFileReader(this, xlsOptions, fileName).ImportRecords(records, fileName);
        }