Example #1
0
        public static CT_XmlColumnPr Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_XmlColumnPr ctObj = new CT_XmlColumnPr();

            if (node.Attributes["mapId"] != null)
            {
                ctObj.mapId = XmlHelper.ReadUInt(node.Attributes["mapId"]);
            }
            ctObj.xpath = XmlHelper.ReadString(node.Attributes["xpath"]);
            if (node.Attributes["denormalized"] != null)
            {
                ctObj.denormalized = XmlHelper.ReadBool(node.Attributes["denormalized"]);
            }
            if (node.Attributes["xmlDataType"] != null)
            {
                ctObj.xmlDataType = (ST_XmlDataType)Enum.Parse(typeof(ST_XmlDataType), node.Attributes["xmlDataType"].Value);
            }
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
Example #2
0
        public static CT_XmlColumnPr Parse(XmlNode node, XmlNamespaceManager namespaceMgr)
        {
            CT_XmlColumnPr ctXmlColPr = new CT_XmlColumnPr();

            if (node == null)
            {
                return(null);
            }

            if (node.Attributes["mapId"] != null)
            {
                ctXmlColPr.mapIdField = uint.Parse(node.Attributes["mapId"].Value);
            }
            if (node.Attributes["xpath"] != null)
            {
                ctXmlColPr.xpathField = node.Attributes["xpath"].Value;
            }
            if (node.Attributes["xmlDataType"] != null)
            {
                ctXmlColPr.xmlDataTypeField = (ST_XmlDataType)Enum.Parse(typeof(ST_XmlDataType), node.Attributes["xmlDataType"].Value);
            }
            if (node.Attributes["denormalized"] != null && node.Attributes["denormalized"].Value == "1")
            {
                ctXmlColPr.denormalizedField = true;
            }
            return(ctXmlColPr);
        }
