Ejemplo n.º 1
0
 public XSSFPivotTable()
     : base()
 {
     pivotTableDefinition = new CT_PivotTableDefinition();
     pivotCache = new XSSFPivotCache();
     pivotCacheDefinition = new XSSFPivotCacheDefinition();
     pivotCacheRecords = new XSSFPivotCacheRecords();
 }
Ejemplo n.º 2
0
 public void ReadFrom(Stream is1)
 {
     try
     {
         //XmlOptions options  = new XmlOptions(DEFAULT_XML_OPTIONS);
         //Removing root element
         //options.LoadReplaceDocumentElement=(/*setter*/null);
         XmlDocument xmlDoc = ConvertStreamToXml(is1);
         pivotTableDefinition = CT_PivotTableDefinition.Parse(xmlDoc.DocumentElement, NamespaceManager);
     }
     catch (XmlException e)
     {
         throw new IOException(e.Message);
     }
 }
Ejemplo n.º 3
0
 public void SetCTPivotTableDefinition(CT_PivotTableDefinition pivotTableDefinition)
 {
     this.pivotTableDefinition = pivotTableDefinition;
 }
Ejemplo n.º 4
0
 public static CT_PivotTableDefinition Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_PivotTableDefinition ctObj = new CT_PivotTableDefinition();
     ctObj.name = XmlHelper.ReadString(node.Attributes["name"]);
     if (node.Attributes["cacheId"] != null)
         ctObj.cacheId = XmlHelper.ReadUInt(node.Attributes["cacheId"]);
     if (node.Attributes["dataOnRows"] != null)
         ctObj.dataOnRows = XmlHelper.ReadBool(node.Attributes["dataOnRows"]);
     if (node.Attributes["dataPosition"] != null)
         ctObj.dataPosition = XmlHelper.ReadUInt(node.Attributes["dataPosition"]);
     if (node.Attributes["autoFormatId"] != null)
         ctObj.autoFormatId = XmlHelper.ReadUInt(node.Attributes["autoFormatId"]);
     if (node.Attributes["applyNumberFormats"] != null)
         ctObj.applyNumberFormats = XmlHelper.ReadBool(node.Attributes["applyNumberFormats"]);
     if (node.Attributes["applyBorderFormats"] != null)
         ctObj.applyBorderFormats = XmlHelper.ReadBool(node.Attributes["applyBorderFormats"]);
     if (node.Attributes["applyFontFormats"] != null)
         ctObj.applyFontFormats = XmlHelper.ReadBool(node.Attributes["applyFontFormats"]);
     if (node.Attributes["applyPatternFormats"] != null)
         ctObj.applyPatternFormats = XmlHelper.ReadBool(node.Attributes["applyPatternFormats"]);
     if (node.Attributes["applyAlignmentFormats"] != null)
         ctObj.applyAlignmentFormats = XmlHelper.ReadBool(node.Attributes["applyAlignmentFormats"]);
     if (node.Attributes["applyWidthHeightFormats"] != null)
         ctObj.applyWidthHeightFormats = XmlHelper.ReadBool(node.Attributes["applyWidthHeightFormats"]);
     ctObj.dataCaption = XmlHelper.ReadString(node.Attributes["dataCaption"]);
     ctObj.grandTotalCaption = XmlHelper.ReadString(node.Attributes["grandTotalCaption"]);
     ctObj.errorCaption = XmlHelper.ReadString(node.Attributes["errorCaption"]);
     if (node.Attributes["showError"] != null)
         ctObj.showError = XmlHelper.ReadBool(node.Attributes["showError"]);
     ctObj.missingCaption = XmlHelper.ReadString(node.Attributes["missingCaption"]);
     if (node.Attributes["showMissing"] != null)
         ctObj.showMissing = XmlHelper.ReadBool(node.Attributes["showMissing"]);
     ctObj.pageStyle = XmlHelper.ReadString(node.Attributes["pageStyle"]);
     ctObj.pivotTableStyle = XmlHelper.ReadString(node.Attributes["pivotTableStyle"]);
     ctObj.vacatedStyle = XmlHelper.ReadString(node.Attributes["vacatedStyle"]);
     ctObj.tag = XmlHelper.ReadString(node.Attributes["tag"]);
     if (node.Attributes["updatedVersion"] != null)
         ctObj.updatedVersion = XmlHelper.ReadByte(node.Attributes["updatedVersion"]);
     if (node.Attributes["minRefreshableVersion"] != null)
         ctObj.minRefreshableVersion = XmlHelper.ReadByte(node.Attributes["minRefreshableVersion"]);
     if (node.Attributes["asteriskTotals"] != null)
         ctObj.asteriskTotals = XmlHelper.ReadBool(node.Attributes["asteriskTotals"]);
     if (node.Attributes["showItems"] != null)
         ctObj.showItems = XmlHelper.ReadBool(node.Attributes["showItems"]);
     if (node.Attributes["editData"] != null)
         ctObj.editData = XmlHelper.ReadBool(node.Attributes["editData"]);
     if (node.Attributes["disableFieldList"] != null)
         ctObj.disableFieldList = XmlHelper.ReadBool(node.Attributes["disableFieldList"]);
     if (node.Attributes["showCalcMbrs"] != null)
         ctObj.showCalcMbrs = XmlHelper.ReadBool(node.Attributes["showCalcMbrs"]);
     if (node.Attributes["visualTotals"] != null)
         ctObj.visualTotals = XmlHelper.ReadBool(node.Attributes["visualTotals"]);
     if (node.Attributes["showMultipleLabel"] != null)
         ctObj.showMultipleLabel = XmlHelper.ReadBool(node.Attributes["showMultipleLabel"]);
     if (node.Attributes["showDataDropDown"] != null)
         ctObj.showDataDropDown = XmlHelper.ReadBool(node.Attributes["showDataDropDown"]);
     if (node.Attributes["showDrill"] != null)
         ctObj.showDrill = XmlHelper.ReadBool(node.Attributes["showDrill"]);
     if (node.Attributes["printDrill"] != null)
         ctObj.printDrill = XmlHelper.ReadBool(node.Attributes["printDrill"]);
     if (node.Attributes["showMemberPropertyTips"] != null)
         ctObj.showMemberPropertyTips = XmlHelper.ReadBool(node.Attributes["showMemberPropertyTips"]);
     if (node.Attributes["showDataTips"] != null)
         ctObj.showDataTips = XmlHelper.ReadBool(node.Attributes["showDataTips"]);
     if (node.Attributes["enableWizard"] != null)
         ctObj.enableWizard = XmlHelper.ReadBool(node.Attributes["enableWizard"]);
     if (node.Attributes["enableDrill"] != null)
         ctObj.enableDrill = XmlHelper.ReadBool(node.Attributes["enableDrill"]);
     if (node.Attributes["enableFieldProperties"] != null)
         ctObj.enableFieldProperties = XmlHelper.ReadBool(node.Attributes["enableFieldProperties"]);
     if (node.Attributes["preserveFormatting"] != null)
         ctObj.preserveFormatting = XmlHelper.ReadBool(node.Attributes["preserveFormatting"]);
     if (node.Attributes["useAutoFormatting"] != null)
         ctObj.useAutoFormatting = XmlHelper.ReadBool(node.Attributes["useAutoFormatting"]);
     if (node.Attributes["pageWrap"] != null)
         ctObj.pageWrap = XmlHelper.ReadUInt(node.Attributes["pageWrap"]);
     if (node.Attributes["pageOverThenDown"] != null)
         ctObj.pageOverThenDown = XmlHelper.ReadBool(node.Attributes["pageOverThenDown"]);
     if (node.Attributes["subtotalHiddenItems"] != null)
         ctObj.subtotalHiddenItems = XmlHelper.ReadBool(node.Attributes["subtotalHiddenItems"]);
     if (node.Attributes["rowGrandTotals"] != null)
         ctObj.rowGrandTotals = XmlHelper.ReadBool(node.Attributes["rowGrandTotals"]);
     if (node.Attributes["colGrandTotals"] != null)
         ctObj.colGrandTotals = XmlHelper.ReadBool(node.Attributes["colGrandTotals"]);
     if (node.Attributes["fieldPrintTitles"] != null)
         ctObj.fieldPrintTitles = XmlHelper.ReadBool(node.Attributes["fieldPrintTitles"]);
     if (node.Attributes["itemPrintTitles"] != null)
         ctObj.itemPrintTitles = XmlHelper.ReadBool(node.Attributes["itemPrintTitles"]);
     if (node.Attributes["mergeItem"] != null)
         ctObj.mergeItem = XmlHelper.ReadBool(node.Attributes["mergeItem"]);
     if (node.Attributes["showDropZones"] != null)
         ctObj.showDropZones = XmlHelper.ReadBool(node.Attributes["showDropZones"]);
     if (node.Attributes["createdVersion"] != null)
         ctObj.createdVersion = XmlHelper.ReadByte(node.Attributes["createdVersion"]);
     if (node.Attributes["indent"] != null)
         ctObj.indent = XmlHelper.ReadUInt(node.Attributes["indent"]);
     if (node.Attributes["showEmptyRow"] != null)
         ctObj.showEmptyRow = XmlHelper.ReadBool(node.Attributes["showEmptyRow"]);
     if (node.Attributes["showEmptyCol"] != null)
         ctObj.showEmptyCol = XmlHelper.ReadBool(node.Attributes["showEmptyCol"]);
     if (node.Attributes["showHeaders"] != null)
         ctObj.showHeaders = XmlHelper.ReadBool(node.Attributes["showHeaders"]);
     if (node.Attributes["compact"] != null)
         ctObj.compact = XmlHelper.ReadBool(node.Attributes["compact"]);
     if (node.Attributes["outline"] != null)
         ctObj.outline = XmlHelper.ReadBool(node.Attributes["outline"]);
     if (node.Attributes["outlineData"] != null)
         ctObj.outlineData = XmlHelper.ReadBool(node.Attributes["outlineData"]);
     if (node.Attributes["compactData"] != null)
         ctObj.compactData = XmlHelper.ReadBool(node.Attributes["compactData"]);
     if (node.Attributes["published"] != null)
         ctObj.published = XmlHelper.ReadBool(node.Attributes["published"]);
     if (node.Attributes["gridDropZones"] != null)
         ctObj.gridDropZones = XmlHelper.ReadBool(node.Attributes["gridDropZones"]);
     if (node.Attributes["immersive"] != null)
         ctObj.immersive = XmlHelper.ReadBool(node.Attributes["immersive"]);
     if (node.Attributes["multipleFieldFilters"] != null)
         ctObj.multipleFieldFilters = XmlHelper.ReadBool(node.Attributes["multipleFieldFilters"]);
     if (node.Attributes["chartFormat"] != null)
         ctObj.chartFormat = XmlHelper.ReadUInt(node.Attributes["chartFormat"]);
     ctObj.rowHeaderCaption = XmlHelper.ReadString(node.Attributes["rowHeaderCaption"]);
     ctObj.colHeaderCaption = XmlHelper.ReadString(node.Attributes["colHeaderCaption"]);
     if (node.Attributes["fieldListSortAscending"] != null)
         ctObj.fieldListSortAscending = XmlHelper.ReadBool(node.Attributes["fieldListSortAscending"]);
     if (node.Attributes["mdxSubqueries"] != null)
         ctObj.mdxSubqueries = XmlHelper.ReadBool(node.Attributes["mdxSubqueries"]);
     if (node.Attributes["customListSort"] != null)
         ctObj.customListSort = XmlHelper.ReadBool(node.Attributes["customListSort"]);
     foreach (XmlNode childNode in node.ChildNodes)
     {
         if (childNode.LocalName == "location")
             ctObj.location = CT_Location.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "pivotFields")
             ctObj.pivotFields = CT_PivotFields.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "rowFields")
             ctObj.rowFields = CT_RowFields.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "rowItems")
             ctObj.rowItems = CT_rowItems.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "colFields")
             ctObj.colFields = CT_ColFields.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "colItems")
             ctObj.colItems = CT_colItems.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "pageFields")
             ctObj.pageFields = CT_PageFields.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "dataFields")
             ctObj.dataFields = CT_DataFields.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "formats")
             ctObj.formats = CT_Formats.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "conditionalFormats")
             ctObj.conditionalFormats = CT_ConditionalFormats.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "chartFormats")
             ctObj.chartFormats = CT_ChartFormats.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "pivotHierarchies")
             ctObj.pivotHierarchies = CT_PivotHierarchies.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "pivotTableStyleInfo")
             ctObj.pivotTableStyleInfo = CT_PivotTableStyle.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "filters")
             ctObj.filters = CT_PivotFilters.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "rowHierarchiesUsage")
             ctObj.rowHierarchiesUsage = CT_RowHierarchiesUsage.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "colHierarchiesUsage")
             ctObj.colHierarchiesUsage = CT_ColHierarchiesUsage.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "extLst")
             ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
     }
     return ctObj;
 }