示例#1
0
        private void ReadCacheSource(TOpenXmlReader DataStream)
        {
            string SourceType = DataStream.GetAttribute("type");

            if (SourceType == "external")
            {
                FRecords.Add(new TXlsxPivotCacheRecord(DataStream.GetXml()));
                return;
            }

            if (DataStream.IsSimpleTag)
            {
                DataStream.NextTag(); return;
            }
            string StartElement = DataStream.RecordName();

            if (!DataStream.NextTag())
            {
                return;
            }

            TCacheSourceRecord R = new TCacheSourceRecord(SourceType, DataStream.GetAttributeAsLong("connectionId", -1));

            FRecords.Add(R);

            while (!DataStream.AtEndElement(StartElement))
            {
                switch (DataStream.RecordName())
                {
                case "consolidation":
                    ReadConsolidation(DataStream, R);
                    break;

                case "worksheetSource":
                    ReadWorksheetSource(DataStream, R);
                    break;

                case "extLst":
                default:
                    TFutureStorage.Add(ref R.FutureStorage, new TFutureStorageRecord(DataStream.GetXml()));
                    break;
                }
            }
        }
示例#2
0
 private void ReadWorksheetSource(TOpenXmlReader DataStream, TCacheSourceRecord R)
 {
     R.WorksheetSource = new TWorksheetSource();
     R.WorksheetSource.LoadXlsx(DataStream);
 }
示例#3
0
 private void ReadConsolidation(TOpenXmlReader DataStream, TCacheSourceRecord R)
 {
     R.Consolidation = new TConsolidation();
     R.Consolidation.LoadXlsx(DataStream);
 }