Example #3
0
        public static CT_TableColumn Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_TableColumn ctObj = new CT_TableColumn();

            if (node.Attributes["id"] != null)
            {
                ctObj.id = XmlHelper.ReadUInt(node.Attributes["id"]);
            }
            ctObj.uniqueName = XmlHelper.ReadString(node.Attributes["uniqueName"]);
            ctObj.name       = XmlHelper.ReadString(node.Attributes["name"]);
            if (node.Attributes["totalsRowFunction"] != null)
            {
                ctObj.totalsRowFunction = (ST_TotalsRowFunction)Enum.Parse(typeof(ST_TotalsRowFunction), node.Attributes["totalsRowFunction"].Value);
            }
            ctObj.totalsRowLabel = XmlHelper.ReadString(node.Attributes["totalsRowLabel"]);
            if (node.Attributes["queryTableFieldId"] != null)
            {
                ctObj.queryTableFieldId = XmlHelper.ReadUInt(node.Attributes["queryTableFieldId"]);
            }
            if (node.Attributes["headerRowDxfId"] != null)
            {
                ctObj.headerRowDxfId = XmlHelper.ReadUInt(node.Attributes["headerRowDxfId"]);
            }
            if (node.Attributes["dataDxfId"] != null)
            {
                ctObj.dataDxfId = XmlHelper.ReadUInt(node.Attributes["dataDxfId"]);
            }
            if (node.Attributes["totalsRowDxfId"] != null)
            {
                ctObj.totalsRowDxfId = XmlHelper.ReadUInt(node.Attributes["totalsRowDxfId"]);
            }
            ctObj.headerRowCellStyle = XmlHelper.ReadString(node.Attributes["headerRowCellStyle"]);
            ctObj.dataCellStyle      = XmlHelper.ReadString(node.Attributes["dataCellStyle"]);
            ctObj.totalsRowCellStyle = XmlHelper.ReadString(node.Attributes["totalsRowCellStyle"]);
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "calculatedColumnFormula")
                {
                    ctObj.calculatedColumnFormula = CT_TableFormula.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "totalsRowFormula")
                {
                    ctObj.totalsRowFormula = CT_TableFormula.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "xmlColumnPr")
                {
                    ctObj.xmlColumnPr = CT_XmlColumnPr.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
Example #4
0
        public static TableDocument Parse(XmlDocument xmldoc, XmlNamespaceManager namespaceMgr)
        {
            CT_Table   obj       = new CT_Table();
            XmlElement tableNode = xmldoc.DocumentElement;

            obj.id          = XmlHelper.ReadUInt(tableNode.Attributes["id"]);
            obj.name        = XmlHelper.ReadString(tableNode.Attributes["name"]);
            obj.displayName = XmlHelper.ReadString(tableNode.Attributes["displayName"]);
            if (tableNode.Attributes["tableType"] != null)
            {
                obj.tableType = (ST_TableType)Enum.Parse(typeof(ST_TableType), tableNode.Attributes["tableType"].Value);
            }
            obj.totalsRowCount = XmlHelper.ReadUInt(tableNode.GetAttributeNode("totalsRowCount"));
            obj.totalsRowShown = XmlHelper.ReadBool(tableNode.GetAttributeNode("totalsRowShown"));
            obj.@ref           = XmlHelper.ReadString(tableNode.Attributes["ref"]);
            XmlNode autoFilter = xmldoc.SelectSingleNode("//d:autoFilter", namespaceMgr);

            if (autoFilter != null)
            {
                obj.autoFilter      = new CT_AutoFilter();
                obj.autoFilter.@ref = XmlHelper.ReadString(autoFilter.Attributes["name"]);
            }
            XmlNodeList tableCols = xmldoc.SelectNodes("//d:tableColumns/d:tableColumn", namespaceMgr);

            if (tableCols != null)
            {
                obj.tableColumns       = new CT_TableColumns();
                obj.tableColumns.count = (uint)tableCols.Count;
                foreach (XmlElement tableColNode in tableCols)
                {
                    CT_TableColumn ctTableCol = new CT_TableColumn();
                    ctTableCol.id                 = XmlHelper.ReadUInt(tableColNode.GetAttributeNode("id"));
                    ctTableCol.name               = XmlHelper.ReadString(tableColNode.GetAttributeNode("name"));
                    ctTableCol.uniqueName         = XmlHelper.ReadString(tableColNode.GetAttributeNode("uniqueName"));
                    ctTableCol.totalsRowCellStyle = XmlHelper.ReadString(tableColNode.GetAttributeNode("totalsRowCellStyle"));
                    ctTableCol.totalsRowDxfId     = XmlHelper.ReadUInt(tableColNode.GetAttributeNode("totalsRowDxfId"));
                    ctTableCol.totalsRowLabel     = XmlHelper.ReadString(tableColNode.GetAttributeNode("totalsRowDxfId"));
                    ctTableCol.queryTableFieldId  = XmlHelper.ReadUInt(tableColNode.GetAttributeNode("queryTableFieldId"));
                    ctTableCol.xmlColumnPr        = CT_XmlColumnPr.Parse(tableColNode.SelectSingleNode("d:xmlColumnPr", namespaceMgr), namespaceMgr);
                    //TODO: parse sub element of CT_TableColumn
                    obj.tableColumns.tableColumn.Add(ctTableCol);
                }
            }
            XmlNode tableStyleInfo = xmldoc.SelectSingleNode("//d:tableStyleInfo", namespaceMgr);

            if (tableStyleInfo != null)
            {
                obj.tableStyleInfo                   = new CT_TableStyleInfo();
                obj.tableStyleInfo.name              = XmlHelper.ReadString(tableStyleInfo.Attributes["name"]);
                obj.tableStyleInfo.showFirstColumn   = XmlHelper.ReadBool(tableStyleInfo.Attributes["showFirstColumn"]);
                obj.tableStyleInfo.showLastColumn    = XmlHelper.ReadBool(tableStyleInfo.Attributes["showLastColumn"]);
                obj.tableStyleInfo.showRowStripes    = XmlHelper.ReadBool(tableStyleInfo.Attributes["showRowStripes"]);
                obj.tableStyleInfo.showColumnStripes = XmlHelper.ReadBool(tableStyleInfo.Attributes["showColumnStripes"]);
            }
            return(new TableDocument(obj));
        }
Example #5
0
 public static CT_XmlColumnPr Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_XmlColumnPr ctObj = new CT_XmlColumnPr();
     if (node.Attributes["mapId"] != null)
         ctObj.mapId = XmlHelper.ReadUInt(node.Attributes["mapId"]);
     ctObj.xpath = XmlHelper.ReadString(node.Attributes["xpath"]);
     if (node.Attributes["denormalized"] != null)
         ctObj.denormalized = XmlHelper.ReadBool(node.Attributes["denormalized"]);
     if (node.Attributes["xmlDataType"] != null)
         ctObj.xmlDataType = (ST_XmlDataType)Enum.Parse(typeof(ST_XmlDataType), node.Attributes["xmlDataType"].Value);
     foreach (XmlNode childNode in node.ChildNodes)
     {
         if (childNode.LocalName == "extLst")
             ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
     }
     return ctObj;
 }
Example #6
0
 public XSSFXmlColumnPr(XSSFTable table, CT_TableColumn ctTableColum, CT_XmlColumnPr CT_XmlColumnPr)
 {
     this.table = table;
     this.ctTableColumn = ctTableColum;
     this.ctXmlColumnPr = CT_XmlColumnPr;
 }
Example #7
0
        public static CT_XmlColumnPr Parse(XmlNode node, XmlNamespaceManager namespaceMgr)
        {
            CT_XmlColumnPr ctXmlColPr = new CT_XmlColumnPr();

            if (node == null)
                return null;

            if(node.Attributes["mapId"]!=null)
                ctXmlColPr.mapIdField = uint.Parse(node.Attributes["mapId"].Value);
            if (node.Attributes["xpath"] != null)
                ctXmlColPr.xpathField = node.Attributes["xpath"].Value;
            if (node.Attributes["xmlDataType"] != null)
                ctXmlColPr.xmlDataTypeField = (ST_XmlDataType)Enum.Parse(typeof(ST_XmlDataType), node.Attributes["xmlDataType"].Value);
             if (node.Attributes["denormalized"] != null &&node.Attributes["denormalized"].Value=="1")
                ctXmlColPr.denormalizedField = true;
            return ctXmlColPr;
        }