Example #1
0
        private static AbsXLSRecords ReadHelper(string fileName, bool readSummaryStreams, ref byte[] ss, ref byte[] dss)
        {
            StructuredStorageFileBase base1 = StructuredStorageFileBase.Open(fileName);
            MemoryStream stream1            = new MemoryStream(base1.ReadStream("Workbook"));

            if (readSummaryStreams)
            {
                try
                {
                    ss = base1.ReadStream("" + '\x0005' + "SummaryInformation");
                }
                catch
                {
                }
                try
                {
                    dss = base1.ReadStream("" + '\x0005' + "DocumentSummaryInformation");
                }
                catch
                {
                }
            }
            base1.Close();
            BinaryReader  reader1  = new BinaryReader(stream1, new UnicodeEncoding());
            AbsXLSRecords records1 = new AbsXLSRecords();

            records1.Read(reader1);
            reader1.Close();
            stream1.Close();
            return(records1);
        }
Example #2
0
        private static void SaveXLSInternal(AbsXLSRecords records, string fileName, byte[] ss, byte[] dss)
        {
            StructuredStorageFileBase base1 = StructuredStorageFileBase.Create(fileName);

            base1.WriteStream("Workbook", XLSFileWriter.GetStream(records));
            if (ss != null)
            {
                base1.WriteStream("" + '\x0005' + "SummaryInformation", ss);
            }
            if (dss != null)
            {
                base1.WriteStream("" + '\x0005' + "DocumentSummaryInformation", dss);
            }
            base1.Close();
        }